* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --ink: #121826;
    --muted: #64748b;
    --line: #e2e8f0;
    --accent: #059669;
    --accent-soft: #ecfdf5;
    --accent-border: #6ee7b7;
    --blue: #059669;
    --blue-soft: #ecfdf5;
    --green: #16a34a;
    --green-soft: #dcfce7;
    --amber: #d97706;
    --amber-soft: #fef3c7;
    --red: #dc2626;
    --red-soft: #fee2e2;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
}

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

button {
    cursor: pointer;
}

.admin-shell {
    min-height: 100vh;
    height: 100vh;
    display: grid;
    grid-template-columns: 270px 1fr;
    overflow: hidden;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    color: var(--ink);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    overflow: hidden;
}

.admin-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/images/desk_bg_2.png');
    background-size: cover;
    background-position: bottom left;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.admin-sidebar>* {
    position: relative;
    z-index: 1;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
    font-size: 24px;
    font-weight: 800;
}

.brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-nav-btn {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 13px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.side-nav-btn i {
    font-size: 18px;
    opacity: 0.8;
}

.side-nav-btn:hover {
    background: #f3f4f6;
    color: var(--ink);
    transform: translateX(4px);
}

.side-nav-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-left: 3px solid var(--accent);
    border-radius: 0 10px 10px 0;
    padding-left: 10px;
    font-weight: 700;
}

.side-nav-btn.active i {
    opacity: 1;
    color: var(--accent);
}

.sidebar-card {
    margin-top: auto;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 14px;
    padding: 16px;
}

.sidebar-card span {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-card strong {
    display: block;
    margin: 8px 0 6px;
    font-size: 15px;
    color: var(--ink);
}

.sidebar-card p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.admin-main {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: 100vh;
}

.admin-topbar,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.admin-topbar h1 {
    font-size: 30px;
    letter-spacing: -0.5px;
}

.topbar-actions {
    display: flex;
    gap: 10px;
}

.ghost-btn,
.primary-btn,
.small-btn {
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 800;
    transition: all 0.2s ease;
}

.ghost-btn {
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 100px;
    padding: 10px 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ghost-btn:hover {
    border-color: var(--accent-border);
    color: var(--accent);
    box-shadow: 0 10px 24px rgba(5, 150, 105, 0.09);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
    transition: all 0.3s ease;
}

.metric-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.metric-card.active {
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.1);
}

.metric-card.active::before {
    background: var(--accent);
}

.metric-card.pending.active {
    border-color: var(--amber);
    box-shadow: 0 10px 15px -3px rgba(217, 119, 6, 0.1);
}

.metric-card.pending.active::before {
    background: var(--amber);
}

.metric-card.approved.active {
    border-color: var(--green);
    box-shadow: 0 10px 15px -3px rgba(22, 163, 74, 0.1);
}

.metric-card.approved.active::before {
    background: var(--green);
}

.metric-card.revoked.active {
    border-color: var(--red);
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.1);
}

.metric-card.revoked.active::before {
    background: var(--red);
}

.metric-card span,
.metric-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    font-size: 34px;
    margin: 8px 0 2px;
    letter-spacing: -1px;
}

.metric-card.pending strong {
    color: var(--amber);
}

.metric-card.approved strong {
    color: var(--green);
}

.metric-card.revoked strong {
    color: var(--red);
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.records-panel,
.detail-panel,
.manual-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.records-panel {
    min-height: 560px;
    overflow: hidden;
    min-width: 0;
    /* CRITICAL: prevents CSS grid blowout on mobile */
}

.panel-toolbar {
    padding: 16px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 170px;
    gap: 12px;
}

.header-controls {
    padding: 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    padding: 0 16px;
    height: 44px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.date-filter-group:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-soft);
}

.date-filter-group input[type="date"] {
    border: none;
    background: transparent;
    color: var(--ink);
    outline: none;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    padding: 0;
    width: 115px;
    cursor: pointer;
}

.date-filter-group span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 12px;
}

