/* ============================================
   UIAHelpbot Admin Panel — Main Stylesheet
   Professional institutional admin theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* === CSS Variables === */
:root {
    --bg-primary: #f4f6f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-glass: #f8fafc;
    --bg-glass-hover: #eef2f7;
    --border-glass: #d8dee8;
    --border-glass-active: #b8c2d2;

    --text-primary: #111827;
    --text-secondary: #475467;
    --text-muted: #667085;

    --accent-gold: #a87716;
    --accent-gold-light: #c79025;
    --accent-gold-dim: rgba(168, 119, 22, 0.12);
    --accent-blue: #1f4f8f;
    --accent-blue-dim: rgba(31, 79, 143, 0.1);
    --accent-green: #087443;
    --accent-green-dim: rgba(8, 116, 67, 0.1);
    --accent-red: #b42318;
    --accent-red-dim: rgba(180, 35, 24, 0.1);
    --accent-purple: #6941c6;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 8px;
    --radius-xl: 8px;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 8px 18px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 16px 36px rgba(16, 24, 40, 0.12);
    --shadow-glow: none;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;

    --sidebar-width: 260px;
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    display: none;
}

a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-gold-light);
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* === Login Page === */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: fadeInUp 0.6s ease;
}

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

.login-card .logo-icon {
    width: 82px;
    height: 82px;
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    padding: 5px;
    box-shadow: none;
}

.login-card .logo-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.login-card .subtitle {
    color: var(--text-muted);
    font-size: 0.87rem;
}

/* === Forms === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px var(--accent-gold-dim);
}

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

textarea.form-input {
    resize: vertical;
    min-height: 200px;
    font-family: 'Inter', monospace;
    line-height: 1.7;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--accent-blue);
    color: #ffffff;
    box-shadow: none;
}

.btn-primary:hover:not(:disabled) {
    background: #183f73;
    box-shadow: var(--shadow-sm);
}

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

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-glass-hover);
    border-color: var(--border-glass-active);
}

.btn-danger {
    background: var(--accent-red-dim);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

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

.btn-success {
    background: var(--accent-green-dim);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.btn-success:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.25);
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* === Layout === */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-glass);
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 1rem;
}

.sidebar-logo .logo-mark {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border: 1px solid var(--border-glass);
    color: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    flex-shrink: 0;
    box-shadow: none;
    overflow: hidden;
}

.sidebar-logo .logo-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.sidebar-logo .logo-text {
    display: flex;
    flex-direction: column;
}

.sidebar-logo .logo-text strong {
    font-size: 0.95rem;
    line-height: 1.2;
}

.sidebar-logo .logo-text span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 0 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 0.2rem;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
}

[data-admin-only] {
    display: none !important;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-glass);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.sidebar-footer .user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-blue-dim);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--accent-blue);
}

.sidebar-footer .user-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.sidebar-footer .user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* === Main Content === */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

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

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-glass);
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-header .card-actions {
    display: flex;
    gap: 0.5rem;
}

/* === Stat Cards Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--border-glass-active);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-icon.gold { background: var(--accent-gold-dim); }
.stat-icon.blue { background: var(--accent-blue-dim); }
.stat-icon.green { background: var(--accent-green-dim); }
.stat-icon.purple { background: rgba(168, 85, 247, 0.15); }

.stat-info .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-info .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* === File List === */
.file-list {
    list-style: none;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-glass);
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: var(--bg-glass-hover);
}

.file-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.file-icon.docx { background: var(--accent-blue-dim); color: var(--accent-blue); }
.file-icon.pdf { background: var(--accent-red-dim); color: var(--accent-red); }
.file-icon.txt { background: var(--accent-green-dim); color: var(--accent-green); }

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    margin-top: 0.15rem;
}

.file-actions {
    display: flex;
    gap: 0.4rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.file-item:hover .file-actions {
    opacity: 1;
}

/* === Upload Zone === */
.upload-zone {
    border: 2px dashed var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-gold);
    background: var(--accent-gold-dim);
}

.upload-zone .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.upload-zone .upload-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.upload-zone .upload-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* === Editor === */
.editor-container {
    position: relative;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.editor-toolbar .char-count {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.editor-textarea {
    width: 100%;
    min-height: 500px;
    padding: 1.25rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    font-size: 0.88rem;
    line-height: 1.8;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast);
}

.editor-textarea:focus {
    border-color: var(--accent-gold);
}

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    font-size: 0.88rem;
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--accent-blue); }
.toast.warning { border-left: 3px solid var(--accent-gold); }

.toast-icon {
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    color: var(--accent-blue);
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
}
.toast-message { flex: 1; }
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    font-size: 1rem;
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.3s ease;
}

.modal h3 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
}

.modal p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* === Status Badge === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 100px;
    font-size: 0.73rem;
    font-weight: 600;
}

.badge.success {
    background: var(--accent-green-dim);
    color: var(--accent-green);
}

.badge.warning {
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
}

