/* ==========================================================================
   Shop Trung Dashboard - Modern Pure CSS Design System
   100% Pure CSS - High-End Dark Aesthetic - Fully Mobile-First & Responsive
   ========================================================================== */

:root {
    color-scheme: dark;
    --bg-main: #0a0e17;
    --bg-subtle: #0f172a;
    --card-bg: rgba(17, 24, 39, 0.78);
    --card-bg-hover: rgba(26, 36, 58, 0.88);
    --card-solid: #111827;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --border-active: #6366f1;

    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --primary-glow: rgba(99, 102, 241, 0.35);

    --emerald: #10b981;
    --emerald-glow: rgba(16, 185, 129, 0.25);
    --emerald-bg: rgba(16, 185, 129, 0.12);
    --emerald-border: rgba(16, 185, 129, 0.3);

    --amber: #f59e0b;
    --amber-glow: rgba(245, 158, 11, 0.25);
    --amber-bg: rgba(245, 158, 11, 0.12);
    --amber-border: rgba(245, 158, 11, 0.3);

    --rose: #f43f5e;
    --rose-glow: rgba(244, 63, 94, 0.25);
    --rose-bg: rgba(244, 63, 94, 0.12);
    --rose-border: rgba(244, 63, 94, 0.3);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px var(--primary-glow);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.14) 0%, transparent 45%),
        radial-gradient(circle at 85% 60%, rgba(16, 185, 129, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 100%, rgba(244, 63, 94, 0.06) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Background Ambient Glow */
.ambient-glow {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(1000px, 100vw);
    height: 380px;
    background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

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

button, input, select {
    font: inherit;
}

/* ==========================================================================
   Top Navigation Bar
   ========================================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(10, 14, 23, 0.85);
    border-bottom: 1px solid var(--border);
    min-height: 68px;
    display: flex;
    align-items: center;
    padding: 8px clamp(12px, 3.5vw, 40px);
}

.topbar-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: -0.04em;
    box-shadow: 0 4px 14px var(--primary-glow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.brand-meta strong {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    white-space: nowrap;
}

.brand-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    white-space: nowrap;
}

.btn-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-pill.btn-admin {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.18) 0%, rgba(124, 58, 237, 0.18) 100%);
    border-color: rgba(99, 102, 241, 0.4);
    color: #c7d2fe;
}

.btn-pill.btn-admin:hover {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.35) 0%, rgba(124, 58, 237, 0.35) 100%);
    border-color: var(--primary-light);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    flex-shrink: 0;
}

.avatar.admin {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
}

.user-info-text {
    line-height: 1.2;
}

.user-name {
    font-weight: 600;
    font-size: 0.84rem;
    color: #fff;
    display: block;
    white-space: nowrap;
}

.role-tag {
    font-size: 0.68rem;
    color: #818cf8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-logout:hover {
    background: var(--rose-bg);
    border-color: var(--rose-border);
    color: var(--rose);
}

/* ==========================================================================
   Dashboard Shell & Layout
   ========================================================================== */
.dashboard-shell {
    position: relative;
    z-index: 10;
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px clamp(12px, 3.5vw, 40px) 60px;
}

/* Welcome Banner */
.welcome-banner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #818cf8;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.page-title {
    font-size: clamp(1.4rem, 3.8vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1.2;
}

.page-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Bento Stats Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.bento-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s ease, border-color 0.25s ease;
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--card-accent, var(--primary));
    opacity: 0.9;
}

.bento-card.card-pending { --card-accent: var(--amber); }
.bento-card.card-completed { --card-accent: var(--emerald); }
.bento-card.card-total { --card-accent: var(--primary); }
.bento-card.card-rate { --card-accent: #06b6d4; }

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

.bento-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.bento-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--card-accent, var(--primary-light));
    flex-shrink: 0;
}

.bento-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1;
}

