@import url("./theme.css");

:root {
    --brand-purple: #5a189a;
    --brand-orange: #fd7e14;
    --brand-white: #ffffff;
    --brand-shadow: rgba(90, 24, 154, 0.1);
    --surface-white: rgba(255, 255, 255, .96);
    --surface-soft: #f8fafc;
    --border-soft: #e5e7eb;
    --text-main: #111827;
    --text-muted: #6b7280;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
    width: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/YekanBakh-Regular.woff2') format('woff2'), url('../fonts/YekanBakh-Regular.woff') format('woff'), url('../fonts/YekanBakh-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    font-family: 'YekanBakh', sans-serif;
    overflow-x: hidden;
    /* بک‌گراند واحد پروژه در این بخش اعمال شده است */
    background: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18) 0, transparent 28%), radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.14) 0, transparent 24%), linear-gradient(135deg, #4c1d95 0%, #7c3aed 45%, #a855f7 100%);
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* رفع تداخل لایه‌های پس‌زمینه در تمام صفحات ورودی */
.auth-wrapper,
.user-register-page,
.operator-login,
.register-page-body {
    background: transparent !important;
}

.btn:focus,
.btn:active:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--brand-purple) !important;
}

.d-grid {
    display: grid;
    gap: 12px;
}

.auth-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.auth-card {
    max-width: 400px;
    width: 90%;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    color: var(--brand-white);
}

.auth-logo {
    width: 65px;
    height: 65px;
    background: var(--brand-purple);
    color: white;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 28px;
    transform: rotate(-5deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-brand-primary {
    background-color: var(--brand-purple);
    color: var(--brand-white);
    border: 2px solid var(--brand-purple);
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: block;
}

    .btn-brand-primary:hover {
        background-color: var(--brand-orange);
        border-color: var(--brand-orange);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(253, 126, 20, 0.3);
    }

.keypad-page {
    width: 100%;
    min-height: 100vh;
    padding: 32px;
    box-sizing: border-box;
}

.admin-entry-page {
    width: 100%;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.operator-entry-page {
    min-height: 100vh !important;
    padding: 0 !important;
    display: grid !important;
    place-items: center !important;
    overflow-x: hidden !important;
}

    .operator-entry-page .keypad-grid-layout {
        width: auto !important;
        max-width: calc(100vw - 48px) !important;
        margin: 0 auto !important;
        display: block !important;
    }

    .operator-entry-page .contact-form-card,
    .operator-entry-page #main-container {
        width: 450px !important;
        max-width: calc(100vw - 48px) !important;
        margin: 0 auto !important;
        position: static !important;
    }

.background-elements span {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: animateBubbles 15s linear infinite;
}

.admin-toolbar {
    max-width: 1320px;
    margin: 0 auto 24px auto;
    background: rgba(255, 255, 255, .92);
    border-radius: 22px;
    padding: 18px 22px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .12);
}

.admin-toolbar-single {
    width: calc(100% - 64px) !important;
    display: grid !important;
    grid-template-columns: minmax(470px, max-content) minmax(430px, 1fr) minmax(210px, 250px) !important;
    grid-template-areas: "actions search title" !important;
    align-items: center !important;
    gap: 12px !important;
    direction: ltr !important;
}

.admin-toolbar-main {
    display: contents !important;
}

.admin-toolbar-title {
    grid-area: title !important;
    direction: rtl !important;
    text-align: right !important;
    min-width: 0 !important;
}

    .admin-toolbar-title h4 {
        margin: 0;
        color: var(--text-main);
        font-weight: 900;
        white-space: nowrap;
    }

    .admin-toolbar-title span,
    .admin-toolbar span {
        color: var(--text-muted);
        font-size: 14px;
        white-space: nowrap;
    }

.admin-toolbar-search {
    grid-area: search !important;
    direction: rtl !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: 170px minmax(190px, 1fr) 82px !important;
    gap: 8px !important;
    align-items: center !important;
}

    .admin-toolbar-search .form-select,
    .admin-toolbar-search .form-control {
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 12px !important;
        border: 1px solid var(--border-soft) !important;
        font-size: 14px !important;
    }

    .admin-toolbar-search .kp-btn {
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 12px !important;
        white-space: nowrap !important;
    }

.admin-toolbar-actions {
    grid-area: actions !important;
    direction: rtl !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 10px !important;
}

    .admin-toolbar-actions .kp-btn {
        white-space: nowrap !important;
        min-height: 42px !important;
        padding: 8px 13px !important;
        font-size: 14px !important;
    }

.kp-btn {
    border: 0;
    outline: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    border-radius: 12px;
    color: #fff;
    font-weight: 800;
    transition: transform .15s ease, box-shadow .15s ease;
    cursor: pointer;
}

    .kp-btn:hover {
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 10px 22px rgba(0, 0, 0, .16);
    }

.kp-btn-sm {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 13px;
}

.kp-btn-primary {
    background: #2563eb;
}

.kp-btn-success {
    background: #059669;
}

.kp-btn-info {
    background: #06b6d4;
}

.kp-btn-danger {
    background: #dc2626;
}

.kp-btn-warning {
    background: #fbbf24;
    color: #111827;
}

    .kp-btn-warning:hover {
        color: #111827;
    }

.keypad-grid-layout {
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 450px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.keypad-card,
.contacts-container {
    background: var(--surface-white);
    border-radius: 26px;
    padding: 26px;
    box-shadow: 0 22px 55px rgba(0, 0, 0, .16);
}

.contacts-container {
    width: 450px;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.contact-form-card {
    position: sticky;
    top: 24px;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

    .card-header-row h2 {
        margin: 0;
        color: var(--text-main);
        font-size: 25px;
        font-weight: 900;
    }

#contactsPage.admin-entry-page.touch-mode .keypad-grid-layout {
    width: 100% !important;
    max-width: 1320px !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 24px !important;
}

#contactsPage.admin-entry-page.touch-mode .contact-form-card {
    width: 450px !important;
    max-width: calc(100vw - 48px) !important;
    margin: 0 auto !important;
    position: static !important;
}

.contacts-results-card,
#contactsPage.admin-entry-page.touch-mode .contacts-results-card {
    width: 100% !important;
    max-width: 1320px !important;
    margin: 0 auto !important;
}


.input-group-custom {
    margin-bottom: 18px;
    position: relative;
}

    .input-group-custom label {
        display: block;
        margin-bottom: 8px;
        color: #5b21b6;
        font-weight: 900;
    }

    .input-group-custom input:not([type="checkbox"]),
    .virtual-input {
        width: 100%;
        min-height: 52px;
        border-radius: 14px;
        border: 1px solid var(--border-soft);
        padding: 0 14px;
        font-size: 17px;
        background: #fff;
        transition: border .15s ease, box-shadow .15s ease, background-color .15s ease;
    }

.kp-select,
.search-panel .form-control,
.table-input {
    border-radius: 12px;
    min-height: 46px;
    border: 1px solid var(--border-soft);
}

    .input-group-custom input:focus,
    .virtual-input:focus,
    .table-input:focus,
    .kp-select:focus,
    .active-input {
        border-color: var(--brand-orange) !important;
        background-color: #fff9f2 !important;
        outline: none;
        box-shadow: 0 0 0 4px rgba(253, 126, 20, .12);
    }

.keypad-page.normal-mode .virtual-input {
    min-height: 46px;
    font-size: 16px;
    font-weight: 500;
}

.keypad-page.touch-mode .virtual-input {
    min-height: 58px;
    font-size: 18px;
    font-weight: 700;
}

.keypad-page.normal-mode .alpha-popup,
.keypad-page.normal-mode .keypad-side {
    display: none !important;
}

.btn-save {
    width: 100%;
    min-height: 56px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(249, 115, 22, .28);
    transition: 0.3s;
}

    .btn-save:hover {
        filter: brightness(1.1);
        transform: translateY(-2px);
    }

.mode-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.mode-switch-label {
    color: var(--text-main);
    font-weight: 800;
    font-size: 14px;
}

.mode-switch {
    position: relative;
    width: 162px;
    height: 42px;
    background: #2f3133;
    border-radius: 999px;
    padding: 4px;
    display: flex;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
}

.mode-option {
    position: relative;
    z-index: 2;
    width: 50%;
    border: 0;
    background: transparent;
    color: #fff;
    font-weight: 900;
    border-radius: 999px;
    cursor: pointer;
    transition: color .2s ease;
}

    .mode-option.active {
        color: var(--text-main);
    }

.mode-slider {
    position: absolute;
    top: 4px;
    right: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: #fff;
    border-radius: 999px;
    transition: transform .25s ease;
    z-index: 1;
}

.mode-switch.normal .mode-slider {
    transform: translateX(-100%);
}

.alpha-popup {
    display: none;
    margin: 10px 0 18px 0;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    animation: slideDown 0.3s ease;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-bottom: 8px;
}

    .keyboard-row:last-child {
        margin-bottom: 0;
    }

.alpha-key,
.num-key {
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 10px;
    min-height: 44px;
    flex: 1;
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

.alpha-key {
    height: 55px;
    min-width: 40px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

    .alpha-key:hover,
    .num-key:hover {
        background: #f1f5f9;
    }

    .alpha-key:active,
    .num-key:active {
        background: var(--brand-orange);
        color: white;
        transform: scale(0.95);
    }

.back-key {
    background-color: #f3f4f6;
    flex: 1.5;
}

.space-key {
    flex: 5;
    background: #fff;
}

.enter-key {
    background-color: var(--brand-purple);
    color: white;
    border: none;
    flex: 2;
}

    .enter-key:hover {
        background: var(--brand-orange);
    }

.keypad-side {
    display: none;
    flex: 1;
    justify-content: center;
    align-items: center;
    padding-right: 18px;
    margin-right: 20px;
    border-right: 2px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.5s ease;
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(70px, 85px));
    justify-content: center;
    gap: 10px;
    background: var(--surface-soft);
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--border-soft);
}

.num-key {
    width: 85px;
    height: 85px;
    border-radius: 18px;
    color: var(--brand-purple);
    font-size: 1.8rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.clear-key {
    color: #e74c3c;
}

#contactsPage.touch-mode #main-container.expanded-alpha,
#contactsPage.touch-mode #main-container.expanded-numeric {
    width: min(1000px, calc(100vw - 48px)) !important;
    max-width: calc(100vw - 48px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

    #contactsPage.touch-mode #main-container.expanded-numeric .row {
        align-items: center !important;
    }

#contactsPage.touch-mode #numeric-side {
    max-width: 420px !important;
}

.expanded-numeric #form-side {
    padding-right: 20px;
}

