@import url("/static/security-theme.css?v=security3");

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: #f5f7fa;
    color: #1f2937;
}

a {
    text-decoration: none;
    color: inherit;
}

/* LOGIN */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top, #eef4ff 0%, #f7f9fc 45%, #eef1f5 100%);
}

.login-card {
    width: 400px;
    max-width: calc(100% - 32px);
    background: #ffffff;
    padding: 42px;
    border-radius: 16px;
    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.10);
}

.brand {
    text-align: center;
    margin-bottom: 32px;
}

.brand-icon {
    font-size: 42px;
}

.brand h1 {
    margin: 12px 0 4px;
    font-size: 26px;
}

.brand p {
    margin: 0;
    color: #6b7280;
}

.login-card form label {
    display: block;
    margin-top: 18px;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
}

.login-card form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d5dae1;
    border-radius: 9px;
    font-size: 15px;
    outline: none;
}

.login-card form input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-card form button {
    width: 100%;
    border: 0;
    margin-top: 26px;
    padding: 13px;
    border-radius: 9px;
    background: #2563eb;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.error-box {
    margin-bottom: 18px;
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 8px;
    font-size: 14px;
}

/* TOP BAR */

.topbar {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.logo {
    font-size: 19px;
    font-weight: 700;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
}

.role {
    background: #eef2ff;
    color: #3730a3;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
}

.logout {
    color: #dc2626;
}

/* LAYOUT */

.layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.sidebar {
    width: 230px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 22px 14px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar nav a {
    padding: 11px 13px;
    border-radius: 8px;
    font-size: 14px;
}

.sidebar nav a:hover {
    background: #f3f4f6;
}

.sidebar nav a.active {
    background: #eef4ff;
    color: #1d4ed8;
    font-weight: 600;
}

.separator {
    border-top: 1px solid #e5e7eb;
    margin: 14px 4px;
}

/* CONTENT */

.content {
    flex: 1;
    padding: 34px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    margin: 0;
    font-size: 28px;
}

.page-header p {
    margin: 5px 0 0;
    color: #6b7280;
}

.primary-button {
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    padding: 11px 16px;
    font-weight: 600;
    cursor: pointer;
}

.search {
    margin-top: 28px;
}

.search input {
    width: 100%;
    max-width: 700px;
    padding: 12px 16px;
    border: 1px solid #d7dce3;
    border-radius: 9px;
    font-size: 14px;
}

.empty-state {
    margin-top: 55px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 55px;
}

.empty-icon {
    font-size: 44px;
}

.empty-state h2 {
    margin-bottom: 6px;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 22px;
}


/* =========================================================
   VAULT V2 - MOBILE FIRST
   ========================================================= */

button,
input,
textarea,
select {
    font: inherit;
}

button {
    touch-action: manipulation;
}

.vault-list {
    width: 100%;
    max-width: 980px;
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vault-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.035);
    scroll-margin-top: 80px;
}

.vault-card-head {
    min-height: 74px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
}

.entry-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.entry-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef4ff;
    color: #1d4ed8;
    font-weight: 800;
}

.entry-title-area {
    min-width: 0;
}

