.container { max-width: 800px; margin: 0 auto; padding: 24px 20px; }

h1 {
    font-size: 22px;
    font-weight: 800;
    margin: 20px 0 8px;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 10px;
    letter-spacing: -0.01em;
}

/* ── Forms ──────────────────────────────────────────────── */

.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

.form-row input {
    flex: 1;
    min-width: 140px;
    padding: 12px 14px;
    font-size: 15px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #f8faff;
    color: var(--color-text);
    transition: border-color 0.2s, background 0.2s;
}

.form-row input:focus { outline: none; border-color: var(--color-primary); background: white; }

/* ── Buttons ────────────────────────────────────────────── */

button {
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

button:active { transform: scale(0.97); }

button.primary {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    color: white;
    box-shadow: 0 2px 8px rgba(11,87,208,0.30);
}

button.danger {
    background: linear-gradient(135deg, var(--color-danger), #e53935);
    color: white;
}

button.success {
    background: linear-gradient(135deg, #1a7336, #28a745);
    color: white;
}

button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }

/* ── Table ──────────────────────────────────────────────── */

table { width: 100%; border-collapse: collapse; }

th, td {
    text-align: left;
    padding: 11px 12px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}

th {
    font-weight: 700;
    color: var(--color-muted);
    background: #f6f9ff;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Admins table: name truncates so buttons always stay visible */
#adminsList table { table-layout: auto; width: 100%; }
#adminsList td:first-child {
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#adminsList th:last-child,
#adminsList td:last-child { white-space: nowrap; text-align: right; }
#adminsList th:first-child { background: #f6f9ff; }

/* ── Badge variants ─────────────────────────────────────── */

.badge.green { background: #d4edda; color: #1b6432; }
.badge.gray  { background: var(--color-primary-light); color: var(--color-primary-dark); }

/* ── Feedback messages ──────────────────────────────────── */

.error-msg   { color: var(--color-danger);  font-size: 14px; margin-top: 8px; font-weight: 600; }
.success-msg { color: var(--color-success); font-size: 14px; margin-top: 8px; font-weight: 600; }

/* ── Tabs ───────────────────────────────────────────────── */

.tabs {
    display: flex;
    margin-bottom: 20px;
    background: white;
    border-radius: var(--radius);
    padding: 6px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border);
}

.tab-btn {
    flex: 1;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-muted);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    color: white;
    box-shadow: 0 2px 8px rgba(11,87,208,0.35);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tab-btn .material-symbols-rounded { font-size: 18px; vertical-align: -3px; }

.tab-btn.active .material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 18;
}

/* ── Category-passwords list ────────────────────────────── */

.cat-pw-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.cat-pw-item { background: var(--color-card); }

.cat-pw-row {
    display: flex;
    align-items: center;
    padding: 13px 14px;
    gap: 10px;
}

.cat-pw-name {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-pw-value {
    font-size: 13px;
    color: var(--color-text);
    font-family: 'Courier New', monospace;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-pw-value.unset {
    font-family: inherit;
    font-style: italic;
    color: var(--color-muted);
}

.cat-pw-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
    padding: 7px;
    border-radius: 8px;
    display: inline-flex;
    transition: background 0.15s;
    flex-shrink: 0;
}

.cat-pw-edit-btn:hover { background: var(--color-primary-light); }

.cat-pw-editor {
    padding: 12px 14px;
    background: #f6f9ff;
    border-top: 1px solid var(--color-border);
}

.cat-pw-editor-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.cat-pw-editor-row input {
    flex: 1;
    min-width: 120px;
    padding: 9px 12px;
    font-size: 14px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: white;
    transition: border-color 0.2s;
}

.cat-pw-editor-row input:focus { outline: none; border-color: var(--color-primary); }

/* ── Toggle switch ──────────────────────────────────────── */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #bbb;
    border-radius: 26px;
    transition: background 0.25s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch input:checked + .toggle-slider { background: var(--color-success); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

/* ── Products toggle column ─────────────────────────────── */

#productsList th:last-child,
#productsList td:last-child { width: 72px; text-align: center; }

/* ── Mobile ─────────────────────────────────────────────── */

@media (max-width: 640px) {
    .tab-btn .tab-label { display: none; }
    .tab-btn { padding: 12px; }

    .col-mobile-hidden { display: none; }

    td .btn-label { display: none; }
    td button { padding: 7px 10px; }
}