.bento-footer {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.progress-bar-wrap {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    margin-top: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4, #10b981);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

/* ==========================================================================
   Submit Order Panel
   ========================================================================== */
.card-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    overflow: hidden;
}

.submit-section {
    padding: 20px 22px;
}

.section-head {
    margin-bottom: 14px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.submit-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.input-with-icon {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.modern-input {
    width: 100%;
    height: 48px;
    background: rgba(10, 14, 23, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 16px 0 44px;
    color: #fff;
    font-size: 16px; /* 16px prevents iOS automatic viewport zoom */
    transition: all 0.2s ease;
    outline: none;
}

.modern-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(10, 14, 23, 0.9);
}

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

.btn-primary {
    height: 48px;
    padding: 0 22px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px var(--primary-glow);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Alert Notification Boxes */
.alert-box {
    margin-bottom: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.alert-box.alert-success {
    background: var(--emerald-bg);
    border: 1px solid var(--emerald-border);
    color: #6ee7b7;
}

.alert-box.alert-error {
    background: var(--rose-bg);
    border: 1px solid var(--rose-border);
    color: #fca5a5;
}

/* ==========================================================================
   Filter Toolbar (Admin Only)
   ========================================================================== */
.filter-toolbar {
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filter-group-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 260px;
}

.filter-search-box {
    position: relative;
    width: clamp(180px, 22vw, 280px);
}

.search-input {
    width: 100%;
    height: 40px;
    background: rgba(10, 14, 23, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 14px 0 36px;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

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

.select-filter {
    height: 40px;
    background: rgba(10, 14, 23, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 32px 0 12px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.select-filter:focus {
    border-color: var(--primary-light);
}

.status-pills {
    display: flex;
    align-items: center;
    background: rgba(10, 14, 23, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}

.pill-option {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.pill-option:hover {
    color: #fff;
}

.pill-option.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

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

.btn-reset-filter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-reset-filter:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* ==========================================================================
   Orders Table Header Panel
   ========================================================================== */
.table-header-panel {
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--border);
}

.table-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-stat-badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    white-space: nowrap;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-danger {
    height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    background: var(--rose-bg);
    border: 1px solid var(--rose-border);
    color: var(--rose);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-danger:hover {
    background: var(--rose);
    color: #fff;
    box-shadow: 0 4px 14px var(--rose-glow);
}

/* Desktop Data Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

.orders-table th {
    padding: 12px 22px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(10, 14, 23, 0.4);
    border-bottom: 1px solid var(--border);
}

.orders-table td {
    padding: 15px 22px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-secondary);
    vertical-align: middle;
}

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

.orders-table tbody tr:hover {
    background: var(--card-bg-hover);
}

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

/* Account cell with copy button */
.account-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-name {
    font-weight: 700;
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: var(--border-hover);
}

.btn-copy.copied {
    background: var(--emerald-bg);
    border-color: var(--emerald-border);
    color: var(--emerald);
}

/* Sender cell */
.sender-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sender-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sender-name {
    font-weight: 600;
    color: var(--text-primary);
}

.sender-sub {
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.status-badge.status-done {
    background: var(--emerald-bg);
    border: 1px solid var(--emerald-border);
    color: var(--emerald);
}

.status-badge.status-pending {
    background: var(--amber-bg);
    border: 1px solid var(--amber-border);
    color: var(--amber);
}

.status-badge.status-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.status-badge.status-warning {
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.35);
    color: #fb923c;
}

.status-badge.status-locked {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #c084fc;
}

.status-badge.status-spammed {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.status-badge.status-pending .status-dot {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==========================================================================
   Adaptive Mobile Orders Card List (Shown on screens <= 640px)
   ========================================================================== */
.mobile-orders-list {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
}

.mobile-order-card {
    background: rgba(10, 14, 23, 0.55);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
}

.mobile-order-card:active {
    background: rgba(255, 255, 255, 0.04);
}

.mobile-order-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mobile-order-account {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    word-break: break-all;
}

.btn-copy-touch {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.btn-copy-touch:hover, .btn-copy-touch:active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.btn-copy-touch.copied {
    background: var(--emerald-bg);
    border-color: var(--emerald-border);
    color: var(--emerald);
}

.mobile-order-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 8px;
}

.mobile-order-sender {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.mobile-order-time {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.mobile-req-badge {
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    font-family: ui-monospace, monospace;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: var(--text-muted);
}

.empty-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

/* ==========================================================================
   Modals (Password Management, Logs, Confirm Close Book)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: var(--card-solid);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 580px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85);
    transform: scale(0.96);
    transition: transform 0.25s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.modal-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-icon.danger {
    background: var(--rose-bg);
    border-color: var(--rose-border);
    color: var(--rose);
}

.modal-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.modal-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.btn-close-modal {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* User item in password management */
.user-manage-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-manage-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: all 0.2s ease;
}

.user-manage-card:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.05);
}

.user-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.user-details {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-role-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    white-space: nowrap;
}

.user-role-badge.admin {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.btn-toggle-pwd-form {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-toggle-pwd-form:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pwd-change-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: none;
}

.pwd-change-form.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.pwd-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pwd-input-wrap {
    position: relative;
    flex: 1;
}

.pwd-input-wrap input {
    width: 100%;
    height: 40px;
    background: rgba(10, 14, 23, 0.8);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 36px 0 12px;
    color: #fff;
    font-size: 15px;
    outline: none;
}

.pwd-input-wrap input:focus {
    border-color: var(--primary-light);
}

.btn-toggle-visibility {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
}

.btn-save-pwd {
    height: 40px;
    padding: 0 16px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.btn-save-pwd:hover {
    background: var(--primary-dark);
}

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.btn-secondary {
    height: 38px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ==========================================================================
   Terminal Log Console
   ========================================================================== */
.terminal-window {
    background: #060913;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.terminal-topbar {
    background: #0d1322;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.terminal-dots {
    display: flex;
    gap: 5px;
}

.terminal-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}
.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #10b981; }

.terminal-path {
    font-family: ui-monospace, monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.terminal-console {
    padding: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    color: #38bdf8;
    background: #060913;
    max-height: 380px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.55;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: #fff;
    font-size: 0.86rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    max-width: 360px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast.toast-success {
    border-left: 4px solid var(--emerald);
}

.toast.toast-error {
    border-left: 4px solid var(--rose);
}

/* ==========================================================================
   Login Page Styling
   ========================================================================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px 16px;
    position: relative;
    overflow: hidden;
}

.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-xl);
    padding: clamp(24px, 6vw, 40px);
    box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.8), 0 0 50px -10px var(--primary-glow);
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 26px;
}

.login-brand .brand-logo {
    width: 54px;
    height: 54px;
    font-size: 1.35rem;
    margin-bottom: 14px;
    border-radius: var(--radius-lg);
}

.login-brand h1 {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}

.login-brand p {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

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

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

.form-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.login-hint-box {
    margin-top: 20px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.login-hint-box code {
    color: #818cf8;
    font-weight: 700;
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

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

/* ==========================================================================
   Comprehensive Responsive Breakpoints (Mobile, Tablet, Desktop)
   ========================================================================== */

/* Tablets & Small Laptops (max-width: 960px) */
@media (max-width: 960px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Phablets & Large Phones (max-width: 768px) */
@media (max-width: 768px) {
    .filter-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .filter-group-left {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        min-width: 0;
    }

    .filter-search-box {
        width: 100%;
    }

    .select-filter {
        width: 100%;
    }

    .status-pills {
        width: 100%;
        display: flex;
    }

    .pill-option {
        flex: 1;
        justify-content: center;
    }

    .filter-group-right {
        width: 100%;
        justify-content: flex-end;
    }

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

/* Smartphones (max-width: 640px) - Full Mobile Optimized Mode */
@media (max-width: 640px) {
    .topbar {
        padding: 8px 12px;
        min-height: 60px;
    }

    .topbar-container {
        gap: 8px;
    }

    .brand-meta span {
        display: none; /* Hide pulse dot text on phone to save space */
    }

    .user-nav {
        gap: 6px;
    }

    .btn-pill {
        padding: 6px 10px;
        font-size: 0.76rem;
    }

    .user-info-text {
        display: none; /* Hide name text in topbar on phone, show avatar only */
    }

    .user-badge {
        padding: 2px;
    }

    .dashboard-shell {
        padding: 16px 10px 48px;
    }

    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 16px;
    }

    /* 2x2 compact grid for mobile */
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 18px;
    }

    .bento-card {
        padding: 12px 14px;
        border-radius: var(--radius-md);
    }

    .bento-title {
        font-size: 0.74rem;
    }

    .bento-icon {
        width: 26px;
        height: 26px;
    }

    .bento-icon svg {
        width: 16px;
        height: 16px;
    }

    .bento-value {
        font-size: 1.4rem;
    }

    .bento-footer {
        display: none; /* Keep stats compact on phone */
    }

    /* Form on phone */
    .submit-section {
        padding: 16px 14px;
    }

    .modern-input {
        height: 46px;
    }

    .btn-primary {
        width: 100%;
        height: 46px;
    }

    /* Hide wide table on phone, show Mobile Order Cards */
    .table-responsive {
        display: none;
    }

    .mobile-orders-list {
        display: flex;
    }

    .table-header-panel {
        padding: 14px 16px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    /* Modals on phone */
    .modal-overlay {
        padding: 10px;
    }

    .modal-container {
        max-height: calc(100vh - 20px);
        border-radius: var(--radius-lg);
    }

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

    .modal-body {
        padding: 14px 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

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

    .btn-save-pwd {
        width: 100%;
    }

    .terminal-console {
        max-height: 50vh;
        font-size: 0.74rem;
        padding: 10px;
    }

    /* Toast on phone */
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 14px;
    }

    .toast {
        min-width: 0;
        max-width: 100%;
        padding: 10px 14px;
        font-size: 0.82rem;
    }
}

/* Extra small phones (<= 380px e.g. iPhone SE) */
@media (max-width: 380px) {
    .btn-pill span {
        display: none; /* Show icon only for ultra small screens */
    }

    .brand-logo {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .brand-meta strong {
        font-size: 0.9rem;
    }
}

/* Mobile: keep navigation and filters inside the viewport. */
@media (max-width: 768px) {
    .topbar-container {
        flex-wrap: wrap;
        gap: 10px;
        min-width: 0;
    }

    .brand-section {
        flex: 1 1 100%;
        min-width: 0;
        gap: 10px;
    }

    .brand-meta {
        min-width: 0;
    }

    .brand-meta strong {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .user-nav {
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
    }

    .user-nav .btn-pill {
        flex: 1 1 0;
        min-width: 0;
        min-height: 40px;
        justify-content: center;
        padding: 7px 8px;
        font-size: 12px;
        white-space: normal;
    }

    .user-nav .btn-pill span {
        display: inline;
    }

    .user-nav .btn-pill svg {
        flex-shrink: 0;
    }

    .user-info-text {
        display: none;
    }

    .user-badge {
        flex-shrink: 0;
        padding: 2px;
    }

    .btn-logout {
        width: 40px;
        height: 40px;
    }

    .filter-toolbar,
    .filter-group-left,
    .filter-search-box,
    .select-filter,
    .card-panel,
    .submit-form,
    .input-with-icon {
        min-width: 0;
        max-width: 100%;
    }

    .status-pills {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        min-width: 0;
    }

    .pill-option {
        min-width: 0;
        min-height: 40px;
        padding: 7px 6px;
        white-space: normal;
        text-align: center;
    }

    .filter-group-right,
    .table-header-panel,
    .table-title-wrap {
        flex-wrap: wrap;
        min-width: 0;
    }

    .modern-input,
    .search-input,
    .select-filter {
        font-size: 16px;
    }
}

@media (max-width: 640px) {
    .topbar {
        padding: 10px 12px;
    }

    .bento-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bento-card,
    .bento-header,
    .mobile-order-top,
    .mobile-order-account,
    .mobile-order-sender,
    .modal-title-group {
        min-width: 0;
    }

    .bento-title,
    .page-title,
    .section-title,
    .mobile-order-sender,
    .mobile-req-badge {
        overflow-wrap: anywhere;
    }

    .bento-icon {
        flex-shrink: 0;
    }

    .filter-toolbar {
        padding: 12px;
    }

    .table-header-panel {
        padding: 14px 12px;
        gap: 10px;
    }

    .modal-overlay {
        height: 100dvh;
    }

    .modal-container {
        max-height: calc(100dvh - 20px);
    }

    .modal-header {
        gap: 8px;
    }

    .modal-footer {
        flex-wrap: wrap;
        gap: 8px;
    }
}