.search-box i {
    color: var(--muted);
}

.search-box input,
.select-control,
.manual-form input,
.manual-form select,
.manual-form textarea,
.note-box textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--ink);
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    font-weight: 500;
}

.search-box input {
    border: 0;
    background: transparent;
    min-height: 44px;
    box-shadow: none;
}

.select-control {
    padding: 0 16px;
    height: 44px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12 13.172l4.95-4.95 1.414 1.414L12 16 5.636 9.636 7.05 8.222z' fill='rgba(100,116,139,1)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.manual-form input,
.manual-form select,
.manual-form textarea,
.note-box textarea {
    padding: 11px 12px;
}

.search-box:focus-within,
.manual-form input:focus,
.manual-form select:focus,
.manual-form textarea:focus,
.note-box textarea:focus,
.select-control:focus {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.table-wrap {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.records-table th,
.records-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.records-table th {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    background: #f8fafc;
    font-weight: 700;
    border-bottom: 2px solid var(--line);
    padding: 16px;
}

.records-table tbody tr {
    transition: background 0.2s ease;
}

.records-table tbody tr:hover td {
    background: #f8fafc;
}

.records-table td {
    font-size: 13.5px;
    font-weight: 500;
}

.record-id {
    display: block;
    font-weight: 800;
}

.record-sub {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.type-chip,
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
}

.status-chip::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.type-chip {
    color: #047857;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.status-chip.pending {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
}

.status-chip.pending::before {
    background: #f59e0b;
    box-shadow: 0 0 4px #f59e0b;
}

.status-chip.approved {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.status-chip.approved::before {
    background: #10b981;
    box-shadow: 0 0 4px #10b981;
}

.status-chip.revoked {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.status-chip.revoked::before {
    background: #ef4444;
    box-shadow: 0 0 4px #ef4444;
}

.small-btn {
    min-height: 34px;
    border-radius: 8px;
    padding: 0 12px;
    color: var(--accent);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.small-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.empty-state {
    display: none;
    text-align: center;
    padding: 70px 24px;
}

.empty-state i {
    color: #cbd5e1;
    font-size: 42px;
}

.empty-state h3 {
    margin: 10px 0 5px;
}

.empty-state p {
    color: var(--muted);
    font-size: 13px;
}

.detail-panel {
    position: sticky;
    top: 18px;
    overflow: hidden;
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

.record-detail {
    min-height: 560px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

.detail-empty {
    height: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
}

.detail-empty i {
    font-size: 56px;
    color: #e2e8f0;
    margin-bottom: 10px;
}

.detail-empty h2 {
    margin: 10px 0 8px;
    color: var(--ink);
    font-size: 20px;
    font-weight: 800;
}

.detail-empty p {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.6;
    max-width: 250px;
}

.detail-head {
    padding: 24px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.detail-head-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.detail-head h2 {
    font-size: 20px;
    color: var(--ink);
    margin-bottom: 6px;
}

.detail-head p {
    color: var(--muted);
    font-size: 12px;
}

.detail-body {
    padding: 18px;
}

.info-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.info-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

.info-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.info-row strong {
    font-size: 13px;
    overflow-wrap: anywhere;
}

.action-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 14px 0;
}

.action-btn {
    border: 0;
    border-radius: 12px;
    min-height: 44px;
    color: white;
    font-weight: 800;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.approve-btn {
    background: linear-gradient(135deg, #10b981, #059669);
}

.pending-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.revoke-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.note-box label {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 7px;
}

.history-list {
    margin-top: 16px;
    display: grid;
    gap: 8px;
}

.history-item {
    border-left: 3px solid #bfdbfe;
    padding-left: 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.history-item strong {
    color: var(--ink);
}

.manual-panel {
    padding: 20px;
}

.section-heading {
    margin-bottom: 16px;
}

.section-heading h2 {
    font-size: 20px;
}

.section-heading span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.manual-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.manual-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.manual-form .wide {
    grid-column: span 2;
}

.phone-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.phone-prefix {
    position: absolute;
    left: 14px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    pointer-events: none;
    z-index: 2;
}
.phone-input-wrapper input[type="tel"] {
    padding-left: 48px !important;
}

.primary-btn {
    min-height: 45px;
    align-self: end;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.2), 0 2px 4px -1px rgba(5, 150, 105, 0.1);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.25), 0 4px 6px -2px rgba(5, 150, 105, 0.15);
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    background: #0f172a;
    color: white;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: all 0.25s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1100px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
    }

    .side-nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .workspace-grid,
    .metric-grid {
        grid-template-columns: 1fr 1fr;
    }

    .detail-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .admin-main {
        padding: 18px;
    }

    .admin-topbar,
    .section-heading,
    .topbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .side-nav,
    .workspace-grid,
    .metric-grid,
    .manual-form,
    .panel-toolbar {
        grid-template-columns: 1fr;
    }

    .manual-form .wide {
        grid-column: auto;
    }
}

/* Login Overlay Styles */
.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
}

.login-card {
    background: var(--panel);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    padding: 35px 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.login-header {
    text-align: center;
    margin-bottom: 25px;
}

.login-header img {
    height: 45px;
    margin-bottom: 12px;
}

.login-header h2 {
    font-size: 24px;
    color: var(--ink);
    margin-bottom: 6px;
}

.login-header p {
    color: var(--muted);
    font-size: 13px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-group label {
    display: block;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

.input-wrap i {
    position: absolute;
    left: 14px;
    color: var(--muted);
    font-size: 18px;
}

.input-wrap input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-soft);
    color: var(--ink);
    font-size: 14px;
    transition: all 0.2s ease;
}

.input-wrap input:focus {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
    outline: none;
}

.login-btn {
    width: 100%;
    margin-top: 10px;
    font-size: 15px;
}

.login-error {
    background: var(--red-soft);
    color: var(--red);
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    border: 1px solid rgba(220, 38, 38, 0.2);
}


/* Manual Entry Tabs */
.form-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.form-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.form-tab-btn:hover {
    background: var(--panel-soft);
    color: var(--ink);
}

.form-tab-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(5, 150, 105, 0.2);
}

/* ══════════════════════════════════════════════════════════════════════════════
   NEW COMPONENTS — RBAC · KPI · Bulk Actions · Pagination
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Role Badge (sidebar) ────────────────────────────────────────────────── */
.role-badge-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 2px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 4px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.4px;
    border: 1px solid transparent;
    white-space: nowrap;
    /* color/background set dynamically from JS */
    background: var(--accent-soft);
    color: var(--accent);
}

.role-user {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Metric Grid — 7 cards, auto-wrap ───────────────────────────────────── */
.metric-grid {
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}

.metric-card span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-card span i {
    font-size: 14px;
    opacity: 0.65;
}

.metric-card.today strong {
    color: var(--accent);
}

.metric-card.overdue strong {
    color: var(--amber);
}

.metric-card.rate strong {
    color: var(--green);
}

/* ── Bulk Actions Bar ────────────────────────────────────────────────────── */
.bulk-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.bulk-count {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--ink);
    margin-right: 8px;
    flex-shrink: 0;
}

.bulk-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bulk-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.bulk-approve {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.bulk-revoke {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.bulk-delete {
    background: #7f1d1d;
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.bulk-clear {
    background: #e5e7eb;
    color: var(--ink);
    margin-left: auto;
}

/* ── Checkbox column ─────────────────────────────────────────────────────── */
.col-check {
    width: 42px;
    padding-left: 14px !important;
    padding-right: 4px !important;
}

.row-check,
#select-all {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--accent);
    flex-shrink: 0;
}

tr.row-selected td {
    background: #ecfdf5;
}

/* ── Pagination Bar ──────────────────────────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    background: #ffffff;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.02);
}

.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent-border);
    color: var(--accent);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.08);
}

.page-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

#page-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    min-width: 160px;
    text-align: center;
}

/* ── Viewer role notice in detail panel ─────────────────────────────────── */
.role-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 14px 0;
}

/* ══════════════════════════════════════════════════════════════════════════════
   DASHBOARD WIDGETS — Customer Growth Chart + Customer Satisfaction
   ══════════════════════════════════════════════════════════════════════════════ */

.dashboard-widgets-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 18px;
}

.widget-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
}

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

.widget-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.3px;
}

.widget-legend {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Growth Chart ────────────────────────────────────────────────────────── */
.widget-chart-area {
    flex: 1;
    min-height: 220px;
    position: relative;
}

.widget-chart-area canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Satisfaction Widget ─────────────────────────────────────────────────── */
.sat-avatar-group {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe, #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sat-avatar-group i {
    font-size: 22px;
    color: #6366f1;
}

.sat-summary {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.sat-summary strong {
    font-size: 32px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -1px;
    line-height: 1.1;
}

.sat-summary span {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    margin-top: 3px;
}

.sat-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sat-row {
    display: grid;
    grid-template-columns: 80px 1fr 44px;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 4px;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid transparent;
}

.sat-row:hover {
    background: #f8fafc;
    border-color: #f1f5f9;
    transform: translateX(4px);
}

.sat-row.active {
    background: var(--active-bg, #f0fdf4);
    border-color: var(--active-border, #bbf7d0);
}

.sat-label {
    font-size: 13px;
    font-weight: 700;
}

.sat-icons {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
}

.sat-pct {
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
    text-align: right;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .dashboard-widgets-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    body {
        height: auto !important;
        overflow: auto !important;
    }

    .dashboard-widgets-grid {
        grid-template-columns: 1fr;
    }

    .widget-chart-area {
        min-height: 180px;
    }

    .admin-shell {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .admin-sidebar {
        height: auto;
        position: relative;
    }

    .admin-main {
        height: auto;
        overflow-y: visible;
    }
}

/* Glassmorphic Toast */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.shopsq-toast {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 340px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    color: #f8fafc;
    font-family: 'Inter', sans-serif;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.shopsq-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.shopsq-toast.removing {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #f8fafc;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    width: 100%;
    animation: toastProgress 3.5s linear forwards;
}

.toast-success .toast-progress {
    background: #10b981;
}

.toast-error .toast-progress {
    background: #ef4444;
}

.toast-info .toast-progress {
    background: #3b82f6;
}

@keyframes toastProgress {
    0% {
        width: 100%;
    }

    100% {
        width: 0%;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   SKELETON LOADER — shimmer animation for table rows while data fetches
   ───────────────────────────────────────────────────────────────────────────── */
@keyframes skeletonShimmer {
    0% {
        background-position: -400px 0;
    }

    100% {
        background-position: 400px 0;
    }
}

.skeleton-box {
    display: inline-block;
    background: linear-gradient(90deg,
            #e2e8f0 25%,
            #f1f5f9 50%,
            #e2e8f0 75%);
    background-size: 800px 100%;
    animation: skeletonShimmer 1.4s ease-in-out infinite;
    border-radius: 6px;
}

.skeleton-row td {
    padding: 12px 14px;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.skeleton-row td>.skeleton-box {
    display: block;
}

/* ── AUTHENTICATION OVERLAY ─────────────────────────────────────────── */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

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

.login-header img {
    height: 48px;
    margin-bottom: 16px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--muted);
    font-size: 14px;
}

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

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}

.input-wrap {
    position: relative;
}

.input-wrap i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 18px;
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.input-wrap input:focus {
    border-color: var(--blue);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--blue-soft);
    outline: none;
}

.login-btn {
    margin-top: 8px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(15, 23, 42, 0.2);
    background: linear-gradient(135deg, #000000 0%, #0f172a 100%);
}

.login-error {
    background: var(--red-soft);
    color: var(--red);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    border-top: 1px solid var(--line);
    padding-top: 20px;
}

.login-footer p {
    color: var(--muted);
    font-size: 12px;
}