.transition-all {
    transition: all 0.5s ease;
}

.search-panel {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 130px;
    gap: 10px;
    margin-bottom: 20px;
}

.contacts-table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--border-soft);
}

.contacts-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

    .contacts-table thead th {
        background: #f5f3ff;
        color: #4c1d95;
        font-weight: 900;
        padding: 14px;
        border-bottom: 1px solid var(--border-soft);
    }

    .contacts-table tbody td {
        padding: 12px;
        border-bottom: 1px solid #f1f5f9;
        vertical-align: middle;
    }

    .contacts-table tbody tr:hover {
        background: #fafafa;
    }

    .contacts-table tbody tr:last-child td {
        border-bottom: 0;
    }

.results-header-row {
    margin-bottom: 14px !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 1280px) {
    .admin-toolbar.admin-toolbar-single {
        grid-template-columns: minmax(420px, max-content) minmax(380px, 1fr) minmax(190px, 220px) !important;
        gap: 10px !important;
        padding: 16px 18px !important;
    }

    .admin-toolbar-actions {
        gap: 8px !important;
    }

        .admin-toolbar-actions .kp-btn {
            padding: 8px 10px !important;
            font-size: 13px !important;
        }

    .admin-toolbar-search {
        grid-template-columns: 160px minmax(170px, 1fr) 76px !important;
    }
}

@media (max-width: 1160px) {
    .admin-toolbar.admin-toolbar-single {
        width: calc(100% - 32px) !important;
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "title"
            "search"
            "actions" !important;
    }

    .admin-toolbar-title {
        text-align: center !important;
    }

    .admin-toolbar-search {
        grid-template-columns: 1fr !important;
    }

    .admin-toolbar-actions {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
}

@media (max-width: 1100px) {
    .keypad-grid-layout,
    #contactsPage.normal-mode.admin-entry-page .keypad-grid-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        grid-template-columns: 1fr !important;
    }

    .contact-form-card,
    #contactsPage.normal-mode.admin-entry-page .contact-form-card {
        position: static !important;
        width: 100% !important;
        max-width: 450px !important;
    }

    #contactsPage.touch-mode #main-container.expanded-numeric {
        width: min(520px, calc(100vw - 32px)) !important;
    }

        #contactsPage.touch-mode #main-container.expanded-numeric #form-side {
            width: 100% !important;
            max-width: 450px !important;
            padding-right: 0 !important;
            margin: 0 auto !important;
        }

        #contactsPage.touch-mode #main-container.expanded-numeric #numeric-side {
            width: 100% !important;
            max-width: 450px !important;
            margin: 18px auto 0 auto !important;
            padding-right: 0 !important;
            padding-left: 0 !important;
            border-right: 0 !important;
        }

        #contactsPage.touch-mode #main-container.expanded-numeric .keypad-grid {
            grid-template-columns: repeat(3, 1fr) !important;
            width: 100% !important;
        }

        #contactsPage.touch-mode #main-container.expanded-numeric .num-key {
            width: 100% !important;
        }
}

@media (max-width: 768px) {
    .keypad-page {
        padding: 16px;
    }

    .keypad-card,
    .contacts-container {
        padding: 18px;
        border-radius: 20px;
    }

    .card-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .mode-switch-wrapper {
        justify-content: space-between;
    }

    .admin-toolbar-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
    }

    .contacts-container {
        width: 95% !important;
        max-width: 400px;
        margin: 10px auto;
    }
}

.admin-toolbar.admin-toolbar-single {
    max-width: 1320px !important;
    width: calc(100% - 64px) !important;
    margin: 0 auto 24px auto !important;
    padding: 18px 22px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    direction: rtl !important;
    overflow: visible !important;
}

.admin-toolbar-single .admin-toolbar-main {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 14px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    direction: rtl !important;
}

.admin-toolbar-single .admin-toolbar-title {
    flex: 0 0 230px !important;
    min-width: 230px !important;
    max-width: 230px !important;
    text-align: right !important;
    direction: rtl !important;
}

    .admin-toolbar-single .admin-toolbar-title h4 {
        margin: 0 !important;
        white-space: nowrap !important;
        font-size: 22px !important;
    }

    .admin-toolbar-single .admin-toolbar-title span {
        display: block !important;
        white-space: nowrap !important;
        font-size: 13px !important;
    }

.admin-toolbar-single .admin-toolbar-search {
    flex: 0 1 440px !important;
    width: 440px !important;
    max-width: 440px !important;
    min-width: 390px !important;
    display: grid !important;
    grid-template-columns: 155px minmax(160px, 1fr) 74px !important;
    gap: 8px !important;
    align-items: center !important;
    margin: 0 !important;
    direction: rtl !important;
}

    .admin-toolbar-single .admin-toolbar-search .form-select,
    .admin-toolbar-single .admin-toolbar-search .form-control {
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 12px !important;
        font-size: 14px !important;
    }

    .admin-toolbar-single .admin-toolbar-search .kp-btn {
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 10px !important;
        font-size: 14px !important;
        white-space: nowrap !important;
    }

.admin-toolbar-single .admin-toolbar-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    direction: rtl !important;
}

    .admin-toolbar-single .admin-toolbar-actions .kp-btn {
        min-height: 42px !important;
        padding: 8px 11px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }

@media (max-width: 1120px) {
    .admin-toolbar.admin-toolbar-single {
        flex-direction: column !important;
        align-items: stretch !important;
        width: calc(100% - 32px) !important;
    }

    .admin-toolbar-single .admin-toolbar-main {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .admin-toolbar-single .admin-toolbar-title {
        flex: none !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        text-align: center !important;
    }

    .admin-toolbar-single .admin-toolbar-search {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        grid-template-columns: 1fr !important;
    }

    .admin-toolbar-single .admin-toolbar-actions {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
}

#numeric-side .keypad-grid,
#numeric-side .num-key {
    direction: ltr !important;
}

/* حالت معمولی ادمین: فرم از اولین Paint در مرکز صفحه قرار می‌گیرد */
#contactsPage.normal-mode.admin-entry-page .keypad-grid-layout {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 1320px !important;
    margin: 0 auto !important;
    gap: 24px !important;
}

