/* components.css — Premium UI Components */

/* =============================================
   3. CARDS (Bento & Stat)
   ============================================= */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s var(--ease-smooth);
}
.card-premium {
    background: var(--bg-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
}
.card-interactive:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.card.p-0 { padding: 0; }

/* Stat Card Variants */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 4px 12px rgba(15,23,42,0.03);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(15,23,42,0.12);
    border-color: var(--accent-color);
}
.stat-card::after {
    content: '';
    position: absolute;
    right: -10px; bottom: -10px;
    width: 80px; height: 80px;
    background: var(--accent-color);
    opacity: 0.05;
    border-radius: 50%;
    z-index: 0;
}
.stat-card-orange { --accent-color: #ea580c; }
.stat-card-green  { --accent-color: #16a34a; }
.stat-card-blue   { --accent-color: #2563eb; }
.stat-card-purple { --accent-color: #7c3aed; }

.stat-value {
    font-size: var(--text-2xl);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--color-text);
    margin: var(--sp-3) 0 var(--sp-2);
}
.stat-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.stat-meta {
    font-size: var(--text-sm);
    color: var(--color-text-muted); /* Darker than faint */
    margin-top: var(--sp-2);
}
.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}
.stat-trend.up   { color: var(--color-success); background: var(--color-success-light); }
.stat-trend.down { color: var(--color-danger);  background: var(--color-danger-light); }

/* Glassmorphism Card */
.glass-card {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226,232,240,0.7);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-xl);
}

/* =============================================
   1. BUTTONS (Refined Hover States)
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
    border: 1px solid transparent;
    font-family: var(--font-sans);
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn:active {
    transform: translateY(1px) scale(0.98);
}
.btn:focus-visible {
    outline: 3px solid rgba(234,88,12,0.4);
    outline-offset: 2px;
}
.btn:disabled, .btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
.btn svg { flex-shrink: 0; }

/* Sizes */
.btn-sm  { padding: 6px 12px; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-lg  { padding: 13px var(--sp-6); font-size: var(--text-base); border-radius: var(--radius-md); }
.btn-xl  { padding: 15px var(--sp-8); font-size: var(--text-md); border-radius: var(--radius-md); }
.btn-block { width: 100%; }

/* Primary */
.btn-primary {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.2), 0 2px 4px -2px rgba(234, 88, 12, 0.1);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    box-shadow: 0 10px 15px -3px rgba(234, 88, 12, 0.3), 0 4px 6px -4px rgba(234, 88, 12, 0.2);
    transform: translateY(-2px);
}

/* Secondary */
.btn-secondary {
    background: #fff;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--color-border-light);
    color: var(--color-text-main);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--color-primary);
    border-color: rgba(234,88,12,0.25);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
}

