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

:root {
    --bg: #0b1120;
    --card: #151e32;
    --card-border: rgba(255, 255, 255, 0.08);
    --text: #f8fafc;
    --text-2: #cbd5e1;
    --text-3: #64748b;
    --blue: #3b82f6;
    --green: #22c55e;
    --yellow: #f59e0b;
    --orange: #f97316;
    --red: #ef4444;
    --purple: #8b5cf6;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
    --ease: 0.2s ease;
    --bg-raised: #0f172a;
    --surface: #1e293b;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #0b1120 50%, #7c2d12 100%);
}

.login-card {
    background: var(--card);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.login-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.login-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-3);
    margin-top: 4px;
}

.login-error {
    display: none;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red);
    padding: 12px 16px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: center;
}

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

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(46,109,205,0.3);
}

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

.field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

.req { color: var(--red); }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.input {
    background: rgba(0,0,0,0.2);
    border: 2px solid #334155;
    border-radius: var(--radius-xs);
    padding: 12px 16px;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    transition: var(--ease);
    width: 100%;
}

.input:focus {
    border-color: var(--blue);
    background: rgba(0,0,0,0.4);
    box-shadow: 0 0 0 3px rgba(46,109,205,0.12);
}

.input::placeholder { color: var(--text-3); }

select.input {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23cbd5e1' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--ease);
    white-space: nowrap;
}

.btn-complete {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
}