#contactsPage.normal-mode.admin-entry-page .contact-form-card,
#contactsPage.normal-mode.admin-entry-page #main-container {
    width: 450px !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    position: static !important;
}

#contactsPage.normal-mode.admin-entry-page .contacts-results-card {
    width: 100% !important;
    max-width: 1320px !important;
}

.user-register-shell {
    width: 100%;
    max-width: 1080px;
    position: relative;
    z-index: 2;
}

.register-topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    color: #ffffff;
}

.page-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.82rem;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.register-topbar h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 950;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.register-topbar p {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
    font-size: 0.98rem;
}

.top-back-btn {
    min-width: 140px;
    height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    color: #ffffff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.22s ease;
}

    .top-back-btn:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.24);
        transform: translateY(-2px);
    }

.register-alert {
    margin-bottom: 18px;
    padding: 15px 18px;
    border-radius: 16px;
    color: #991b1b;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    display: flex;
    gap: 8px;
    align-items: center;
    box-shadow: 0 18px 35px rgba(127, 29, 29, 0.12);
}

.register-card {
    display: grid;
    grid-template-columns: 310px 1fr;
    min-height: 560px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(17, 24, 39, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.70);
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.register-card-side {
    padding: 38px 30px;
    background: linear-gradient(180deg, rgba(76, 29, 149, 0.96), rgba(124, 58, 237, 0.94)), radial-gradient(circle at top right, rgba(255, 255, 255, 0.20), transparent 35%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.side-icon {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.24);
    margin-bottom: 22px;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.14);
}

.register-card-side h2 {
    margin: 0 0 12px;
    font-size: 1.45rem;
    font-weight: 950;
    color: #ffffff;
}

.register-card-side > p {
    margin: 0;
    line-height: 2;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
}

.side-tips {
    margin-top: 34px;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

    .side-tips div {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 11px 12px;
        border-radius: 15px;
        background: rgba(255, 255, 255, 0.11);
        border: 1px solid rgba(255, 255, 255, 0.14);
    }

    .side-tips span {
        width: 24px;
        height: 24px;
        flex: 0 0 24px;
        border-radius: 50%;
        background: rgba(16, 185, 129, 0.95);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
        font-weight: 900;
    }

    .side-tips p {
        margin: 0;
        font-size: 0.88rem;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.88);
    }

.register-card-main {
    padding: 42px;
    display: flex;
    align-items: center;
}

    .register-card-main form {
        width: 100%;
    }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.full-width-field {
    grid-column: span 2;
}

.form-field {
    min-width: 0;
}

.modern-label {
    display: block;
    margin-bottom: 9px;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 900;
    text-align: right;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    z-index: 2;
    pointer-events: none;
}

.modern-input,
.modern-select {
    width: 100% !important;
    height: 54px !important;
    border-radius: 16px !important;
    border: 1px solid #dbe3ef !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 0.98rem !important;
    font-weight: 600 !important;
    padding: 0 56px 0 16px !important;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.035);
    transition: all 0.22s ease !important;
}

    .modern-input::placeholder {
        color: #94a3b8;
        font-weight: 500;
    }

.modern-select {
    cursor: pointer;
}

    .modern-input:focus,
    .modern-select:focus {
        border-color: #8b5cf6 !important;
        background: #ffffff !important;
        box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14), 0 14px 30px rgba(15, 23, 42, 0.08) !important;
        outline: none !important;
    }

.input-wrap:focus-within .input-icon {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
}

.form-actions-row {
    margin-top: 32px;
    padding-top: 26px;
    border-top: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-submit-modern {
    height: 48px;
    padding: 0 34px;
    border-radius: 15px;
    border: none;
    color: #ffffff;
    font-weight: 950;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 16px 30px rgba(16, 185, 129, 0.28);
    transition: all 0.22s ease;
}

    .btn-submit-modern:hover {
        transform: translateY(-2px);
        box-shadow: 0 20px 36px rgba(16, 185, 129, 0.35);
        filter: brightness(1.04);
    }

.btn-cancel-modern {
    height: 48px;
    padding: 0 26px;
    border-radius: 15px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-weight: 900;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.22s ease;
}

    .btn-cancel-modern:hover {
        background: #e2e8f0;
        color: #334155;
    }

@media (max-width: 992px) {
    .register-card {
        grid-template-columns: 1fr;
    }

    .register-card-side {
        padding: 28px;
    }

    .register-card-main {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .register-topbar {
        flex-direction: column;
        align-items: stretch;
    }

        .register-topbar h1 {
            font-size: 1.55rem;
        }

    .top-back-btn {
        width: 100%;
    }

    .register-card {
        border-radius: 24px;
    }

    .register-card-side {
        display: none;
    }

    .register-card-main {
        padding: 22px;
    }

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

    .full-width-field {
        grid-column: span 1;
    }

    .form-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-submit-modern,
    .btn-cancel-modern {
        width: 100%;
    }
}

.main-full {
    width: 100%;
    min-height: 100vh;
}

/* OPERATOR LOGIN WRAPPER */
.operator-login {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'YekanBakh', sans-serif;
    background: transparent !important; /* هماهنگ با مدیریت بک‌گراند واحد پروژه */
    position: relative;
    z-index: 1;
}

/* CARD (Premium Glass + Depth) */
.login-card {
    width: 100%;
    max-width: 390px;
    padding: 35px;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.45); /* شیشه تیره‌تر برای کنتراست فوق‌العاده در برابر گرادینت */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    color: #f3f4f6;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

    .login-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 35px 70px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    }

/* HEADER */
.login-header {
    text-align: center;
    margin-bottom: 28px;
}

    .login-header .icon {
        font-size: 40px;
        margin-bottom: 12px;
        display: inline-block;
        animation: pulseGlow 3s infinite alternate;
    }

@keyframes pulseGlow {
    from {
        filter: drop-shadow(0 4px 10px rgba(139, 92, 246, 0.4));
        transform: scale(1);
    }

    to {
        filter: drop-shadow(0 12px 25px rgba(139, 92, 246, 0.7));
        transform: scale(1.05);
    }
}

.login-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
}

.login-header p {
    margin: 8px 0 0;
    font-size: 13px;
    color: rgba(243, 244, 246, 0.65);
    font-weight: 500;
}

/* ERROR ALERT */
.alert-box {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: right;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

/* FORM */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* INPUT GROUP */
.input-group {
    display: flex;
    flex-direction: column;
}

    .input-group label {
        font-size: 13px;
        color: rgba(255, 255, 255, 0.85);
        margin-bottom: 8px;
        font-weight: 800;
        text-align: right;
    }

    /* INPUTS */
    .input-group input {
        width: 100%;
        height: 50px;
        padding: 0 16px;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: #ffffff;
        font-size: 14.5px;
        font-weight: 600;
        outline: none;
        box-sizing: border-box;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

        .input-group input::placeholder {
            color: rgba(255, 255, 255, 0.25);
            font-size: 13px;
            font-weight: 400;
        }

        .input-group input:focus {
            border-color: #a78bfa;
            box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), 0 10px 25px rgba(0, 0, 0, 0.2);
            background: rgba(255, 255, 255, 0.08);
        }

/* LOGIN BUTTON */
.btn-login {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    font-family: 'YekanBakh', sans-serif;
    cursor: pointer;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.3);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .btn-login:hover {
        background: linear-gradient(135deg, #4f46e5, #7c3aed);
        transform: translateY(-2px);
        box-shadow: 0 16px 32px rgba(99, 102, 241, 0.45);
    }

    .btn-login:active {
        transform: translateY(1px);
        box-shadow: 0 6px 12px rgba(99, 102, 241, 0.2);
    }

/* FOOTER */
.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}
/* ساختار نگه‌دارنده برای فیلد رمز عبور */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

    /* اصلاح پدینگ اینپوت رمز عبور برای عدم تداخل با آیکون چشم */
    .password-wrapper input {
        padding-left: 45px !important; /* فضای کافی برای آیکون در سمت چپ */
    }

/* استایل دکمه چشم */
.toggle-password {
    position: absolute;
    left: 12px; /* قرارگیری در سمت چپ در محیط RTL */
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.1s ease;
    user-select: none;
}

    .toggle-password:hover {
        color: #a78bfa; /* تغییر رنگ به بنفش ملایم هنگام هاور */
        transform: scale(1.1);
    }

    .toggle-password:active {
        transform: scale(0.95);
    }
/* CONTAINER & PURPLE BACKGROUND (مطابق تصویر) */
.user-register-page {
    min-height: 100vh;
    display: flex;
    justify-content: center; /* تراز افقی کاملا وسط */
    align-items: center; /* تراز عمودی کاملا وسط */
    padding: 40px 20px;
    font-family: 'YekanBakh', sans-serif;
    background: #6d28d9; /* رنگ بنفش زنده پس‌زمینه کل صفحه */
    box-sizing: border-box;
}

.user-register-shell {
    width: 100%;
    max-width: 1050px; /* سقف عرض کانتینر برای مانیتورهای بزرگ */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* TOPBAR (روشن و متناسب با پس‌زمینه بنفش) */
.register-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
}

.page-badge {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    display: inline-block;
    margin-bottom: 8px;
}

.register-topbar h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
}

