/* VOA Hearing Management - Modern Dashboard CSS */
:root {
    --primary: #1565C0;
    --primary-light: #42A5F5;
    --success: #2E7D32;
    --success-light: #66BB6A;
    --warning: #E65100;
    --warning-light: #FF9800;
    --danger: #D32F2F;
    --purple: #6A1B9A;
    --bg: #F0F2F5;
    --card-bg: #FFFFFF;
    --text: #1a1a2e;
    --text-light: #666;
    --border: #E0E0E0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', -apple-system, sans-serif; background: var(--bg); color: var(--text); }

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary), #0D47A1);
    color: white; padding: 0 24px; display: flex; align-items: center;
    height: 60px; box-shadow: 0 2px 10px rgba(0,0,0,0.15); position: sticky; top: 0; z-index: 100;
}
.navbar h1 { font-size: 20px; font-weight: 600; }
.navbar h1 span { font-size: 12px; opacity: 0.8; margin-left: 8px; }
.nav-links { display: flex; gap: 4px; margin-left: 40px; }
.nav-links a {
    color: rgba(255,255,255,0.85); text-decoration: none; padding: 8px 16px;
    border-radius: 8px; font-size: 14px; font-weight: 500; transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,0.2); color: white; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-right select { padding: 6px 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15); color: white; font-size: 13px; }
.nav-right select option { color: #333; background: white; }
.user-badge { background: rgba(255,255,255,0.2); padding: 4px 12px; border-radius: 20px; font-size: 13px; }

/* Layout */
.container { max-width: 1400px; margin: 0 auto; padding: 24px; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 20px; color: var(--text); }
.page-title small { font-size: 13px; color: var(--text-light); font-weight: 400; }

/* Cards */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 20px; margin-bottom: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 16px; font-weight: 600; }

/* KPI Cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
    border-left: 4px solid var(--primary); text-align: center; transition: transform 0.2s; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.kpi-card.success { border-left-color: var(--success); }
.kpi-card.warning { border-left-color: var(--warning); }
.kpi-card.danger { border-left-color: var(--danger); }
.kpi-card.purple { border-left-color: var(--purple); }
.kpi-label { font-size: 12px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-value { font-size: 32px; font-weight: 700; margin: 8px 0; }
.kpi-sub { font-size: 13px; color: var(--text-light); }

/* Tables */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { background: #1a1a2e; color: white; padding: 12px 16px; text-align: left;
    font-weight: 600; font-size: 13px; position: sticky; top: 0; }
