:root {
    --bg-base: #000000;
    --bg-surface: #111111;
    --bg-surface-hover: #1a1a1a;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --border-color: #222222;

    --brand-primary: #ed145b;
    --brand-secondary: #ff2a75;
    --brand-success: #10b981;
    --brand-warning: #f59e0b;
    --brand-danger: #ef4444;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(237, 20, 91, 0.2);
}

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    overflow: hidden; /* Avoid double scrolling */
}

/* Background animation */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(circle at 20% 20%, rgba(237, 20, 91, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(255, 42, 117, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(26, 26, 26, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(18, 18, 22, 0.6);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    margin-bottom: 40px;
}

.logo span {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.logo-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
    flex: 1;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.nav-btn.active {
    background: rgba(237, 20, 91, 0.1);
    color: var(--brand-primary);
    position: relative;
}

.nav-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--brand-primary);
    border-radius: 0 4px 4px 0;
}

.nav-btn i {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 0 24px;
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-footer #datetime {
    margin-top: 4px;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.main-content::-webkit-scrollbar {
    width: 6px;
}
.main-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
    max-width: 1200px;
    margin: 0 auto;
}

.view-section.active {
    display: block;
}

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

.section-header {
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 15px;
}

/* Glass Panels */
.glass-panel {
    background: rgba(18, 18, 22, 0.4);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

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

.panel-header h3 {
    font-size: 16px;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.stat-card {
    background: rgba(18, 18, 22, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(237, 20, 91, 0.3);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    width: 24px;
    height: 24px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th, .data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

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

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge.received { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge.processing { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.badge.done { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge.error { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn i { width: 18px; height: 18px; }

.btn-primary {
    background: var(--brand-primary);
    color: white;
}
.btn-primary:hover {
    background: #d80b4c;
    box-shadow: 0 0 15px rgba(237, 20, 91, 0.4);
}
.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}
.btn-sm:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

/* Upload Area */
.upload-container {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    transition: all 0.3s;
    background: rgba(10, 10, 15, 0.3);
}

.upload-container:hover, .upload-container.drag-active {
    border-color: var(--brand-primary);
    background: rgba(237, 20, 91, 0.05);
}

.upload-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(237, 20, 91, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--brand-primary);
}
.upload-icon { width: 32px; height: 32px; }

.upload-container h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}
.upload-hint { color: var(--text-muted); font-size: 14px; margin-bottom: 12px; }
.upload-limits { font-size: 12px; color: #71717a; }

.file-preview {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: left;
    border: 1px solid var(--border-color);
}
.preview-info {
    display: flex;
    align-items: center;
    gap: 16px;
}
.file-type-icon {
    width: 32px;
    height: 32px;
    color: var(--brand-secondary);
}
.file-details { flex: 1; display: flex; flex-direction: column; }
.file-name { font-weight: 500; font-size: 15px; }
.file-size { font-size: 13px; color: var(--text-muted); }

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}
.service-card {
    background: rgba(18, 18, 22, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    position: relative;
}
.service-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
    background: var(--accent-color); opacity: 0.5;
}
.service-card:hover { transform: translateY(-2px); border-color: var(--accent-color); }
.service-card:hover::before { opacity: 1; }
.service-card .icon {
    width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; background: var(--accent-color); color: white;
}
.service-card .info { flex: 1; }
.service-card .name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.service-card .desc { font-size: 13px; color: var(--text-muted); }

/* Modals */
.modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }
.modal-backdrop {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex; flex-direction: column;
    position: relative; z-index: 101;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 { font-size: 20px; font-weight: 600; }
.modal-body {
    padding: 24px;
    overflow-y: auto;
}

/* Toast */
.toast-container {
    position: fixed; bottom: 24px; right: 24px;
    display: flex; flex-direction: column; gap: 12px; z-index: 1000;
}
.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 16px 24px; border-radius: var(--radius-md);
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
    animation: toastIn 0.3s ease;
}
.toast.success { border-left: 4px solid var(--brand-success); }
.toast.error { border-left: 4px solid var(--brand-danger); }
.toast.info { border-left: 4px solid var(--brand-primary); }

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

/* Report Items */
.report-section { margin-bottom: 24px; }
.report-section h3 { margin-bottom: 12px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: rgba(255,255,255,0.05); padding: 6px 12px; border-radius: 6px; font-size: 13px; border: 1px solid rgba(255,255,255,0.1); }
.alert-card {
    background: rgba(239, 68, 68, 0.05); border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 16px; border-radius: var(--radius-md); margin-bottom: 8px; font-size: 14px;
}
.alert-card.recommend {
    background: rgba(16, 185, 129, 0.05); border-color: rgba(16, 185, 129, 0.2);
}
.feedback-box { background: rgba(0,0,0,0.2); padding: 20px; border-radius: var(--radius-md); border: 1px solid var(--border-color); margin-top: 32px; }
.rating-stars { display: flex; gap: 8px; margin: 12px 0; color: #4b5563;font-size: 24px; cursor: pointer; }
.rating-stars i:hover, .rating-stars i.selected { color: #eab308; }
textarea { width: 100%; background: #000; border: 1px solid var(--border-color); color: #fff; padding: 12px; border-radius: var(--radius-md); margin-bottom: 12px; resize: vertical; min-height: 80px; font-family: inherit;}

/* Utility Classes */
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Custom Hover Tooltip */
.service-card[data-desc]::after {
    content: attr(data-desc);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(10, 10, 12, 0.95);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.4;
    white-space: normal;
    width: 200px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.service-card[data-desc]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* Login Styles */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-group input {
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-surface-hover);
    color: var(--text-main);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-glow);
}

.login-btn {
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: none;
    background: var(--brand-primary);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-btn:hover {
    background: var(--brand-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--brand-danger);
    color: var(--brand-danger);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    text-align: center;
}