.register-topbar p {
    margin: 6px 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.top-back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 700;
    transition: all 0.2s ease;
}

    .top-back-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }

/* ALERT BOX */
.register-alert {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
}

/* MAIN REGISTER CARD (پوسته روشن موجود در تصویر) */
.register-card {
    display: grid;
    grid-template-columns: 340px 1fr; /* سایدبار سمت راست در RTL */
    border-radius: 32px; /* لبه‌های کاملا گرد مطابق تصویر */
    background: #f8fafc; /* بدنه اصلی سفید مایل به خاکستری */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

/* SIDE PANEL (بخش بنفش کارت) */
.register-card-side {
    background: #5b21b6; /* بنفش تیره‌تر و عمیق برای سایدبار داخلی */
    padding: 45px 30px;
    display: flex;
    flex-direction: column;
    color: #ffffff;
}

.side-icon-wrap .side-svg-icon {
    width: 54px;
    height: 54px;
    stroke: #ffffff;
    stroke-width: 1.5;
    fill: rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.08);
    padding: 10px;
    border-radius: 18px;
}

.register-card-side h2 {
    font-size: 22px;
    font-weight: 900;
    margin: 0 0 12px;
    color: #ffffff;
}

.register-card-side p {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin: 0 0 35px;
}

/* تپ‌های راهنما داخل سایدبار (مطابق تصویر) */
.side-tips {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

    .side-tips > div {
        display: flex;
        align-items: center;
        gap: 12px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.1);
        padding: 12px 16px;
        border-radius: 14px;
    }

    .side-tips .check-icon {
        width: 18px;
        height: 18px;
        stroke: #10b981; /* تیک سبز رنگ */
        stroke-width: 3;
        fill: none;
        background: #ffffff;
        border-radius: 50%;
        padding: 2px;
    }

    .side-tips p {
        margin: 0;
        font-size: 13px;
        color: #ffffff;
        font-weight: 700;
    }