.btn-complete:hover {
    background: rgba(34, 197, 94, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(39,174,96,0.3);
}

.btn-action-sm {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    background: #334155;
    color: var(--text-2);
    border: 1px solid var(--card-border);
}

.btn-action-sm:hover { background: #475569; }

.btn-danger-sm {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger-sm:hover { background: rgba(239, 68, 68, 0.25); }

.btn-logout {
    padding: 8px 16px;
    background: rgba(255,255,255,0.15);
    color: white;
    border-radius: var(--radius-xs);
    font-size: 13px;
}

.btn-logout:hover { background: rgba(255,255,255,0.25); }

.btn-bottom {
    padding: 10px 20px;
    background: var(--card);
    color: var(--text-2);
    border: 2px solid #334155;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-bottom:hover {
    border-color: var(--blue);
    color: var(--blue);
    box-shadow: 0 4px 16px rgba(46,109,205,0.12);
    transform: translateY(-1px);
}

.btn-cancel {
    background: #334155;
    color: var(--text);
}

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

.btn-create {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white;
}

.btn-create:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(46,109,205,0.3);
}

.btn-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #334155;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ease);
}

.btn-close:hover { background: #475569; }

.btn-bulk {
    padding: 7px 14px;
    background: #1e293b;
    color: var(--text-2);
    border: 1px solid #334155;
    border-radius: 8px;
    font-size: 12px;
}

.btn-bulk:hover { background: #334155; }

.btn-bulk-danger {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-bulk-danger:hover { background: rgba(239, 68, 68, 0.15); }

.navbar {
    background: var(--bg-raised);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.brand-text {
    font-weight: 700;
    font-size: 16px;
    color: white;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
}

.user-avatar { font-size: 20px; }

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 28px 100px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    border-radius: var(--radius);
    padding: 24px 28px;
    color: white;
    position: relative;
    overflow: hidden;
    transition: var(--ease);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card-green {
    background: linear-gradient(135deg, #064e3b, #047857);
    box-shadow: 0 4px 20px rgba(4,120,87,0.3);
}

.stat-card-green:hover { box-shadow: 0 8px 32px rgba(4,120,87,0.4); }

.stat-card-blue {
    background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
    box-shadow: 0 4px 20px rgba(29,78,216,0.3);
}

.stat-card-blue:hover { box-shadow: 0 8px 32px rgba(29,78,216,0.4); }

.stat-card-purple {
    background: linear-gradient(135deg, #4c1d95, #6d28d9);
    box-shadow: 0 4px 20px rgba(109,40,217,0.3);
}

.stat-card-purple:hover { box-shadow: 0 8px 32px rgba(109,40,217,0.4); }

.stat-card-orange {
    background: linear-gradient(135deg, #7c2d12, #c2410c);
    box-shadow: 0 4px 20px rgba(194,65,12,0.3);
}

.stat-card-orange:hover { box-shadow: 0 8px 32px rgba(194,65,12,0.4); }

.stat-label {
    font-size: 14px;
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
}

.stat-hint {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 6px;
}

.stat-sub-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.stat-sub {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stat-sub-val {
    font-size: 28px;
    font-weight: 800;
}

.stat-sub-label {
    font-size: 14px;
    opacity: 0.85;
}

.skel {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius);
    height: 120px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.search-wrap {
    position: relative;
    margin-bottom: 16px;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    stroke: var(--text-3);
}

.search-field {
    background: var(--card) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 15px !important;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    padding-left: 48px !important;
    box-shadow: var(--shadow);
}

.filter-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-pills {
    display: flex;
    gap: 0;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 4px;
    box-shadow: var(--shadow);
}

.pill {
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: transparent;
    color: var(--text-3);
    transition: var(--ease);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pill:hover {
    background: #334155;
    color: var(--text);
}

.pill-active {
    background: #334155 !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.pill-active .pill-dot,
.pill-active .pill-check {
    opacity: 1;
}

.pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-yellow { background: var(--yellow); box-shadow: 0 0 8px rgba(245,158,11,0.5); }
.dot-green { background: var(--green); box-shadow: 0 0 8px rgba(34,197,94,0.5); }
.dot-blue { background: var(--blue); box-shadow: 0 0 8px rgba(59,130,246,0.5); }

.pill-check {
    font-size: 12px;
    color: var(--green);
    font-weight: 800;
    opacity: 0.5;
}

.pill-active .pill-check { color: white; opacity: 1; }

.period-pills {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    margin-bottom: 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-sm);
    animation: slideDown 0.2s ease-out;
    flex-wrap: wrap;
    gap: 10px;
}

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

.bulk-count {
    font-size: 13px;
    font-weight: 700;
    color: #60a5fa;
}

.bulk-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.table-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.data-table thead th {
    text-align: left;
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-3);
    background: var(--bg-raised);
    border-bottom: 1px solid var(--card-border);
    font-style: italic;
}

.data-table tbody tr {
    transition: var(--ease);
    border-bottom: 1px solid var(--card-border);
}

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

.data-table tbody tr:hover {
    background: #1e293b;
}

.data-table tbody td {
    padding: 16px 18px;
    font-size: 14px;
    vertical-align: middle;
}

.td-id {
    font-weight: 700;
    color: var(--text-3);
}

.td-user-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.td-user-wrap:hover .td-username { color: var(--blue); }

.td-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    color: white;
    font-weight: bold;
}

.td-username {
    font-weight: 700;
    transition: var(--ease);
}

.td-monopoly {
    font-size: 12px;
    color: var(--text-3);
}

.status-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.status-waiting {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-in_progress {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-completed {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.payment-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-2);
}

.paid-check {
    color: var(--green);
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--ease);
}

.paid-check:hover { transform: scale(1.2); }

.unpaid-x {
    color: var(--red);
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--ease);
}

.unpaid-x:hover { transform: scale(1.2); }

.notes-field {
    background: rgba(0,0,0,0.2);
    border: 1px solid transparent;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-2);
    width: 100%;
    min-width: 100px;
    resize: none;
    height: 32px;
    outline: none;
    transition: var(--ease);
}

.notes-field:focus {
    border-color: var(--blue);
    background: rgba(0,0,0,0.4);
}

.select-cb {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
    cursor: pointer;
}

.action-cell {
    display: flex;
    gap: 6px;
    align-items: center;
}

.bottom-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.bottom-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.overlay-panel {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    width: 95%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease-out;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.overlay-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.overlay-title {
    font-size: 20px;
    font-weight: 800;
    color: white;
}

.modal-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    width: 95%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease-out;
    overflow: hidden;
}

.modal-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    color: white;
}

.modal-body {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-foot {
    padding: 16px 28px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--card-border);
}

.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    max-width: 100%;
    height: 100%;
    background: var(--card);
    border-left: 1px solid var(--card-border);
    z-index: 110;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
    box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}

.side-panel-closed { transform: translateX(100%); }

.panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 1;
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.panel-body { padding: 20px 24px; }

.cust-card {
    background: var(--bg-raised);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 20px;
}

.cust-name {
    font-size: 22px;
    font-weight: 800;
    color: white;
}

.cust-mono {
    font-size: 14px;
    color: var(--blue);
    margin-top: 2px;
}

.cust-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.cust-stat-box {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xs);
    padding: 12px;
}

.cust-stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-3);
    margin-bottom: 4px;
}

.cust-stat-val {
    font-size: 18px;
    font-weight: 800;
    color: white;
}

.hist-item {
    background: var(--bg-raised);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xs);
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-only { display: none; }

.mob-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(59,130,246,0.4);
    transition: var(--ease);
    z-index: 40;
}