.badge.error {
    background: var(--accent-red-dim);
    color: var(--accent-red);
}

.badge.info {
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
}

/* === Spinner === */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-glass);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

/* === Loading Overlay === */
.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    padding: 3rem;
    color: var(--text-secondary);
}

/* === Guide Page === */
.guide-section {
    margin-bottom: 2rem;
}

.guide-section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-example {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin: 0.75rem 0;
    font-size: 0.85rem;
    line-height: 1.7;
}

.guide-example .label {
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 0.5rem;
    display: block;
}

.guide-example .label.bad { color: var(--accent-red); }
.guide-example .label.good { color: var(--accent-green); }

.guide-example pre {
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-secondary);
}

.guide-tip {
    background: var(--accent-gold-dim);
    border: 1px solid rgba(212, 168, 67, 0.2);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    display: flex;
    gap: 0.6rem;
    margin: 0.75rem 0;
}

.guide-tip > span {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(168, 119, 22, 0.14);
    color: var(--accent-gold);
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* === Dashboard Reporting === */
.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-hero h1 {
    font-size: 1.85rem;
    font-weight: 750;
    line-height: 1.2;
    margin-bottom: 0.45rem;
}

.dashboard-hero p,
.card-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.eyebrow {
    color: var(--accent-blue);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.dashboard-actions,
.inline-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.period-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.period-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    min-height: 126px;
}

.period-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.period-card strong {
    display: block;
    color: var(--text-primary);
    font-size: 1.75rem;
    line-height: 1.1;
    margin-bottom: 0.65rem;
}

.period-card small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-grid-main {
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.65fr);
}

.chart-card .card-header,
.cost-card .card-header {
    align-items: flex-start;
}

.chart-canvas {
    width: 100%;
    height: 280px;
    display: block;
}

.segmented-control {
    display: inline-flex;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.2rem;
    gap: 0.15rem;
}

.segment {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 0.45rem 0.7rem;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.segment.active,
.segment:hover {
    background: #ffffff;
    color: var(--accent-blue);
    box-shadow: var(--shadow-sm);
}

.cost-total {
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 800;
    color: var(--accent-blue);
    margin: 0.2rem 0 1.2rem;
}

.metric-list,
.system-status {
    display: grid;
    gap: 0.75rem;
}

.metric-list div,
.system-status div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-glass);
}

.metric-list div:last-child,
.system-status div:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.metric-list span,
.system-status span {
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.metric-list strong,
.system-status strong {
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: right;
}

.cost-note {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.6;
}

.system-status {
    margin-bottom: 1rem;
}

.category-breakdown {
    display: grid;
    gap: 1rem;
}

.category-item {
    display: grid;
    gap: 0.45rem;
}

.category-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.88rem;
}

.category-head span {
    color: var(--text-primary);
    font-weight: 650;
}

.category-head strong {
    color: var(--accent-blue);
}

.progress-bar {
    height: 8px;
    border-radius: 999px;
    background: var(--bg-glass-hover);
    overflow: hidden;
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent-blue);
}

.category-item small {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    font-size: 0.86rem;
}

.data-table th,
.data-table td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--border-glass);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 750;
    background: var(--bg-glass);
}

.question-cell {
    max-width: 420px;
    color: var(--text-secondary);
}

.table-badge {
    display: inline-flex;
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.74rem;
    font-weight: 700;
}

.empty-table {
    padding: 1rem 0;
    color: var(--text-muted);
    text-align: center;
}

.empty-state.compact {
    padding: 1.5rem 1rem;
}

.empty-state.compact h3 {
    font-size: 0.98rem;
}

/* === Regulation Update Workflow === */
.workflow-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.workflow-step {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-height: 150px;
}

.workflow-step .step-number {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-blue);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
}

.workflow-step h3 {
    font-size: 0.98rem;
    margin-bottom: 0.45rem;
}

.workflow-step p {
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.7;
}

.upload-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.46fr);
    gap: 1rem;
    align-items: start;
}

.instruction-panel {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.instruction-panel h3 {
    font-size: 0.98rem;
    margin-bottom: 0.75rem;
}

.instruction-list {
    display: grid;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.65;
    padding-left: 1rem;
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1.25rem;
    }

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

    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .period-grid,
    .dashboard-grid,
    .dashboard-grid-main,
    .workflow-grid,
    .upload-layout {
        grid-template-columns: 1fr;
    }

    .segmented-control {
        width: 100%;
        justify-content: space-between;
    }

    .segment {
        flex: 1;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    .login-card {
        margin: 1rem;
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

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

    .dashboard-actions,
    .inline-actions {
        width: 100%;
    }

    .dashboard-actions .btn,
    .inline-actions .btn {
        width: 100%;
    }
}

/* Mobile menu button (hidden on desktop) */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 101;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.1rem;
}

/* === Preview Panel === */
.preview-panel {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-size: 0.83rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.85rem;
    max-width: 350px;
    margin: 0 auto;
}