/* MAIN FORM AREA (بخش فیلدها) */
.register-card-main {
    padding: 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.full-width-field {
    grid-column: span 2;
}

/* INPUT CONTROLS */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modern-label {
    font-size: 13.5px;
    font-weight: 800;
    color: #334155; /* رنگ تیره برای متن لیبل‌ها */
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

    /* آیکون‌های داخل فیلدها در محیط روشن */
    .input-wrap .input-icon {
        position: absolute;
        right: 14px;
        width: 20px;
        height: 20px;
        stroke: #64748b;
        stroke-width: 2;
        fill: none;
        pointer-events: none;
    }

.modern-input, .modern-select {
    width: 100%;
    height: 50px;
    padding: 0 46px 0 16px;
    border-radius: 16px; /* لبه‌های کاملا گرد ورودی‌ها مطابق عکس */
    background: #ffffff; /* پس‌زمینه سفید فیلدها */
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 14.5px;
    font-weight: 600;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.modern-select {
    appearance: none;
    cursor: pointer;
}

    .modern-input:focus, .modern-select:focus {
        border-color: #6d28d9;
        box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.1);
        background: #ffffff;
    }

.modern-input::placeholder {
    color: #94a3b8;
    font-size: 13.5px;
}

/* PASSWORD EYE VISIBILITY */
.password-wrapper {
    position: relative;
    width: 100%;
}

    .password-wrapper .modern-input {
        padding-left: 46px; /* فضای دکمه چشم در سمت چپ */
    }

.toggle-password {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

    .toggle-password .eye-svg {
        position: absolute;
        width: 100%;
        height: 100%;
        fill: none;
        stroke: #64748b;
        stroke-width: 2;
        transition: all 0.2s ease;
    }

    .toggle-password .eye-closed {
        opacity: 0;
        transform: scale(0.5);
    }

    .toggle-password.is-visible .eye-open {
        opacity: 0;
        transform: scale(0.5);
    }

    .toggle-password.is-visible .eye-closed {
        opacity: 1;
        transform: scale(1);
    }

    .toggle-password:hover .eye-svg {
        stroke: #6d28d9;
    }

/* ACTION BUTTONS (دکمه ثبت سبز رنگ و بازگشت خاکستری مطابق تصویر) */
.form-actions-row {
    margin-top: 35px;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* دکمه‌ها متمایل به چپ/وسط فرم */
    gap: 12px;
}

.btn-submit-modern {
    height: 48px;
    padding: 0 36px;
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    background: #10b981; /* رنگ سبز زمردی کامپوننت ثبت کاربر */
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}

    .btn-submit-modern:hover {
        background: #059669;
        transform: translateY(-1px);
        box-shadow: 0 12px 24px -5px rgba(16, 185, 129, 0.4);
    }

.btn-cancel-modern {
    height: 48px;
    padding: 0 28px;
    border-radius: 14px;
    background: #e2e8f0; /* رنگ دکمه بازگشت خاکستری ملایم */
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .btn-cancel-modern:hover {
        background: #cbd5e1;
        color: #1e293b;
    }

/* RESPONSIVE DESIGN */
@media (max-width: 850px) {
    .register-card {
        grid-template-columns: 1fr;
    }

    .register-card-side {
        border-bottom: 1px solid #e2e8f0;
        padding: 30px 20px;
    }

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

    .full-width-field {
        grid-column: span 1;
    }

    .register-card-main {
        padding: 30px 20px;
    }

    .form-actions-row {
        justify-content: cubic-bezier;
        width: 100%;
    }

    .btn-submit-modern, .btn-cancel-modern {
        flex: 1;
        text-align: center;
    }
}

.user-list-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    font-family: 'YekanBakh', sans-serif;
    box-sizing: border-box;
}

.user-list-shell {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* TOPBAR */
.list-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
}

    .list-topbar h1 {
        margin: 0;
        font-size: 26px;
        font-weight: 900;
        color: #ffffff;
    }

    .list-topbar p {
        margin: 6px 0 0;
        font-size: 14px;
        color: rgba(255, 255, 255, 0.8);
    }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-add-user {
    height: 46px;
    padding: 0 24px;
    background: #10b981;
    color: #ffffff;
    border-radius: 14px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}

    .btn-add-user:hover {
        background: #059669;
        transform: translateY(-2px);
    }

.btn-back-keypad {
    height: 46px;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 14px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

    .btn-back-keypad:hover {
        background: rgba(255, 255, 255, 0.2);
    }

/* MAIN CARD */
.list-card {
    background: #f8fafc;
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* DESKTOP TABLE */
.table-responsive {
    width: 100%;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: right;
}

    .modern-table th {
        background: #f1f5f9;
        color: #475569;
        font-size: 14px;
        font-weight: 800;
        padding: 16px 20px;
        border-bottom: 2px solid #e2e8f0;
    }

        .modern-table th:first-child {
            border-radius: 0 14px 14px 0;
        }

        .modern-table th:last-child {
            border-radius: 14px 0 0 14px;
        }

    .modern-table td {
        padding: 18px 20px;
        color: #1e293b;
        font-size: 14.5px;
        font-weight: 600;
        border-bottom: 1px solid #f1f5f9;
        vertical-align: middle;
    }

    .modern-table tbody tr {
        transition: background 0.15s ease;
    }

        .modern-table tbody tr:hover {
            background: #f1f5f9;
        }

        .modern-table tbody tr:last-child td {
            border-bottom: none;
        }

/* BADGES */
.role-badge, .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
}

    .role-badge.admin {
        background: #f5f3ff;
        color: #6d28d9;
        border: 1px solid #ddd6fe;
    }

    .role-badge.operator {
        background: #f0f9ff;
        color: #0369a1;
        border: 1px solid #bae6fd;
    }

    .status-badge.active {
        background: #ecfdf5;
        color: #047857;
        border: 1px solid #a7f3d0;
    }

    .status-badge.inactive {
        background: #fef2f2;
        color: #b91c1c;
        border: 1px solid #fca5a5;
    }

/* ---------------------------------------------------------------- */
/* MAGIC BREAKPOINT FOR MOBILE OPTIMIZATION (تبدیل به کارت در موبایل) */
/* ---------------------------------------------------------------- */
@media (max-width: 768px) {
    .user-list-page {
        padding: 20px 12px;
    }

    .list-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        text-align: center;
        width: 100%;
    }

        .list-topbar div {
            width: 100%;
        }

    .topbar-actions {
        width: 100%;
        flex-direction: column-reverse; /* دکمه ثبت بالا قرار بگیرد */
        gap: 10px;
    }

    .btn-add-user, .btn-back-keypad {
        width: 100%;
        justify-content: center;
        height: 48px;
    }

    .list-card {
        padding: 16px;
        border-radius: 20px;
        background: transparent; /* حذف پس‌زمینه کارت کلی برای زیباتر شدن کارت‌های تک‌تک */
        box-shadow: none;
    }

    /* مخفی کردن هدرهای سنتی جدول */
    .modern-table thead {
        display: none;
    }

    /* تبدیل سطرها و ستون‌ها به ساختار بلوکی و کارتی */
    .modern-table,
    .modern-table tbody,
    .modern-table tr,
    .modern-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

        /* تبدیل هر ردیف به یک کارت سفید و مجزا */
        .modern-table tbody tr {
            background: #ffffff;
            border-radius: 18px;
            margin-bottom: 16px;
            padding: 8px 16px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            border: 1px solid rgba(0, 0, 0, 0.02);
        }

        /* استایل‌دهی به هر سلول به صورت ردیف‌های داخلی کارت */
        .modern-table td {
            text-align: left; /* مقدار در سمت چپ متمایل شود */
            padding: 12px 0;
            border-bottom: 1px dashed #f1f5f9;
            display: flex;
            justify-content: space-between; /* ایجاد فاصله بین عنوان و مقدار */
            align-items: center;
            font-size: 13.5px;
        }

            .modern-table td:last-child {
                border-bottom: none;
            }

            /* تزریق عنوان ستون‌ها با استفاده از دیتا سورس */
            .modern-table td::before {
                content: attr(data-label);
                font-weight: 800;
                color: #64748b; /* رنگ خاکستری لیبل‌ها */
                padding-right: 0;
                text-align: right;
            }

    .role-badge, .status-badge {
        padding: 4px 10px;
        font-size: 12px;
    }
}
/* CONTAINER & BACKGROUND */
.category-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    font-family: 'YekanBakh', sans-serif;
    box-sizing: border-box;
}

.category-shell {
    width: 100%;
    max-width: 950px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* TOPBAR */
.cat-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
}

    .cat-topbar h1 {
        margin: 0;
        font-size: 26px;
        font-weight: 900;
        color: #ffffff;
    }

    .cat-topbar p {
        margin: 6px 0 0;
        font-size: 14px;
        color: rgba(255, 255, 255, 0.8);
    }

.btn-back-keypad {
    height: 44px;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 14px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

    .btn-back-keypad:hover {
        background: rgba(255, 255, 255, 0.2);
    }

/* PREMIUM ALERTS (اعلان‌های جدید) */
.cat-alert {
    padding: 16px 20px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

    .cat-alert.success {
        background: #ecfdf5;
        color: #047857;
        border: 1px solid #a7f3d0;
    }

    .cat-alert.error {
        background: #fef2f2;
        color: #b91c1c;
        border: 1px solid #fca5a5;
    }

/* CARDS STRUCTURE */
.cat-card {
    background: #f8fafc;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

    .cat-card h2 {
        font-size: 16px;
        font-weight: 800;
        color: #1e293b;
        margin: 0 0 20px 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

/* MODERN INPUTS & BUTTONS */
.cat-input-wrap {
    position: relative;
    flex: 1;
}

.cat-modern-input {
    width: 100%;
    height: 48px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    padding: 0 45px 0 16px;
    border-radius: 14px;
    font-size: 14.5px;
    font-weight: 600;
    color: #1e293b;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

    .cat-modern-input:focus {
        outline: none;
        border-color: #6d28d9;
        box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.1);
    }

.cat-input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #94a3b8;
}

/* ACTION BUTTONS */
.btn-cat-submit {
    height: 48px;
    padding: 0 24px;
    background: #10b981; /* سبز زمردی */
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 16px -4px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}

    .btn-cat-submit:hover {
        background: #059669;
        transform: translateY(-1px);
    }

.btn-cat-edit {
    height: 44px;
    padding: 0 18px;
    background: #3b82f6; /* آبی کاربنی */
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .btn-cat-edit:hover {
        background: #2563eb;
    }

.btn-cat-delete {
    height: 44px;
    padding: 0 18px;
    background: #ef4444; /* قرمز مرجانی */
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .btn-cat-delete:hover {
        background: #dc2626;
    }

/* INLINE FORM GRID (FOR ADD NEW) */
.add-cat-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* MODERN TABLE STYLE */
.cat-table-responsive {
    width: 100%;
}

.cat-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

    .cat-table th {
        background: #f1f5f9;
        color: #475569;
        font-size: 14px;
        font-weight: 800;
        padding: 14px 20px;
        border-bottom: 2px solid #e2e8f0;
    }

        .cat-table th:first-child {
            border-radius: 0 12px 12px 0;
        }

        .cat-table th:last-child {
            border-radius: 12px 0 0 12px;
        }

    .cat-table td {
        padding: 14px 20px;
        border-bottom: 1px solid #f1f5f9;
        vertical-align: middle;
    }

    .cat-table tbody tr:last-child td {
        border-bottom: none;
    }

.inline-edit-form {
    display: flex;
    gap: 10px;
    width: 100%;
}

/* ---------------------------------------------------------------- */
/* MOBILE OPTIMIZATION BREAKPOINT (ریسپانسیو جادویی نسخه موبایل) */
/* ---------------------------------------------------------------- */
@media (max-width: 768px) {
    .category-page {
        padding: 20px 12px;
    }

    .cat-topbar {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .btn-back-keypad {
        width: 100%;
        justify-content: center;
    }

    .add-cat-form {
        flex-direction: column;
        width: 100%;
    }

    .cat-input-wrap, .btn-cat-submit {
        width: 100%;
    }

    .cat-card {
        padding: 20px 14px;
    }

    /* تبدیل ساختار جدول به کارت‌های عمودی تفکیک‌شده */
    .cat-table thead {
        display: none;
    }

    .cat-table, .cat-table tbody, .cat-table tr, .cat-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

        .cat-table tbody tr {
            background: #ffffff;
            border-radius: 16px;
            padding: 16px;
            margin-bottom: 14px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
            border: 1px solid #f1f5f9;
        }

        .cat-table td {
            padding: 8px 0;
            border-bottom: none;
        }

    /* فیلد اول حاوی اینپوت نام و دکمه ویرایش */
    .inline-edit-form {
        flex-direction: column;
        gap: 8px;
    }

    .cat-table td .btn-cat-edit,
    .cat-table td .btn-cat-delete {
        width: 100%;
        justify-content: center;
        height: 44px;
    }
}
/* CONTAINER & BACKGROUND */
.settings-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px; /* کاهش پدینگ کل صفحه */
    font-family: 'YekanBakh', sans-serif;
    box-sizing: border-box;
}

.settings-shell {
    width: 100%;
    max-width: 800px; /* کمی عریض‌تر برای جای‌گیری دو ستونه فیلدها */
    display: flex;
    flex-direction: column;
    gap: 12px; /* کاهش فاصله المان‌های اصلی */
}

/* TOPBAR */
.settings-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 4px;
}

    .settings-topbar h1 {
        margin: 0;
        font-size: 22px; /* کوچک‌تر شدن هدر */
        font-weight: 900;
        color: #ffffff;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .settings-topbar p {
        margin: 4px 0 0;
        font-size: 13px;
        color: rgba(255, 255, 255, 0.8);
    }

.btn-back-keypad {
    height: 38px; /* کاهش ارتفاع دکمه بازگشت */
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

/* PREMIUM ALERT */
.settings-alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

/* MAIN CARD */
.settings-card {
    background: #f8fafc;
    border-radius: 20px;
    padding: 20px; /* فشرده شدن پدینگ داخل کارت */
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25);
}

/* GRID LAYOUT (تبدیل به ساختار دو ستونه برای کاهش ارتفاع) */
.settings-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 16px; /* فاصله‌های بسیار بهینه */
}

.grid-full-width {
    grid-column: span 2; /* سوییچ‌ها یا بخش‌های تمام‌عرض */
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-label {
    font-size: 13px;
    font-weight: 800;
    color: #475569;
    padding-right: 2px;
}

.settings-input-wrap {
    position: relative;
    width: 100%;
}

/* کاتالوگ ارتفاع جدید فیلدها (۴۲ پیکسل به جای ۵۰) */
.settings-modern-input,
.settings-modern-select {
    width: 100%;
    height: 42px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    padding: 0 40px 0 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.settings-modern-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 0 40px 0 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 14px;
}

    .settings-modern-select::-ms-expand {
        display: none;
    }

    .settings-modern-input:focus,
    .settings-modern-select:focus {
        outline: none;
        border-color: #6d28d9;
        box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.1);
    }

.settings-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #94a3b8;
}
/* TOGGLE SWITCH COMPACT */
.settings-switch-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 10px 16px; /* فشرده‌تر شدن سوییچ */
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
}

.settings-switch-label {
    font-size: 13.5px;
    font-weight: 800;
    color: #1e293b;
}

.premium-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

    .premium-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider-switch {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .2s;
    border-radius: 24px;
}

    .slider-switch:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: .2s;
        border-radius: 50%;
    }

.premium-switch input:checked + .slider-switch {
    background-color: #10b981;
}

    .premium-switch input:checked + .slider-switch:before {
        transform: translateX(24px);
    }
/* METADATA PANEL (افقی شدن برای اشغال نکردن ارتفاع) */
.settings-meta-box {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 10px 16px;
    margin: 14px 0;
    border-right: 4px solid #94a3b8;
    display: flex;
    flex-direction: row; /* چیدمان افقی به جای عمودی */
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.meta-item {
    font-size: 12.5px;
    color: #475569;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .meta-item strong {
        color: #1e293b;
        font-weight: 800;
    }
/* ACTION BUTTON */
.btn-settings-save {
    width: 100%;
    height: 44px; /* کاهش ارتفاع دکمه ذخیره */
    background: #10b981;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 12px -3px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}

    .btn-settings-save:hover {
        background: #059669;
    }
/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .settings-form-grid {
        grid-template-columns: 1fr; /* در موبایل برای خوانایی بهتر دوباره تک ستونه می‌شود */
    }

    .grid-full-width {
        grid-column: span 1;
    }

    .settings-meta-box {
        flex-direction: column; /* افقی در موبایل جا نمی‌شود، عمودی و جمع و جور می‌شود */
        align-items: flex-start;
        gap: 6px;
    }

    .settings-topbar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .btn-back-keypad {
        width: 100%;
        justify-content: center;
    }
}

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    backdrop-filter: blur(10px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: .3s ease;
}

    .modal-backdrop.show {
        display: flex;
        opacity: 1;
    }

.modal-content {
    width: 380px;
    max-width: 90%;
    background: white;
    border-radius: 28px;
    padding: 35px 30px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,.18);
    transform: translateY(40px) scale(.92);
    transition: .35s;
}

.modal-backdrop.show .modal-content {
    transform: translateY(0) scale(1);
}

.modal-icon {
    width: 75px;
    height: 75px;
    margin: auto;
    margin-bottom: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f97316;
    background: #fff7ed;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(249,115,22,.4);
    }

    70% {
        box-shadow: 0 0 0 18px rgba(249,115,22,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(249,115,22,0);
    }
}

.modal-content h3 {
    color: #1e293b;
    font-size: 20px;
    font-weight: 800;
}

.modal-content p {
    color: #64748b;
    font-size: 14px;
    line-height: 2;
    margin: 15px 0 25px;
}

.modal-btns {
    display: flex;
    gap: 12px;
}

    .modal-btns button {
        flex: 1;
        height: 48px;
        border: none;
        border-radius: 14px;
        cursor: pointer;
        font-family: inherit;
        font-weight: 700;
        transition: .25s;
    }

.btn-confirm {
    color: white;
    background: linear-gradient(135deg,#16a34a,#22c55e);
}

    .btn-confirm:hover {
        transform: translateY(-3px);
    }

.btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

    .btn-cancel:hover {
        background: #e2e8f0;
    }

/* =========================================================
   PANEL USERS - MODERN UI
   ========================================================= */

.panel-users-page {
    --pu-card: #ffffff;
    --pu-card-2: #fbfcff;
    --pu-soft: #f8fafc;
    --pu-hover: #f8f6ff;
    --pu-border: #e5e7eb;
    --pu-border-strong: #d8dee9;
    --pu-text: #172033;
    --pu-muted: #748096;
    --pu-primary: #6d28d9;
    --pu-primary-strong: #5b21b6;
    --pu-primary-soft: #f2edff;
    --pu-blue: #4f46e5;
    --pu-orange: #f59e0b;
    --pu-green: #10b981;
    --pu-red: #ef4444;
    --pu-menu-shadow: 0 18px 48px rgba(15, 23, 42, .16);
    width: 100%;
    min-height: 100vh;
    padding: 30px 16px 48px;
    color: var(--pu-text);
    box-sizing: border-box;
}

.panel-users-shell {
    width: min(1500px, 100%);
    margin: 0 auto;
}

html[data-theme="dark"] .panel-users-page {
    --pu-card: #0f1524;
    --pu-card-2: #111a2c;
    --pu-soft: #141c2e;
    --pu-hover: #172139;
    --pu-border: #28354f;
    --pu-border-strong: #34435f;
    --pu-text: #f1f5f9;
    --pu-muted: #a5b0c4;
    --pu-primary: #c4b5fd;
    --pu-primary-strong: #ddd6fe;
    --pu-primary-soft: rgba(124, 58, 237, .18);
    --pu-menu-shadow: 0 22px 54px rgba(0, 0, 0, .5);
}

.panel-users-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 16px;
}

.panel-users-title {
    min-width: 0;
}

.panel-users-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 11px;
    margin-bottom: 8px;
    border: 1px solid rgba(109, 40, 217, .14);
    border-radius: 999px;
    background: rgba(109, 40, 217, .09);
    color: var(--pu-primary);
    font-size: 11px;
    font-weight: 900;
}

html[data-theme="dark"] .panel-users-kicker {
    border-color: rgba(167, 139, 250, .22);
    background: rgba(124, 58, 237, .18);
}

.panel-users-title h1 {
    margin: 0;
    color: var(--pu-text);
    font-size: 25px;
    font-weight: 950;
    line-height: 1.45;
}

.panel-users-title p {
    margin: 5px 0 0;
    color: var(--pu-muted);
    font-size: 13px;
    font-weight: 600;
}

.panel-users-header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
}