.fab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 32px rgba(59,130,246,0.6);
}

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    color: white;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
    box-shadow: var(--shadow-lg);
}

.toast.show { transform: translateX(0); }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-3);
    font-size: 15px;
    font-weight: 500;
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 8px;
    display: block;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

@media (max-width: 900px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .brand-text { font-size: 14px; }
}

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
    .content { padding: 16px 16px 120px; }
    .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-value { font-size: 28px; }
    .stat-card { padding: 18px 20px; }
    .navbar-inner { padding: 0 16px; }
    .user-info { display: none; }
    .brand-text { font-size: 13px; }
    .filter-row { flex-direction: column; align-items: stretch; }
    .filter-pills { flex-wrap: wrap; }
    .bottom-actions { flex-direction: column; }
    .bottom-right { flex-direction: column; }
    .field-row { grid-template-columns: 1fr; }
    .fab { bottom: 20px; right: 20px; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* --------------------------------------------------
   VAULT & ALTS OVERLAY TWEAKS
   -------------------------------------------------- */
.completed-table-wrap {
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.completed-table-wrap table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.03);
}

.status-cancelled {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* --------------------------------------------------
   ANCHOR BUTTON RESET
   -------------------------------------------------- */
a.btn, a.nav-link {
    text-decoration: none;
}

/* --------------------------------------------------
   BOTTOM ACTIONS
   -------------------------------------------------- */
.bottom-left {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* --------------------------------------------------
   NAV LINKS
   -------------------------------------------------- */
.nav-link {
    background: rgba(255,255,255,0.08);
    border: 1px solid transparent;
    color: var(--text-2);
    text-decoration: none;
    border-radius: var(--radius-xs);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    display: inline-flex;
    align-items: center;
    transition: var(--ease);
    cursor: pointer;
}

.nav-link:hover {
    background: rgba(255,255,255,0.14);
    color: white;
}

.nav-link-active {
    background: rgba(59,130,246,0.18);
    color: var(--blue);
    border-color: rgba(59,130,246,0.3);
}

.nav-link-active:hover {
    background: rgba(59,130,246,0.28);
    color: var(--blue);
}

/* --------------------------------------------------
   PAGE HEADER
   -------------------------------------------------- */
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    color: white;
    margin: 0;
}

.page-stat {
    font-size: 16px;
    font-weight: 700;
    color: var(--blue);
    margin: 0;
}

.page-stat-green {
    color: var(--green);
}

/* --------------------------------------------------
   SORT BAR
   -------------------------------------------------- */
.sort-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.sort-bar-label {
    color: var(--text-3);
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.sort-bar .input {
    max-width: 250px;
}

/* --------------------------------------------------
   FORM SECTION
   -------------------------------------------------- */
.form-section {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.form-section-title {
    margin: 0 0 16px 0;
    color: white;
    font-size: 15px;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.form-grid-sm {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.btn-full {
    width: 100%;
    margin-top: 16px;
}

/* --------------------------------------------------
   PRIORITY SECTION
   -------------------------------------------------- */
.priority-section {
    margin-bottom: 24px;
}

/* --------------------------------------------------
   SECTION HEADER (orders / priority queue)
   -------------------------------------------------- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    padding: 0 4px;
}

.section-title {
    font-size: 16px;
    font-weight: 800;
    color: white;
}

/* --------------------------------------------------
   MOBILE BOTTOM NAV (secondary pages)
   -------------------------------------------------- */
.mobile-page-nav {
    display: none;
}

/* --------------------------------------------------
   MOBILE OVERRIDES
   -------------------------------------------------- */
@media (max-width: 768px) {
    .mobile-page-nav {
        display: flex;
        gap: 10px;
        margin-top: 24px;
        flex-wrap: wrap;
    }

    .nav-link {
        font-size: 12px;
        padding: 6px 10px;
    }

    .sort-bar .input {
        max-width: 100%;
        flex: 1;
    }

    .page-title {
        font-size: 20px;
    }

    .page-stat {
        font-size: 14px;
    }

    .bottom-left {
        flex-direction: column;
        align-items: stretch;
    }

    .bottom-left .btn {
        text-align: center;
        justify-content: center;
    }
}

/* ================================================
   SIDEBAR LAYOUT SYSTEM
   ================================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-raised);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.sidebar-brand-icon { font-size: 24px; }

.sidebar-brand-text {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}

.sidebar-nav {
    flex: 1;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-3);
    text-decoration: none;
    transition: var(--ease);
    white-space: nowrap;
    font-family: var(--font);
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-2);
}

.sidebar-link.sidebar-link-active {
    background: rgba(59,130,246,0.15);
    color: var(--blue);
}

.sidebar-link.sidebar-link-active:hover {
    background: rgba(59,130,246,0.22);
    color: var(--blue);
}

.sidebar-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.8;
}

.sidebar-link.sidebar-link-active .sidebar-icon { opacity: 1; }

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--card-border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bot-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--card-border);
}

.bot-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-3);
    flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s;
}

.bot-dot.online  { background: var(--green); box-shadow: 0 0 8px rgba(34,197,94,0.6); }
.bot-dot.offline { background: var(--red);   box-shadow: 0 0 8px rgba(239,68,68,0.5); }

.bot-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-3);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: var(--ease);
    width: 100%;
    text-align: left;
}

.sidebar-logout:hover {
    background: rgba(239,68,68,0.12);
    color: #fca5a5;
}

.main-content {
    flex: 1;
    margin-left: 220px;
    min-width: 0;
}

/* Hamburger button (mobile only) */
.hamburger {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 60;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    background: var(--card);
    border: 1px solid var(--card-border);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    box-shadow: var(--shadow);
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-2);
    border-radius: 2px;
    transition: var(--ease);
}

/* Sidebar mobile backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 49;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.sidebar-backdrop.show { display: block; }

/* ================================================
   VIEW TOGGLE (Table / Board)
   ================================================ */

.view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.view-toggle {
    display: flex;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
    transition: var(--ease);
    font-family: var(--font);
}

.view-btn:hover { color: var(--text); }

.view-btn.view-btn-active {
    background: var(--surface);
    color: white;
}

/* ================================================
   KANBAN BOARD
   ================================================ */

.kanban-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.kanban-col {
    background: var(--bg-raised);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.kanban-col-header {
    padding: 12px 16px;
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-2);
}

.kanban-col-count {
    margin-left: auto;
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.kanban-col-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 80px;
    max-height: 65vh;
    overflow-y: auto;
}

.kanban-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 14px;
    transition: var(--ease);
}

.kanban-card:hover {
    border-color: rgba(59,130,246,0.3);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.kanban-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.kanban-card-user {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text);
    cursor: pointer;
}

.kanban-card-user:hover { color: var(--blue); }

.kanban-card-id {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
}

.kanban-card-ign {
    font-size: 11.5px;
    color: var(--text-3);
    margin-bottom: 8px;
}

.kanban-card-meta {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.kanban-tag {
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255,255,255,0.07);
    color: var(--text-2);
}

.kanban-tag-green { background: rgba(34,197,94,0.15);  color: #86efac; }
.kanban-tag-blue  { background: rgba(59,130,246,0.15); color: #93c5fd; }

.kanban-time {
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 10px;
}

.kanban-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.kanban-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-3);
    font-size: 13px;
}

/* ================================================
   PILL COUNT BADGES
   ================================================ */

.pill-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(255,255,255,0.1);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.pill-active .pill-badge { background: rgba(255,255,255,0.25); }

/* ================================================
   RETURNING CUSTOMER BADGE + TIME AGO
   ================================================ */

.badge-regular {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(245,158,11,0.15);
    color: #fcd34d;
    border: 1px solid rgba(245,158,11,0.28);
    margin-left: 6px;
    vertical-align: middle;
}

.order-age {
    font-size: 11px;
    color: var(--text-3);
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

/* ================================================
   DICE BAR VISUALISATION
   ================================================ */

.dice-bar-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 90px;
}

.dice-bar-val {
    font-size: 13px;
    font-weight: 700;
}

.dice-bar-track {
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}

.dice-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--blue), var(--purple));
    transition: width 0.5s ease;
}

