/* LJU IT Helpdesk — clean, elegan, responsif */
:root {
    --primary: #0b5cad;
    --primary-dark: #084a8a;
    --accent: #00a99d;
    --bg: #f4f6fa;
    --card: #ffffff;
    --text: #1a2332;
    --muted: #6b7686;
    --border: #e3e8f0;
    --success: #1a9e6b;
    --warning: #d97706;
    --danger: #dc2626;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content { flex: 1; padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; }
.footer { padding: 16px 24px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; border-top: 1px solid var(--border); background: var(--card); }

/* Sidebar */
.sidebar { width: 240px; background: #0d1b2e; color: #dbe4f0; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.sidebar-brand-name { font-weight: 700; color: #fff; font-size: 15px; }
.sidebar-brand-sub { font-size: 11px; color: #8fa3bd; }
.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: #c3d0e2; font-size: 13px; }
.sidebar-link:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.sidebar-link.active { background: var(--primary); color: #fff; }
.sidebar-icon { width: 18px; text-align: center; }
.sidebar-footer { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-user-role { font-size: 11px; color: #8fa3bd; }

/* Topbar */
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-title { font-size: 17px; font-weight: 700; flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-user-info { text-align: right; }
.topbar-user-name { font-size: 13px; font-weight: 600; }
.topbar-user-meta { font-size: 11px; color: var(--muted); }
.sidebar-toggle { display: none; }

/* Avatar */
.avatar { border-radius: 50%; object-fit: cover; }
.avatar-initial { display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-weight: 700; border-radius: 50%; flex-shrink: 0; }

/* Cards & stats */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 30px; font-weight: 800; margin-top: 4px; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Buttons & forms */
.btn { display: inline-block; padding: 8px 16px; border-radius: 8px; border: 1px solid transparent; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { background: none; border: none; font-size: 20px; cursor: pointer; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.form-control { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,92,173,.12); }
textarea.form-control { min-height: 110px; resize: vertical; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #e6f7ef; border: 1px solid #a7e8c8; color: #0c6b42; }
.alert-error { background: #fdecec; border: 1px solid #f5b5b5; color: #8f1d1d; }
.alert-info { background: #e8f1fc; border: 1px solid #b8d4f5; color: #0b4a8a; }

/* Table */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th { text-align: left; padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
table.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.table tr:hover td { background: #f8fafc; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-open { background: #e8f1fc; color: #0b5cad; }
.badge-assigned { background: #ede9fe; color: #6d28d9; }
.badge-progress { background: #fef3c7; color: #92400e; }
.badge-waiting { background: #ffedd5; color: #9a3412; }
.badge-resolved { background: #d1fae5; color: #065f46; }
.badge-closed { background: #e5e7eb; color: #374151; }
.badge-low { background: #e5e7eb; color: #374151; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-high { background: #ffedd5; color: #9a3412; }
.badge-critical { background: #fee2e2; color: #991b1b; }

/* Misc */
.text-muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 8px; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Auth / demo login */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #0d1b2e 0%, #0b5cad 100%); }
.auth-card { background: #fff; border-radius: 16px; padding: 32px; width: 100%; max-width: 440px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.auth-logo { text-align: center; margin-bottom: 20px; }
.auth-logo img { width: 64px; height: 64px; object-fit: contain; }
.auth-title { text-align: center; font-size: 20px; font-weight: 800; margin: 0 0 4px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.user-pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; width: 100%; text-align: left; background: #fff; cursor: pointer; }
.user-pick:hover { border-color: var(--primary); background: #f0f6fd; }
.user-pick-name { font-weight: 600; font-size: 13px; }
.user-pick-meta { font-size: 11px; color: var(--muted); }

/* Responsive */
@media (max-width: 860px) {
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .content { padding: 16px; }
    .topbar-user-info { display: none; }
}

/* ============ Batch 2: Employee Portal ============ */
/* Form tambahan */
textarea.form-control { font-family: inherit; }
input[type="file"].form-control { padding: 7px 10px; background: #fff; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%236b7686' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-group .text-muted { line-height: 1.4; }

/* Detail tiket */
table.table th { font-weight: 700; }
table.table tbody th { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--muted); background: transparent; font-weight: 600; }
table.table tbody tr:hover td { background: transparent; }
.card h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* Percakapan tiket */
.comment-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-item.is-internal { background: #fffdf5; border-left: 3px solid var(--warning); padding-left: 12px; border-radius: 6px; }
.comment-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.comment-body { white-space: pre-wrap; margin: 6px 0 0; }

/* Timeline riwayat */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.timeline-action { font-weight: 600; font-size: 13px; }
.timeline-meta { font-size: 11px; color: var(--muted); }

/* Lampiran */
.attachment-list { list-style: none; padding: 0; margin: 0; }
.attachment-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; font-size: 13px; }
.attachment-list li:hover { border-color: var(--primary); background: #f8fbff; }
.attachment-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Rating */
.rating-stars { color: #f59e0b; font-size: 18px; letter-spacing: 2px; }
.rating-picker { display: flex; gap: 6px; }
.rating-picker label { cursor: pointer; font-size: 26px; color: #d7dde7; transition: color .15s; }
.rating-picker input { position: absolute; opacity: 0; width: 0; height: 0; }
.rating-picker input:checked ~ label,
.rating-picker label:hover,
.rating-picker label:hover ~ label { color: #f59e0b; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: #fff; }
.faq-item:hover { border-color: var(--primary); background: #f8fbff; text-decoration: none; }
.faq-item-title { font-weight: 600; font-size: 14px; }
.faq-item-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.faq-content { white-space: pre-wrap; line-height: 1.7; }
.faq-content p { margin: 0 0 12px; }

/* Search bar */
.search-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-row .form-control { width: auto; }

@media (max-width: 640px) {
    .flex-between { align-items: flex-start; }
    .attachment-list li { flex-direction: column; align-items: flex-start; }
    .search-row .form-control { width: 100%; max-width: none !important; }
}

/* ============ Batch 3: Ticket Management ============ */
a.stat-card { display: block; color: inherit; }
a.stat-card:hover { text-decoration: none; border-color: var(--primary); box-shadow: 0 4px 12px rgba(11,92,173,.12); }
.stat-link .stat-label { color: var(--muted); }

.bulk-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 12px; background: #f8fafc; border: 1px dashed var(--border); border-radius: 10px; margin-bottom: 14px; }
.bulk-bar .form-control { padding: 6px 10px; font-size: 12px; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* Panel aksi IT di detail tiket */
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.action-box { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fbfcfe; }
.action-box h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.action-box .form-control { padding: 7px 10px; font-size: 13px; }
.action-box .btn { width: 100%; margin-top: 8px; }
.action-box.danger { background: #fff8f8; border-color: #f3d3d3; }

.sla-meter { height: 6px; border-radius: 999px; background: #e8edf5; overflow: hidden; margin-top: 8px; }
.sla-meter span { display: block; height: 100%; background: var(--success); }
.sla-meter.warning span { background: var(--warning); }
.sla-meter.overdue span { background: var(--danger); }

/* ============ Notification Center ============ */
.notif-link { position: relative; }
.notif-badge { position: absolute; top: -2px; right: -2px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 5px; line-height: 1.4; }
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-bottom: 1px solid var(--border); border-radius: 8px; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: #f5f9ff; }
.notif-icon { width: 34px; height: 34px; border-radius: 50%; background: #eaf2fb; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: 13px; }
.notif-message { font-size: 13px; color: #334155; margin-top: 2px; }
.notif-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.notif-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }

@media (max-width: 640px) {
    .notif-item { flex-wrap: wrap; }
    .notif-actions { width: 100%; justify-content: flex-end; }
}

/* ============ Batch 4: Network & Internet Complaint ============ */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 1fr; gap: 6px; color: var(--text); padding: 4px 0; }
.bar-row:hover { text-decoration: none; }
.bar-row:hover .bar-fill { filter: brightness(1.08); }
.bar-label { font-size: 13px; font-weight: 600; }
.bar-track { display: block; height: 8px; background: #eef2f8; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #4b9bea); border-radius: 999px; }
.bar-fill.alt { background: linear-gradient(90deg, var(--accent), #57d6c9); }
.bar-value { font-size: 12px; color: var(--muted); }

.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.room-card { display: block; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); }
.room-card:hover { border-color: var(--primary); background: #f8fbff; text-decoration: none; }
.room-name { font-weight: 700; font-size: 13px; }
.room-meta { font-size: 11px; color: var(--muted); margin-top: 2px; min-height: 15px; }
.room-count { font-size: 12px; margin-top: 8px; color: var(--primary); font-weight: 600; }

/* Hasil pemeriksaan teknisi */
.check-list { list-style: none; padding: 0; margin: 0; }
.check-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; background: #fbfcfe; }
.check-type { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.check-result { font-weight: 600; font-size: 13px; }
.check-notes { font-size: 12px; color: var(--muted); white-space: pre-wrap; }

.network-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; background: linear-gradient(135deg, #eaf3fd, #f2fbfa); border: 1px solid #cfe3f7; margin-bottom: 18px; }
.network-banner .nb-icon { font-size: 22px; line-height: 1; }

/* ============ Batch 6: Reporting & Analytics ============ */
/* Grafik batang sederhana (CSS-only, tanpa library) */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding: 8px 0 0; overflow-x: auto; }
.chart-col { flex: 1 0 18px; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 26px; background: var(--primary); border-radius: 4px 4px 0 0; position: relative; overflow: hidden; display: flex; align-items: flex-end; }
.chart-bar-done { display: block; width: 100%; background: var(--success); }
.chart-label { font-size: 9px; color: var(--muted); margin-top: 4px; white-space: nowrap; writing-mode: horizontal-tb; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 6px 0 12px; }

/* Kartu KPI laporan */
.report-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }

/* Preview PDF di browser */
.pdf-preview-bar { position: sticky; top: 0; background: #0d1b2e; color: #fff; padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 20; }
.pdf-preview-bar a { color: #fff; }

/* ============ Batch 7: MikroTik Monitoring ============ */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 16px; border-bottom: 1px solid var(--border); }
.tab { padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; }
.tab:hover { background: #f4f7fc; color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); background: #f0f6fd; }

.chart-lg { height: 220px; }
.chart-pair { display: flex; align-items: flex-end; gap: 2px; height: 100%; width: 100%; justify-content: center; }
.chart-pair .chart-bar { max-width: 10px; border-radius: 2px 2px 0 0; background: var(--primary); }
.chart-pair .chart-bar.tx { background: var(--accent); }

.queue-row { display: grid; grid-template-columns: 190px 1fr 1fr 190px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.queue-row:last-child { border-bottom: none; }
.queue-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.queue-bars { height: 10px; background: #eef2f8; border-radius: 999px; overflow: hidden; }
.queue-bar { display: block; height: 100%; border-radius: 999px; }
.queue-bar.rx { background: linear-gradient(90deg, var(--primary), #4b9bea); }
.queue-bar.tx { background: linear-gradient(90deg, var(--accent), #57d6c9); }
.queue-value { text-align: right; white-space: nowrap; }

@media (max-width: 720px) {
    .queue-row { grid-template-columns: 1fr; gap: 4px; }
    .queue-value { text-align: left; }
}