.entry-title-area h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-subtitle {
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-button,
.expand-button {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.favorite-button {
    width: 38px;
    height: 44px;
    color: #cbd5e1;
    font-size: 22px;
}

.favorite-button.selected {
    color: #f59e0b;
}

.expand-button {
    width: 38px;
    height: 44px;
    font-size: 28px;
    color: #64748b;
}

.quick-actions {
    display: flex;
    border-top: 1px solid #eef0f3;
}

.quick-actions button {
    flex: 1;
    min-height: 48px;
    border: 0;
    border-right: 1px solid #eef0f3;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.quick-actions button:last-child {
    border-right: 0;
}

.quick-actions button:active {
    background: #f1f5f9;
}

.quick-actions .copy-password {
    color: #1d4ed8;
}

.entry-details {
    display: none;
    padding: 4px 16px 16px;
    border-top: 1px solid #eef0f3;
    background: #fbfcfe;
}

.entry-details.open {
    display: block;
}

.detail-row {
    padding: 14px 0;
    border-bottom: 1px solid #edf0f3;
}

.detail-label {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.detail-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.password-row {
    flex-wrap: wrap;
}

.password-display {
    min-width: 120px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    word-break: break-all;
}

.mini-button {
    border: 1px solid #dbe1e8;
    background: #ffffff;
    padding: 7px 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.break-text,
.notes-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.detail-notes .notes-text {
    line-height: 1.5;
}

.detail-actions {
    display: flex;
    gap: 10px;
    padding-top: 16px;
}

.secondary-button,
.danger-button {
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
}

.secondary-button {
    border: 1px solid #d6dce4;
    background: #ffffff;
    color: #334155;
}

.danger-button {
    border: 1px solid #fecaca;
    background: #fff7f7;
    color: #b91c1c;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 980px;
}

.search-box > span {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 20px;
}

.search-box input {
    max-width: none;
    padding-left: 43px;
    padding-right: 42px;
    min-height: 48px;
    background: #ffffff;
}

.clear-search {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef2f6;
    color: #475569;
    font-size: 20px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
}

.modal-backdrop.open {
    display: flex;
}

.modal-open {
    overflow: hidden;
}

.entry-modal {
    width: min(680px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 70px rgba(15, 23, 42, .25);
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 22px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 21px;
}

.modal-header p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 13px;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 9px;
    background: #f1f5f9;
    color: #334155;
    font-size: 26px;
    cursor: pointer;
}

.entry-form {
    padding: 4px 22px 22px;
}

.entry-form label {
    margin-top: 0;
}

.form-group {
    margin-top: 18px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #d5dae1;
    border-radius: 9px;
    background: #ffffff;
    outline: none;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.password-input-wrap {
    display: flex;
}

.password-input-wrap input {
    border-radius: 9px 0 0 9px;
}

.password-input-wrap button {
    flex: 0 0 auto;
    padding: 0 14px;
    border: 1px solid #d5dae1;
    border-left: 0;
    border-radius: 0 9px 9px 0;
    background: #f8fafc;
    color: #1d4ed8;
    font-weight: 600;
    cursor: pointer;
}

.advanced-fields {
    margin-top: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
}

.advanced-fields summary {
    cursor: pointer;
    font-weight: 600;
    color: #475569;
}

.field-help {
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
}

.favorite-check {
    display: flex !important;
    align-items: center;
    gap: 9px;
    margin-top: 20px !important;
    cursor: pointer;
}

.favorite-check input {
    width: 18px;
    height: 18px;
}

.modal-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 22px -22px -22px;
    padding: 15px 22px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.modal-actions .primary-button,
.modal-actions .secondary-button {
    min-width: 110px;
}

.hidden {
    display: none !important;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    z-index: 2000;
    transform: translate(-50%, 30px);
    opacity: 0;
    pointer-events: none;
    padding: 11px 16px;
    border-radius: 9px;
    background: #0f172a;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    transition: .2s ease;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.mobile-fab,
.mobile-nav {
    display: none;
}


/* SMARTPHONE */

@media (max-width: 760px) {

    body {
        padding-bottom: calc(68px + env(safe-area-inset-bottom));
    }

    .topbar {
        height: 58px;
        padding: 0 14px;
    }

    .logo {
        font-size: 16px;
    }

    .desktop-user {
        display: none;
    }

    .user-area {
        gap: 8px;
    }

    .role {
        display: none;
    }

    .logout {
        padding: 8px;
        font-size: 13px;
    }

    .layout {
        display: block;
        min-height: calc(100vh - 58px);
    }

    .sidebar {
        display: none;
    }

    .content {
        padding: 20px 14px 28px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-header p {
        font-size: 13px;
    }

    .desktop-new {
        display: none;
    }

    .search {
        position: sticky;
        top: 58px;
        z-index: 20;
        margin: 17px -14px 0;
        padding: 9px 14px;
        background: rgba(245, 247, 250, .96);
        backdrop-filter: blur(8px);
    }

    .search-box input {
        font-size: 16px;
    }

    .vault-list {
        margin-top: 10px;
        gap: 10px;
    }

    .vault-card {
        border-radius: 13px;
    }

    .vault-card-head {
        min-height: 70px;
        padding: 8px 7px;
    }

    .favorite-button {
        width: 36px;
    }

    .entry-icon {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }

    .entry-title-area h2 {
        font-size: 15px;
    }

    .quick-actions button {
        min-height: 50px;
        font-size: 11px;
    }

    .entry-details {
        padding: 2px 14px 15px;
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-actions button {
        width: 100%;
        min-height: 44px;
    }

    .empty-state {
        margin-top: 20px;
        padding: 40px 20px;
    }

    .mobile-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        min-height: 62px;
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, .97);
        border-top: 1px solid #e2e8f0;
        backdrop-filter: blur(10px);
    }

    .mobile-nav a,
    .mobile-nav button {
        border: 0;
        background: transparent;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: #64748b;
        cursor: pointer;
    }

    .mobile-nav span {
        font-size: 20px;
    }

    .mobile-nav small {
        font-size: 10px;
        font-weight: 600;
    }

    .mobile-nav .active {
        color: #2563eb;
    }

    .mobile-fab {
        display: none;
    }

    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .entry-modal {
        width: 100%;
        max-height: 94vh;
        border-radius: 18px 18px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-header {
        padding: 17px 16px;
    }

    .modal-header h2 {
        font-size: 19px;
    }

    .entry-form {
        padding: 2px 16px 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        min-height: 48px;
    }

    .modal-actions {
        margin-left: -16px;
        margin-right: -16px;
        margin-bottom: -18px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    }

    .modal-actions button {
        flex: 1;
        min-height: 46px;
    }

    .toast {
        bottom: calc(78px + env(safe-area-inset-bottom));
        max-width: calc(100% - 30px);
        white-space: nowrap;
    }
}


/* FIX PASSWORD FIELD VAULT */

.entry-form .password-input-wrap {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.entry-form .password-input-wrap input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    margin: 0;
    border-radius: 9px 0 0 9px;
}

.entry-form .password-input-wrap button {
    flex: 0 0 auto;
    width: auto;
    min-width: 92px;
    min-height: 46px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #d5dae1;
    border-left: 0;
    border-radius: 0 9px 9px 0;
    background: #f8fafc;
    color: #1d4ed8;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 760px) {
    .entry-form .password-input-wrap button {
        min-width: 88px;
        min-height: 48px;
    }
}


/* RICERCA LIVE */

.vault-card.search-hidden {
    display: none;
}

.live-no-results {
    display: none;
    margin-top: 20px;
    padding: 34px 20px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.live-no-results.visible {
    display: block;
}

.live-no-results .icon {
    font-size: 34px;
    margin-bottom: 8px;
}

.live-no-results h3 {
    margin: 0 0 5px;
}

.live-no-results p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}


/* =========================================================
   PASSWORD GENERATOR
   ========================================================= */

.password-tools {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.password-strength {
    flex: 1;
    min-width: 0;
}

.strength-track {
    width: 100%;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.strength-bar {
    width: 0;
    height: 100%;
    border-radius: 999px;
    transition:
        width .2s ease,
        background .2s ease;
}

.strength-bar[data-level="weak"] {
    background: #dc2626;
}

.strength-bar[data-level="medium"] {
    background: #f59e0b;
}

.strength-bar[data-level="strong"] {
    background: #2563eb;
}

.strength-bar[data-level="excellent"] {
    background: #16a34a;
}

#strength-label {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
}

.password-tool-buttons {
    display: flex;
    gap: 7px;
}

.generator-button {
    width: auto !important;
    min-height: 34px;
    margin: 0 !important;
    padding: 6px 10px !important;
    border: 1px solid #dbe1e8 !important;
    border-radius: 7px !important;
    background: #ffffff !important;
    color: #334155 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer;
}

.password-generator {
    display: none;
    margin-top: 13px;
    padding: 15px;
    border: 1px solid #dbe3ed;
    border-radius: 11px;
    background: #f8fafc;
}

.password-generator.open {
    display: block;
}

.generator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 13px;
    font-size: 13px;
}

#length-value {
    color: #2563eb;
    font-weight: 700;
}

.length-control input[type="range"] {
    width: 100%;
    padding: 0;
    min-height: 28px;
    box-shadow: none;
    border: 0;
}

.generator-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 12px;
}

.generator-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    padding: 9px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    font-size: 13px;
}

.generator-options input {
    width: 17px !important;
    min-height: auto !important;
    height: 17px;
    margin: 0;
    padding: 0;
}

.generator-options .wide-option {
    grid-column: 1 / -1;
}

.generator-options small {
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    font-size: 10px;
}

.generator-presets {
    display: flex;
    gap: 7px;
    margin-top: 12px;
}

.generator-presets button {
    width: auto !important;
    flex: 1;
    min-height: 36px;
    margin: 0 !important;
    padding: 6px 10px !important;
    border: 1px solid #dbe1e8 !important;
    border-radius: 7px !important;
    background: #ffffff !important;
    color: #334155 !important;
    font-size: 12px !important;
    cursor: pointer;
}

.generate-password-button {
    width: 100% !important;
    min-height: 43px;
    margin-top: 13px !important;
    padding: 10px 12px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: #2563eb !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    cursor: pointer;
}


@media (max-width: 760px) {

    .password-tools {
        align-items: flex-start;
        flex-direction: column;
    }

    .password-strength {
        width: 100%;
    }

    .password-tool-buttons {
        width: 100%;
    }

    .generator-button {
        flex: 1;
        min-height: 40px;
    }

    .password-generator {
        margin-left: 0;
        margin-right: 0;
        padding: 13px;
    }

    .generator-options {
        grid-template-columns: 1fr 1fr;
    }

    .generator-options label {
        min-height: 44px;
    }

    .generator-presets button {
        min-height: 42px;
    }

    .generate-password-button {
        min-height: 48px;
        font-size: 14px !important;
    }
}


/* ==========================================================
   USER MANAGEMENT
   ========================================================== */

.users-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.user-card {
    background: #fff;
    border: 1px solid #e3e7ef;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.user-card-main {
    min-height: 82px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 12px;
    background: #edf3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #185adb;
    font-weight: 700;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info h2 {
    margin: 0 0 4px;
    font-size: 16px;
}

.user-username {
    color: #667085;
    font-size: 14px;
}

.user-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.active-status {
    background: #eaf8ef;
    color: #16803c;
}

.inactive-status {
    background: #f1f2f4;
    color: #667085;
}

.user-actions {
    border-top: 1px solid #e8ebf0;
    display: flex;
}

.user-actions > button,
.user-actions > form {
    flex: 1;
    margin: 0;
}

.user-actions button {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-right: 1px solid #e8ebf0;
    background: #fff;
    cursor: pointer;
    color: #1746b3;
}

.user-actions button:hover {
    background: #f7f9fc;
}

.user-actions .danger-text {
    color: #d92d20;
}

.user-modal-card {
    max-width: 560px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-help {
    margin-top: -6px;
    margin-bottom: 14px;
    color: #667085;
    font-size: 12px;
}

.page-notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
}

.success-notice {
    background: #eaf8ef;
    color: #166534;
}

.error-notice {
    background: #fff0f0;
    color: #b42318;
}


@media (max-width: 700px) {

    .user-card-main {
        align-items: flex-start;
        padding: 14px;
        flex-wrap: wrap;
    }

    .user-info {
        width: calc(100% - 64px);
    }

    .user-badges {
        width: 100%;
        padding-left: 60px;
    }

    .user-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .user-actions > form {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .user-modal-card {
        width: calc(100% - 24px);
    }
}


/* ==========================================================
   CATEGORY MANAGEMENT
   ========================================================== */

.category-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.category-card {
    background: #fff;
    border: 1px solid #e3e7ef;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.category-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
}

.category-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 12px;
    background: #edf3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
}

.category-info {
    flex: 1;
    min-width: 0;
}

.category-info h2 {
    margin: 0 0 5px;
    font-size: 16px;
}

.category-description {
    color: #667085;
    font-size: 13px;
}

.category-badges {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.system-status {
    background: #eef2ff;
    color: #3446a8;
}

.custom-status {
    background: #ecfdf3;
    color: #167647;
}

.entry-count-status {
    background: #f2f4f7;
    color: #475467;
}

.category-system-info {
    padding: 13px 20px;
    border-top: 1px solid #e8ebf0;
    background: #fafbfc;
    color: #667085;
    font-size: 13px;
}

.category-actions {
    display: flex;
    border-top: 1px solid #e8ebf0;
}

.category-actions > button,
.category-actions > form {
    flex: 1;
    margin: 0;
}

.category-actions button {
    width: 100%;
    min-height: 46px;
    border: 0;
    background: #fff;
    cursor: pointer;
    color: #1746b3;
}

.category-actions button:hover {
    background: #f7f9fc;
}

.category-actions .danger-text {
    color: #d92d20;
}

.category-editor {
    display: none;
    padding: 20px;
    border-top: 1px solid #e8ebf0;
    background: #fafbfc;
}

.category-editor.open {
    display: block;
}

.category-users-title {
    margin: 18px 0 10px;
    font-size: 13px;
    font-weight: 700;
}

.category-user-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.category-user-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e3e7ef;
    border-radius: 10px;
    cursor: pointer;
}

.category-user-option input {
    width: auto;
    margin: 0;
}

.category-user-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: #edf3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #185adb;
    font-size: 12px;
    font-weight: 700;
}

.category-user-data {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.category-user-data strong {
    font-size: 13px;
}

.category-user-data small {
    margin-top: 2px;
    color: #667085;
}

.category-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.empty-assignment {
    padding: 12px;
    background: #fff;
    border: 1px dashed #d0d5dd;
    border-radius: 10px;
    color: #667085;
    font-size: 13px;
}

.category-modal-card {
    max-width: 520px;
}


@media (max-width: 700px) {

    .category-card-head {
        padding: 14px;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .category-info {
        width: calc(100% - 64px);
    }

    .category-badges {
        width: 100%;
        justify-content: flex-start;
        padding-left: 62px;
    }

    .category-user-grid {
        grid-template-columns: 1fr;
    }

    .category-editor {
        padding: 14px;
    }

    .category-editor-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}


/* ==========================================================
   TOTP / 2FA
   ========================================================== */

.totp-card {
    max-width: 430px;
}

.totp-info {
    margin: 18px 0;
    color: #475467;
    font-size: 14px;
    line-height: 1.5;
}

.totp-info p {
    margin: 5px 0 0;
}

.totp-qr {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.totp-qr img {
    display: block;
    width: 220px;
    max-width: 100%;
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #e3e7ef;
}

.totp-manual {
    margin: 14px 0 22px;
    font-size: 13px;
}

.totp-manual summary {
    cursor: pointer;
    color: #175cd3;
}

.totp-secret {
    margin-top: 10px;
    padding: 10px;
    background: #f2f4f7;
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
    user-select: all;
}

.totp-code-input {
    text-align: center;
    font-size: 26px !important;
    font-weight: 700;
    letter-spacing: 8px;
}


@media (max-width: 600px) {

    .totp-qr img {
        width: 200px;
    }

    .totp-code-input {
        font-size: 24px !important;
    }
}

/* Security Theme */