/* Success */
.btn-success {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border-color: #16a34a;
    box-shadow: 0 2px 4px rgba(22,163,74,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-success:hover:not(:disabled) {
    background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 4px 12px rgba(22,163,74,0.3);
}

/* Danger */
.btn-danger {
    background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
    color: #fff;
    border-color: #dc2626;
    box-shadow: 0 2px 4px rgba(220,38,38,0.2);
}
.btn-danger:hover:not(:disabled) {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
}

/* Icon Button */
.btn-icon {
    width: 38px; height: 38px;
    padding: 0;
    background: transparent;
    color: var(--color-text-muted);
    border: none;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.2s cubic-bezier(0.1, 0.9, 0.2, 1);
    cursor: pointer;
}
.btn-icon:hover { background: var(--color-bg); color: var(--color-text); transform: scale(1.05); }
.btn-icon:active { transform: scale(0.95); }
.btn-icon-lg { width: 42px; height: 42px; border-radius: 50%; }

/* =============================================
   FORMS & INPUTS
   ============================================= */
.form-group { margin-bottom: var(--sp-4); }
.form-group-lg { margin-bottom: var(--sp-6); }

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}
.form-label-optional::after {
    content: ' (ไม่บังคับ)';
    color: var(--color-text-faint);
    font-weight: 400;
}

.form-input {
    width: 100%;
    padding: 10px 13px;
    font-size: var(--text-base);
    font-family: var(--font-sans);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color var(--duration-base) var(--ease-smooth),
                box-shadow var(--duration-base) var(--ease-smooth);
    appearance: none;
    -webkit-appearance: none;
}
.form-input::placeholder      { color: var(--color-text-faint); }
.form-input:hover:not(:focus) { border-color: #cbd5e1; }
.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(234,88,12,0.12);
}
.form-input:invalid.touched { border-color: var(--color-danger); }
.form-input[type="select"], select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

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

.form-hint { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: 5px; }
.form-error { font-size: var(--text-xs); color: var(--color-danger); margin-top: 5px; }

/* =============================================
   BADGES / TAGS
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.badge-orange  { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.badge-green   { background: #f0fdf4; color: #166534; border-color: #86efac; }
.badge-red     { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.badge-blue    { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }
.badge-yellow  { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.badge-gray    { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.badge-purple  { background: #faf5ff; color: #5b21b6; border-color: #c4b5fd; }

/* =============================================
   NAVIGATION / MENU ITEMS (Sidebar)
   ============================================= */
.menu-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    color: #cbd5e1; /* Much lighter/brighter on dark background */
    border-radius: var(--radius-md);
    margin-bottom: 2px;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--duration-base) var(--ease-smooth);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}
.menu-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.menu-item:hover {
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
    text-decoration: none;
}
.menu-item.active {
    background: rgba(234,88,12,0.15);
    color: #fb923c;
    font-weight: 600;
}
.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--color-primary);
    border-radius: 0 3px 3px 0;
}

.menu-section-label {
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0 11px;
    margin: var(--sp-5) 0 var(--sp-2);
}

/* =============================================
   DATA TABLES
   ============================================= */
.table-container { width: 100%; overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: var(--text-sm);
}
.data-table thead { border-bottom: 1px solid var(--color-border); }
.data-table th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted); /* Darker than faint */
    text-transform: uppercase;
    letter-spacing: 0.07em;
    background: #f1f5f9; /* Slightly darker header bg */
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}
.data-table th:first-child { border-radius: 0; }
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td {
    background: rgba(234,88,12,0.03);
}
.data-table tr.is-urgent td:first-child {
    box-shadow: inset 3px 0 0 #dc2626;
}

/* =============================================
   SKELETON LOADING
   ============================================= */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e8edf5 50%, #f1f5f9 75%);
    background-size: 400% 100%;
    animation: skeletonWave 1.6s ease-in-out infinite;
    border-radius: var(--radius-sm);
    display: block;
}
@keyframes skeletonWave {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text  { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 22px; margin-bottom: 12px; }
.skeleton-stat  { height: 48px; border-radius: var(--radius-md); }
.skeleton-row   { height: 52px; border-radius: 0; margin-bottom: 1px; }
.skeleton-card  { height: 120px; border-radius: var(--radius-lg); }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--sp-12) var(--sp-8);
    gap: var(--sp-3);
}
.empty-state-icon {
    width: 64px; height: 64px;
    border-radius: var(--radius-xl);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: var(--sp-2);
}
.empty-state-icon svg { width: 28px; height: 28px; color: var(--color-text-faint); }
.empty-state-title {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}
.empty-state-desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    max-width: 340px;
    line-height: 1.6;
    margin: 0;
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
    position: fixed;
    bottom: var(--sp-6);
    right: var(--sp-6);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    pointer-events: none;
}
.toast {
    pointer-events: all;
    min-width: 280px;
    max-width: 380px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--sp-3) var(--sp-4);
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
    position: relative;
    overflow: hidden;
    animation: toastIn 0.35s var(--ease-spring) both;
}
.toast.fade-out { animation: toastOut 0.3s var(--ease-smooth) forwards; }
.toast-icon-wrap {
    width: 32px; height: 32px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.toast.success .toast-icon-wrap { background: var(--color-success-light); }
.toast.error   .toast-icon-wrap { background: var(--color-danger-light); }
.toast.info    .toast-icon-wrap { background: var(--color-info-light); }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; font-size: var(--text-sm); }
.toast-msg   { color: var(--color-text-muted); font-size: var(--text-xs); margin-top: 1px; }
.toast-close {
    background: none; border: none; cursor: pointer;
    color: var(--color-text-faint); padding: 2px;
    border-radius: 4px; line-height: 1;
    transition: color var(--duration-fast);
    flex-shrink: 0;
}
.toast-close:hover { color: var(--color-text); }
.toast-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    background: var(--color-primary);
    border-radius: 0 0 0 var(--radius-lg);
    animation: toastProgress linear forwards;
}
.toast.success .toast-progress { background: var(--color-success); }
.toast.error   .toast-progress { background: var(--color-danger); }
.toast.info    { background: var(--color-info); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(110%); }
}
@keyframes toastProgress {
    from { width: 100%; }
    to   { width: 0%; }
}