tbody td { padding: 10px 16px; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: #F5F7FA; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #E3F2FD; }

/* Status badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-completed { background: #E8F5E9; color: var(--success); }
.badge-pending { background: #FFF3E0; color: var(--warning); }
.badge-draft { background: #E3F2FD; color: var(--primary); }
.badge-alert { background: #FFEBEE; color: var(--danger); }

/* Score stars */
.stars { color: #FFC107; font-size: 16px; letter-spacing: 2px; }
.stars-dim { color: #DDD; }

/* Progress bar */
.progress-bar { height: 8px; background: #E0E0E0; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.progress-fill.green { background: var(--success); }
.progress-fill.orange { background: var(--warning-light); }
.progress-fill.red { background: var(--danger); }

/* Filters */
.filter-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filter-bar select, .filter-bar input {
    padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; background: white; min-width: 150px;
}
.filter-bar input[type="text"] { min-width: 250px; }

/* Buttons */
.btn { padding: 8px 20px; border-radius: 8px; border: none; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #0D47A1; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #1B5E20; }
.btn-outline { background: white; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background: var(--danger); color: white; }

/* Tabs */
.tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.tab-btn { padding: 10px 24px; border: none; background: transparent; font-size: 14px;
    font-weight: 600; color: var(--text-light); cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: all 0.2s; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 200; justify-content: center; align-items: flex-start; padding-top: 60px; }
.modal-overlay.show { display: flex; }
.modal { background: white; border-radius: var(--radius); width: 90%; max-width: 900px;
    max-height: 85vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex;
    justify-content: space-between; align-items: center; position: sticky; top: 0; background: white; z-index: 10; }
.modal-header h2 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-light); padding: 4px 8px; }
.modal-body { padding: 24px; }

/* Detail view */
.detail-section { margin-bottom: 20px; }
.detail-section h4 { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 10px;
    padding: 8px 12px; background: #E3F2FD; border-radius: 6px; }
.detail-item { padding: 10px 12px; border-bottom: 1px solid #F0F0F0; }
.detail-item .question { font-size: 13px; color: var(--text-light); margin-bottom: 4px; }
.detail-item .answer { font-size: 15px; font-weight: 500; }
.detail-item .answer.free-text { font-style: italic; color: #555; background: #FAFAFA; padding: 8px; border-radius: 6px; }

/* Comments section */
.comment-list { max-height: 200px; overflow-y: auto; }
.comment { padding: 10px; margin-bottom: 8px; background: #F8F9FA; border-radius: 8px; border-left: 3px solid var(--primary); }
.comment .meta { font-size: 11px; color: var(--text-light); margin-bottom: 4px; }
.comment .text { font-size: 14px; }
.comment-form { display: flex; gap: 8px; margin-top: 12px; }
.comment-form textarea { flex: 1; padding: 8px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; resize: none; height: 40px; }

/* History table (mini) */
.history-table { width: 100%; font-size: 13px; }
.history-table th { background: #F5F5F5; color: var(--text); padding: 6px 10px; }
.history-table td { padding: 6px 10px; }
.trend-up { color: var(--success); font-weight: 600; }
.trend-down { color: var(--danger); font-weight: 600; }

/* Charts area */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-card { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.chart-card h3 { font-size: 15px; margin-bottom: 12px; }
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .label { width: 100px; font-size: 13px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar { flex: 1; height: 24px; background: #E0E0E0; border-radius: 4px; overflow: hidden; position: relative; }
.bar-row .bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px;
    font-size: 11px; color: white; font-weight: 600; transition: width 0.8s ease; }
.bar-row .value { width: 40px; font-size: 13px; font-weight: 600; }

/* Upload area */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px;
    text-align: center; cursor: pointer; transition: all 0.2s; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: #E3F2FD; }
.upload-zone .icon { font-size: 48px; margin-bottom: 12px; }
.upload-zone .text { font-size: 16px; color: var(--text-light); }
.upload-zone input { display: none; }

/* Hearing form */
.hearing-form .question-group { margin-bottom: 16px; padding: 12px; background: #FAFAFA; border-radius: 8px; }
.hearing-form .q-label { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.hearing-form .q-category { font-size: 11px; color: var(--primary); font-weight: 600; text-transform: uppercase; }
.hearing-form .q-required { color: var(--danger); font-size: 12px; }
.star-input { display: flex; gap: 4px; }
.star-input span { font-size: 28px; cursor: pointer; color: #DDD; transition: color 0.2s; }
.star-input span:hover, .star-input span.active { color: #FFC107; }
.hearing-form textarea { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.yn-toggle { display: flex; gap: 8px; }
.yn-toggle button { padding: 6px 20px; border-radius: 6px; border: 1px solid var(--border);
    background: white; cursor: pointer; font-weight: 600; transition: all 0.2s; }
.yn-toggle button.selected-yes { background: var(--success); color: white; border-color: var(--success); }
.yn-toggle button.selected-no { background: var(--danger); color: white; border-color: var(--danger); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 16px; }
.pagination button { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px;
    background: white; cursor: pointer; font-size: 13px; }
.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination button:hover:not(.active) { background: #F0F0F0; }

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .chart-grid { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { flex-direction: column; }
    .modal { width: 98%; max-height: 90vh; }
}

/* Animation */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeIn 0.3s ease; }

/* Toast notification */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 24px; border-radius: 8px;
    color: white; font-weight: 600; font-size: 14px; z-index: 300; transform: translateY(100px);
    transition: transform 0.3s ease; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.toast.show { transform: translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