/* ================================================
   ANALYTICS PAGE
   ================================================ */

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-top: 0;
}

.chart-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.chart-card-header { margin-bottom: 20px; }

.chart-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}

.chart-sub {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 3px;
}

.chart-wrap { position: relative; height: 280px; }
.chart-wrap-sm { height: 260px; }

/* ================================================
   CUSTOMER DIRECTORY
   ================================================ */

.cust-spend { font-weight: 700; color: var(--green); }

.sortable-th {
    cursor: pointer;
    user-select: none;
}

.sortable-th:hover { color: var(--text-2); }

/* ================================================
   BOT LOG PAGE
   ================================================ */

.botlog-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.botlog-entry {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--card-border);
    border-radius: var(--radius-xs);
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.botlog-entry-info    { border-left-color: var(--blue); }
.botlog-entry-success { border-left-color: var(--green); }
.botlog-entry-warn    { border-left-color: var(--yellow); }
.botlog-entry-error   { border-left-color: var(--red); }

.botlog-time {
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
    font-weight: 500;
}

.botlog-msg {
    font-size: 13.5px;
    color: var(--text-2);
    line-height: 1.5;
    flex: 1;
}

.refresh-hint {
    font-size: 12px;
    color: var(--text-3);
    font-weight: 500;
}

/* ================================================
   PRICING PAGE
   ================================================ */

.pricing-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--card-border);
    flex-wrap: wrap;
}

.pricing-row:last-child { border-bottom: none; }

.pricing-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    min-width: 140px;
    flex-shrink: 0;
}

.pricing-desc {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

.pricing-inputs {
    display: flex;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.pricing-inputs .input { max-width: 140px; }
.pricing-inputs .input.wide { max-width: none; flex: 1; min-width: 180px; }

/* Toggle switch */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
}

.toggle-switch {
    position: relative;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #334155;
    border-radius: 11px;
    cursor: pointer;
    transition: var(--ease);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--ease);
}

.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ================================================
   MOBILE SIDEBAR OVERRIDES
   ================================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
        z-index: 55;
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger {
        display: flex;
    }

    .main-content .content {
        padding-top: 68px;
    }

    .view-toggle {
        display: none;
    }

    .kanban-board {
        grid-template-columns: 1fr;
    }

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

    .pricing-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