/* =============================================
   WORKFLOW STEPPER
   ============================================= */
.wf-stepper { display: flex; flex-direction: column; }
.wf-step {
    display: flex;
    gap: var(--sp-4);
    position: relative;
    padding-bottom: var(--sp-5);
}
.wf-step:last-child { padding-bottom: 0; }
.wf-step__track {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 28px;
}
.wf-step__dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    z-index: 1;
    transition: all var(--duration-base) var(--ease-spring);
    font-size: 12px;
    font-weight: 700;
}
.wf-step__line {
    flex: 1;
    width: 2px;
    background: var(--color-border);
    margin: 4px 0;
    min-height: var(--sp-4);
}
.wf-step:last-child .wf-step__line { display: none; }
.wf-step__body { flex: 1; padding-top: 3px; }
.wf-step__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}
.wf-step__desc {
    font-size: var(--text-xs);
    color: var(--color-text-faint);
    line-height: 1.5;
}
.wf-step__comment {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--sp-2) var(--sp-3);
    margin-top: var(--sp-2);
    font-style: italic;
}

/* State: done */
.wf-step.done .wf-step__dot {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
}
.wf-step.done .wf-step__line { background: var(--color-success); }
.wf-step.done .wf-step__title { color: var(--color-text-muted); }

/* State: active */
.wf-step.active .wf-step__dot {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(234,88,12,0.15);
    animation: stepPulse 2s var(--ease-smooth) infinite;
}
.wf-step.active .wf-step__title { color: var(--color-primary); font-weight: 700; }

/* State: rejected */
.wf-step.rejected .wf-step__dot {
    background: var(--color-danger);
    border-color: var(--color-danger);
    color: #fff;
}
.wf-step.rejected .wf-step__title { color: var(--color-danger); }

@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(234,88,12,0.15); }
    50%       { box-shadow: 0 0 0 7px rgba(234,88,12,0.08); }
}

/* =============================================
   ALERT BANNER (Smart UX)
   ============================================= */
.alert-banner {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-5);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--sp-6);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-smooth);
    border: 1px solid transparent;
    text-decoration: none;
}
.alert-banner:hover { text-decoration: none; }
.alert-banner-orange {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fed7aa;
    color: #9a3412;
}
.alert-banner-orange:hover {
    background: linear-gradient(135deg, #ffedd5 0%, #fde8c1 100%);
    border-color: var(--color-primary);
}
.alert-banner-blue {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}
.alert-banner-icon { font-size: 20px; flex-shrink: 0; }
.alert-banner-text { flex: 1; }
.alert-banner-title { font-weight: 700; display: block; }
.alert-banner-cta {
    font-size: var(--text-xs);
    font-weight: 600;
    opacity: 0.7;
    display: block;
}
.alert-banner-arrow { color: inherit; opacity: 0.5; font-size: 18px; }

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
    flex-wrap: wrap;
}
.page-header-left h1 {
    font-size: var(--text-xl);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}