.panel-users-btn {
    min-width: 112px;
    height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 900;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

    .panel-users-btn:hover {
        transform: translateY(-1px);
    }

.panel-users-btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #6d28d9, #4f46e5);
    box-shadow: 0 10px 24px rgba(91, 33, 182, .24);
}

    .panel-users-btn-primary:hover {
        color: #ffffff;
        background: linear-gradient(135deg, #5b21b6, #4338ca);
        box-shadow: 0 13px 30px rgba(91, 33, 182, .3);
    }

.panel-users-btn-secondary {
    color: var(--pu-text);
    background: var(--pu-card);
    border-color: var(--pu-border);
}

    .panel-users-btn-secondary:hover {
        color: var(--pu-primary);
        border-color: rgba(109, 40, 217, .34);
    }

.panel-users-btn-plus {
    font-family: Arial, sans-serif;
    font-size: 19px;
    font-weight: 500;
    line-height: 1;
}

.panel-users-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.panel-users-stat {
    min-height: 72px;
    padding: 13px 16px;
    border: 1px solid var(--pu-border);
    border-radius: 15px;
    background: var(--pu-card);
    box-shadow: 0 7px 24px rgba(15, 23, 42, .045);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

html[data-theme="dark"] .panel-users-stat {
    box-shadow: 0 12px 28px rgba(0, 0, 0, .2);
}

.panel-users-stat span {
    color: var(--pu-muted);
    font-size: 10.5px;
    font-weight: 800;
}

.panel-users-stat strong {
    color: var(--pu-text);
    font-size: 19px;
    font-weight: 950;
}

.panel-users-alert {
    padding: 11px 14px;
    margin: 0 0 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
}

.panel-users-alert-danger {
    color: #dc2626;
    background: rgba(239, 68, 68, .09);
    border: 1px solid rgba(239, 68, 68, .24);
}

.panel-users-alert-success {
    color: #047857;
    background: rgba(16, 185, 129, .09);
    border: 1px solid rgba(16, 185, 129, .24);
}

html[data-theme="dark"] .panel-users-alert-danger {
    color: #fca5a5;
}

html[data-theme="dark"] .panel-users-alert-success {
    color: #6ee7b7;
}

.panel-users-card {
    position: relative;
    overflow: visible;
    border: 1px solid var(--pu-border);
    border-radius: 18px;
    background: var(--pu-card);
    box-shadow: 0 16px 42px rgba(15, 23, 42, .07);
}

html[data-theme="dark"] .panel-users-card {
    box-shadow: 0 22px 54px rgba(0, 0, 0, .3);
}

.panel-users-table-wrap {
    width: 100%;
    overflow: visible;
    border-radius: inherit;
}

.panel-users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--pu-text);
}

    .panel-users-table thead th {
        padding: 15px 10px;
        background: var(--pu-soft);
        color: var(--pu-primary);
        border-bottom: 1px solid var(--pu-border-strong);
        font-size: 11px;
        font-weight: 950;
        text-align: center;
        vertical-align: middle;
        white-space: nowrap;
    }

        .panel-users-table thead th:first-child {
            border-radius: 0 17px 0 0;
        }

        .panel-users-table thead th:last-child {
            border-radius: 17px 0 0 0;
        }

    .panel-users-table tbody td {
        padding: 14px 10px;
        border-bottom: 1px solid var(--pu-border);
        color: var(--pu-text);
        font-size: 11.5px;
        font-weight: 700;
        text-align: center;
        vertical-align: middle;
    }

    .panel-users-table tbody tr {
        transition: background .16s ease;
    }

        .panel-users-table tbody tr:hover {
            background: var(--pu-hover);
        }

        .panel-users-table tbody tr:last-child td {
            border-bottom: 0;
        }