.page-header-left p {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin: 0;
}

/* =============================================
   FILTER BAR
   ============================================= */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
}
.filter-bar .form-input { width: auto; }
.result-count {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-faint);
    white-space: nowrap;
    margin-left: auto;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(2,6,23,0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
}
.modal-overlay.active { display: flex; }
.modal-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.35s var(--ease-spring) both;
}
.modal-header {
    padding: var(--sp-6) var(--sp-6) var(--sp-5);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    position: sticky; top: 0;
    background: var(--color-surface);
    z-index: 1;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-title { font-size: var(--text-md); font-weight: 700; }
.modal-body  { padding: var(--sp-6); }
.modal-footer {
    padding: var(--sp-4) var(--sp-6) var(--sp-6);
    display: flex;
    gap: var(--sp-3);
    justify-content: flex-end;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* =============================================
   ROLE BADGE (navbar)
   ============================================= */
.role-toggle {
    display: flex;
    align-items: center;
    background: var(--color-bg);
    border-radius: var(--radius-full);
    padding: 4px;
    box-shadow: inset 0 1px 3px rgba(15,23,42,0.05);
}
.role-toggle-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.role-toggle-btn:hover:not(.active) { color: var(--color-text); }
.role-toggle-btn.active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 2px 8px rgba(15,23,42,0.08);
}
.role-toggle-btn.active.admin-btn {
    background: linear-gradient(180deg, #ea580c 0%, #c2410c 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(234,88,12,0.35);
}

/* =============================================
   UPLOAD ZONE
   ============================================= */
.upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-8) var(--sp-6);
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-smooth);
    background: var(--color-bg);
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}
.upload-zone-icon {
    width: 44px; height: 44px;
    margin: 0 auto var(--sp-3);
    color: var(--color-text-faint);
}
.upload-zone-title {
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-text);
}
.upload-zone-desc {
    font-size: var(--text-xs);
    color: var(--color-text-faint);
}

/* =============================================
   RESPONSIVE SCALING & MOBILE UX
   ============================================= */
@media (max-width: 640px) {
    /* 1. Page Headers */
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-header-left h1 { font-size: 1.25rem; }

    /* 2. Tables (Force Horizontal Scroll) */
    .table-container { 
        border-radius: 12px; 
        border: 1px solid var(--color-border);
        box-shadow: inset 0 0 10px rgba(0,0,0,0.02);
    }
    .data-table th, .data-table td { padding: 12px 14px; min-width: 120px; }
    .data-table th:nth-child(2), .data-table td:nth-child(2) { min-width: 200px; } /* Title Col */

    /* 3. Cards & Grids */
    .stat-grid { grid-template-columns: 1fr; gap: 12px; }
    .card { border-radius: 12px; }

    /* 4. Drawers & Modals (Adaptive Width) */
    .drawer { width: 100% !important; max-width: none !important; border-left: none; }
    .modal-card { width: 96% !important; margin: 0 auto; }
    .modal-split { grid-template-columns: 1fr !important; }
    #modal-meta { border-left: none !important; border-top: 1px solid var(--color-border); padding-left: 0 !important; padding-top: 16px; margin-top: 16px; }

    /* 5. Touch Friendly Controls */
    .form-input { padding: 12px 14px; font-size: 16px !important; } /* Fix iOS Safari Zoom on Focus */
    .btn { padding-top: 12px; padding-bottom: 12px; }
    .btn-sm { padding: 8px 14px; }
    
    .filter-bar { gap: 8px; }
    .filter-bar .form-input { flex: 1; min-width: 140px; }
}

@media (max-width: 480px) {
    .drawer-header { padding: 16px; }
    .drawer-body { padding: 16px; }
    .drawer-footer { flex-direction: column-reverse; padding: 16px; }
    .drawer-footer .btn { width: 100%; }
}