.panel-user-row-deleted {
    opacity: .56;
}

.panel-users-user-col {
    min-width: 190px;
}

.panel-user-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    text-align: right;
}

.panel-user-avatar {
    width: 39px;
    height: 39px;
    min-width: 39px;
    border: 1px solid rgba(124, 58, 237, .2);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--pu-primary);
    background: linear-gradient(135deg, rgba(124, 58, 237, .16), rgba(37, 99, 235, .14));
    font-size: 14px;
    font-weight: 950;
}

.panel-user-identity-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .panel-user-identity-text strong {
        max-width: 190px;
        overflow: hidden;
        color: var(--pu-text);
        font-size: 12px;
        font-weight: 950;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .panel-user-identity-text span {
        max-width: 190px;
        overflow: hidden;
        color: var(--pu-muted);
        font-family: Arial, sans-serif;
        font-size: 10px;
        font-weight: 700;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.panel-user-mobile {
    display: inline-block;
    color: var(--pu-text);
    font-family: Arial, sans-serif;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .2px;
}

.panel-user-role,
.panel-user-status,
.panel-user-mini-chip,
.panel-user-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.panel-user-role {
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 950;
}

.role-operator {
    color: #0284c7;
    background: rgba(14, 165, 233, .10);
}

.role-admin {
    color: #ea580c;
    background: rgba(249, 115, 22, .11);
}

.role-superadmin {
    color: #7c3aed;
    background: rgba(124, 58, 237, .11);
}

html[data-theme="dark"] .role-operator {
    color: #7dd3fc;
    background: rgba(14, 165, 233, .15);
}

html[data-theme="dark"] .role-admin {
    color: #fdba74;
    background: rgba(249, 115, 22, .16);
}

html[data-theme="dark"] .role-superadmin {
    color: #d8ccff;
    background: rgba(124, 58, 237, .2);
}

.panel-user-status {
    gap: 6px;
    font-size: 10.5px;
    font-weight: 900;
}

.status-dot,
.category-dot {
    width: 7px;
    height: 7px;
    min-width: 7px;
    border-radius: 50%;
}

.status-active {
    color: #047857;
}

    .status-active .status-dot {
        background: var(--pu-green);
        box-shadow: 0 0 0 4px rgba(16, 185, 129, .1);
    }

.status-inactive {
    color: #64748b;
}

    .status-inactive .status-dot {
        background: #94a3b8;
    }

.status-deleted {
    color: #dc2626;
}

    .status-deleted .status-dot {
        background: var(--pu-red);
    }

html[data-theme="dark"] .status-active {
    color: #6ee7b7;
}

html[data-theme="dark"] .status-inactive {
    color: #cbd5e1;
}

html[data-theme="dark"] .status-deleted {
    color: #fca5a5;
}

.panel-user-membership {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

.panel-user-mini-chip {
    padding: 4px 7px;
    border-radius: 7px;
    font-size: 9px;
    font-weight: 900;
}

.chip-direct {
    color: #2563eb;
    background: rgba(59, 130, 246, .09);
}

.chip-invited {
    color: #b45309;
    background: rgba(245, 158, 11, .11);
}

.chip-completed {
    color: #047857;
    background: rgba(16, 185, 129, .09);
}

.chip-pending {
    color: #be123c;
    background: rgba(244, 63, 94, .09);
}

html[data-theme="dark"] .chip-direct {
    color: #93c5fd;
    background: rgba(59, 130, 246, .15);
}

html[data-theme="dark"] .chip-invited {
    color: #fcd34d;
    background: rgba(245, 158, 11, .15);
}

html[data-theme="dark"] .chip-completed {
    color: #6ee7b7;
    background: rgba(16, 185, 129, .15);
}

html[data-theme="dark"] .chip-pending {
    color: #fda4af;
    background: rgba(244, 63, 94, .15);
}

.panel-user-category {
    gap: 6px;
    max-width: 185px;
    padding: 5px 9px;
    overflow: hidden;
    border-radius: 8px;
    color: var(--pu-primary);
    background: var(--pu-primary-soft);
    font-size: 10px;
    font-weight: 900;
    text-overflow: ellipsis;
}

    .panel-user-category .category-dot {
        background: var(--pu-orange);
    }

.panel-user-category-missing {
    color: #b45309;
    font-size: 10px;
    font-weight: 800;
    cursor: help;
}

html[data-theme="dark"] .panel-user-category-missing {
    color: #fbbf24;
}

.panel-user-reset-date {
    color: var(--pu-text);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.panel-user-muted {
    color: var(--pu-muted);
    font-size: 10px;
    font-weight: 700;
}

.panel-users-actions-col {
    width: 108px;
    min-width: 108px;
}

.panel-user-actions-dropdown {
    display: inline-block;
}

.panel-user-actions-trigger {
    min-width: 88px;
    height: 35px;
    padding: 0 11px;
    border: 1px solid rgba(109, 40, 217, .24);
    border-radius: 10px;
    background: var(--pu-primary-soft);
    color: var(--pu-primary);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 950;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

    .panel-user-actions-trigger:hover,
    .panel-user-actions-trigger:focus,
    .panel-user-actions-trigger.show {
        color: #ffffff;
        background: linear-gradient(135deg, #6d28d9, #4f46e5);
        border-color: transparent;
        transform: translateY(-1px);
    }

    .panel-user-actions-trigger::after {
        margin-right: 6px;
        margin-left: 0;
        vertical-align: middle;
    }

.panel-user-actions-menu {
    width: 245px;
    padding: 7px;
    margin-top: 7px !important;
    border: 1px solid var(--pu-border);
    border-radius: 14px;
    background: var(--pu-card);
    box-shadow: var(--pu-menu-shadow);
    color: var(--pu-text);
    direction: rtl;
    z-index: 3000;
}

.panel-user-action-item {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    margin: 1px 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--pu-text);
    font-family: inherit;
    text-align: right;
    white-space: normal;
    transition: background .15s ease, color .15s ease;
}

    .panel-user-action-item:hover,
    .panel-user-action-item:focus {
        color: var(--pu-text);
        background: var(--pu-hover);
    }

.panel-user-action-icon {
    width: 31px;
    height: 31px;
    min-width: 31px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .panel-user-action-icon svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.action-password {
    color: #d97706;
    background: rgba(245, 158, 11, .11);
}

.action-status {
    color: #2563eb;
    background: rgba(59, 130, 246, .10);
}

.action-delete {
    color: #dc2626;
    background: rgba(239, 68, 68, .10);
}

.panel-user-action-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

    .panel-user-action-text strong {
        color: inherit;
        font-size: 10.5px;
        font-weight: 950;
    }

    .panel-user-action-text small {
        color: var(--pu-muted);
        font-size: 9px;
        font-weight: 700;
        line-height: 1.65;
    }

.panel-user-action-danger {
    color: #dc2626;
}

html[data-theme="dark"] .panel-user-action-danger {
    color: #fca5a5;
}

.panel-user-action-divider {
    margin: 5px 3px;
    border-color: var(--pu-border);
    opacity: 1;
}

.panel-user-no-action {
    display: block;
    padding: 11px 9px;
    color: var(--pu-muted);
    font-size: 10px;
    text-align: center;
}

.panel-users-empty {
    padding: 38px 12px;
    color: var(--pu-muted);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

html[data-theme="dark"] .panel-user-actions-menu .dropdown-item,
html[data-theme="dark"] .panel-user-actions-menu button.dropdown-item {
    color: var(--pu-text);
}

    html[data-theme="dark"] .panel-user-actions-menu .dropdown-item:hover,
    html[data-theme="dark"] .panel-user-actions-menu .dropdown-item:focus {
        color: var(--pu-text);
        background: var(--pu-hover);
    }

/* ---------- Confirm modal ---------- */

body.panel-user-modal-open {
    overflow: hidden;
}

.panel-user-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 2147481000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

    .panel-user-confirm-modal.show {
        display: flex;
    }

.panel-user-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 18, .58);
    backdrop-filter: blur(5px);
}

.panel-user-confirm-dialog {
    position: relative;
    z-index: 2;
    width: min(390px, 100%);
    padding: 25px;
    border: 1px solid var(--pu-border, #e5e7eb);
    border-radius: 20px;
    background: var(--pu-card, #ffffff);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .28);
    text-align: center;
    animation: panelUserModalIn .18s ease;
}

.panel-user-confirm-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 13px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    background: rgba(245, 158, 11, .12);
}

    .panel-user-confirm-icon svg {
        width: 25px;
        height: 25px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.panel-user-confirm-dialog h3 {
    margin: 0;
    color: var(--pu-text, #172033);
    font-size: 17px;
    font-weight: 950;
}

.panel-user-confirm-dialog p {
    margin: 10px 0 20px;
    color: var(--pu-muted, #748096);
    font-size: 12px;
    font-weight: 650;
    line-height: 2;
}

.panel-user-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

    .panel-user-confirm-actions button {
        height: 43px;
        border: 0;
        border-radius: 11px;
        font-family: inherit;
        font-size: 12px;
        font-weight: 900;
        cursor: pointer;
    }

.panel-user-confirm-cancel {
    color: var(--pu-text, #172033);
    background: var(--pu-soft, #f8fafc);
    border: 1px solid var(--pu-border, #e5e7eb) !important;
}

.panel-user-confirm-submit {
    color: #ffffff;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 8px 20px rgba(220, 38, 38, .18);
}

@keyframes panelUserModalIn {
    from {
        opacity: 0;
        transform: translateY(7px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- Responsive cards ---------- */

@media (max-width: 1100px) {
    .panel-users-page {
        padding: 22px 12px 40px;
    }

    .panel-users-table,
    .panel-users-table tbody,
    .panel-users-table tr,
    .panel-users-table td {
        display: block;
        width: 100%;
    }

        .panel-users-table thead {
            display: none;
        }

    .panel-users-card {
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .panel-users-table-wrap {
        overflow: visible;
    }

    .panel-users-table tbody {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

        .panel-users-table tbody tr:not(.panel-users-empty-row) {
            position: relative;
            overflow: visible;
            padding: 13px;
            border: 1px solid var(--pu-border);
            border-radius: 17px;
            background: var(--pu-card);
            box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
        }

    html[data-theme="dark"] .panel-users-table tbody tr:not(.panel-users-empty-row) {
        box-shadow: 0 14px 32px rgba(0, 0, 0, .24);
    }

    .panel-users-table tbody tr:not(.panel-users-empty-row):hover {
        background: var(--pu-card);
    }

    .panel-users-table tbody td {
        min-height: 42px;
        padding: 9px 0;
        border: 0;
        border-bottom: 1px dashed var(--pu-border);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        text-align: left;
    }

        .panel-users-table tbody td:last-child {
            padding-bottom: 0;
            border-bottom: 0;
        }

        .panel-users-table tbody td::before {
            content: attr(data-label);
            flex: 0 0 112px;
            color: var(--pu-muted);
            font-size: 9.5px;
            font-weight: 850;
            text-align: right;
        }

        .panel-users-table tbody td:first-child {
            padding-top: 0;
        }

            .panel-users-table tbody td:first-child::before {
                display: none;
            }

    .panel-user-identity {
        width: 100%;
        min-width: 0;
    }

    .panel-user-identity-text strong,
    .panel-user-identity-text span {
        max-width: none;
    }

    .panel-user-membership {
        justify-content: flex-end;
    }

    .panel-users-actions-col {
        width: 100%;
        min-width: 0;
    }

    .panel-user-actions-dropdown,
    .panel-user-actions-trigger {
        width: 100%;
    }

    .panel-user-actions-menu {
        width: min(270px, calc(100vw - 48px));
    }

    .panel-users-empty-row {
        grid-column: 1 / -1;
    }

        .panel-users-empty-row td::before {
            display: none;
        }
}

@media (max-width: 768px) {
    .panel-users-header {
        align-items: stretch;
        flex-direction: column;
        gap: 13px;
    }

    .panel-users-title h1 {
        font-size: 21px;
    }

    .panel-users-title p {
        font-size: 11.5px;
        line-height: 1.9;
    }

    .panel-users-header-actions {
        width: 100%;
    }

    .panel-users-btn {
        flex: 1;
        min-width: 0;
    }

    .panel-users-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .panel-users-stat {
        min-height: 58px;
        padding: 10px 13px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

        .panel-users-stat strong {
            font-size: 17px;
        }

    .panel-users-table tbody {
        grid-template-columns: 1fr;
    }

        .panel-users-table tbody td::before {
            flex-basis: 105px;
        }

    .panel-user-category {
        max-width: 175px;
    }
}

@media (max-width: 420px) {
    .panel-users-page {
        padding-inline: 8px;
    }

    .panel-users-header-actions {
        flex-direction: column-reverse;
    }

    .panel-users-btn {
        width: 100%;
    }

    .panel-users-table tbody tr:not(.panel-users-empty-row) {
        padding: 12px;
        border-radius: 15px;
    }

    .panel-users-table tbody td {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
        text-align: right;
    }

        .panel-users-table tbody td::before {
            flex-basis: auto;
        }

    .panel-user-membership {
        justify-content: flex-start;
    }

    .panel-user-category {
        max-width: 100%;
    }
}
