/* ============================================================
   MoST Sindh Portal v2 — Page-Specific Styles
   ============================================================ */

/* ---- Page wrapper ---- */
.page { max-width: var(--content-max, 1400px); margin: 0 auto; }

/* ---- Page header ---- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-header h1 { font-size: clamp(1.3rem, 3vw, 1.6rem); font-weight: 700; }
.page-subtitle { color: var(--text-muted); font-size: .88rem; margin-top: 2px; }

/* ---- KPI Grid ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.kpi-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; transition: transform var(--dur-fast), box-shadow var(--dur-fast); }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.kpi-icon { width: 38px; height: 38px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 1.2rem; }
.kpi-value { font-size: 1.8rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.kpi-total .kpi-icon, .kpi-total.kpi-icon { background: rgba(59,130,246,.1); color: #3b82f6; }
.kpi-open .kpi-icon, .kpi-open.kpi-icon { background: rgba(245,158,11,.1); color: #f59e0b; }
.kpi-resolved .kpi-icon, .kpi-resolved.kpi-icon { background: rgba(16,185,129,.1); color: #10b981; }
.kpi-urgent .kpi-icon, .kpi-urgent.kpi-icon { background: rgba(239,68,68,.1); color: #ef4444; }
.kpi-escalated .kpi-icon, .kpi-escalated.kpi-icon { background: rgba(168,85,247,.1); color: #a855f7; }
.kpi-sla .kpi-icon, .kpi-sla.kpi-icon { background: rgba(236,72,153,.1); color: #ec4899; }
.kpi-danger .kpi-icon, .kpi-danger.kpi-icon { background: rgba(239,68,68,.1); color: #ef4444; }

/* ---- Dashboard grid ---- */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 24px; }
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.dash-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.dash-trend { min-height: 200px; }
.dash-ai { background: linear-gradient(135deg, rgba(16,185,129,.04), rgba(59,130,246,.04)); }

/* ---- Trend chart ---- */
.trend-chart { width: 100%; height: 180px; }
.trend-chart-big { width: 100%; height: 280px; }
.trend-svg { width: 100%; height: 100%; }

/* ---- AI insights ---- */
.ai-insights-list { display: flex; flex-direction: column; gap: 12px; }
.ai-insight { display: flex; gap: 12px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.ai-insight-title { font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.ai-insight-detail { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }
.ai-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-full); font-size: .68rem; font-weight: 700; background: rgba(16,185,129,.12); color: var(--green-500); text-transform: uppercase; letter-spacing: .03em; }

/* ---- Ticket list ---- */
.filters-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filters-bar select, .filters-bar input { height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text); font-size: .86rem; outline: none; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 12px; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: .88rem; vertical-align: middle; }
.data-table tr:hover td { background: var(--surface-2); }
.ticket-row { cursor: pointer; }
.ticket-row-id { font-family: monospace; font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.ticket-row-title { font-weight: 600; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-row-dept { font-size: .82rem; color: var(--text-muted); }
.ticket-row-time { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }

/* ---- Ticket detail ---- */
.ticket-detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
.ticket-detail-main { min-width: 0; }
.ticket-detail-sidebar { display: flex; flex-direction: column; gap: 16px; }
.ticket-detail-header { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px; }
.ticket-header-top { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ticket-title { font-size: 1.3rem; font-weight: 700; line-height: 1.3; }
.ticket-no-display { font-family: monospace; font-size: .82rem; color: var(--text-muted); }
.ticket-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted); }
.ticket-description { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; margin-bottom: 16px; }
.ticket-description h4 { font-weight: 600; margin-bottom: 8px; }
.ticket-conversation { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 16px; }
.chat-messages { padding: 16px; max-height: 500px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.chat-msg { display: flex; gap: 10px; max-width: 85%; }
.chat-msg.me, .chat-msg.staff-msg { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.ai-msg { align-self: flex-start; max-width: 90%; }
.chat-msg-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.chat-msg-content { display: flex; flex-direction: column; gap: 4px; }
.chat-msg-meta { font-size: .7rem; color: var(--text-muted); }
.chat-msg-text { padding: 10px 14px; border-radius: var(--r-md); font-size: .88rem; line-height: 1.5; background: var(--surface-2); }
.chat-msg.me .chat-msg-text, .chat-msg.staff-msg .chat-msg-text { background: var(--accent); color: #fff; }
.chat-msg.ai-msg .chat-msg-text { background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.2); }
.chat-input-area { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-input-area textarea { flex: 1; resize: none; height: 42px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); font-size: .88rem; outline: none; }
.chat-closed-notice { padding: 12px 16px; text-align: center; color: var(--text-muted); font-size: .85rem; background: var(--surface-2); border-top: 1px solid var(--border); }

/* ---- Ticket form ---- */
.ticket-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; }
.form-section-title { font-weight: 700; font-size: .95rem; margin-bottom: 12px; margin-top: 20px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.form-section-title:first-child { margin-top: 0; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; }

/* ---- Evidence ---- */
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.evidence-item { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; text-align: center; font-size: .8rem; }
.file-upload-area { border: 2px dashed var(--border); border-radius: var(--r-md); padding: 24px; text-align: center; cursor: pointer; transition: border-color var(--dur-fast); }
.file-upload-area:hover { border-color: var(--accent); }
.upload-placeholder { color: var(--text-muted); font-size: .88rem; }

/* ---- Escalation timeline ---- */
.ticket-escalations { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; }
.esc-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.esc-item:last-child { border-bottom: none; }
.esc-badge { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: var(--r-sm); background: var(--surface-2); }

/* ---- Ticket history ---- */
.ticket-history { display: flex; flex-direction: column; gap: 0; }
.detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
.detail-row:last-child { border-bottom: none; }
.detail-row strong { font-weight: 600; }

/* ---- AI analysis ---- */
.ticket-ai-analysis, .ai-section { background: linear-gradient(135deg, rgba(16,185,129,.04), rgba(59,130,246,.04)); border: 1px solid rgba(16,185,129,.15); border-radius: var(--r-lg); padding: 16px; }
.ai-analysis-content { font-size: .88rem; line-height: 1.6; color: var(--text-soft); }
.ai-rec { display: flex; gap: 8px; padding: 8px; background: var(--surface); border-radius: var(--r-md); margin-top: 8px; font-size: .82rem; }
.ai-suggestion { padding: 8px 12px; background: var(--surface-2); border-radius: var(--r-md); font-size: .82rem; margin-top: 6px; }
.ai-issues { margin-top: 8px; }

/* ---- Satisfaction ---- */
.rating-stars { display: inline-flex; gap: 4px; }
.satisfaction-display { text-align: center; padding: 12px; }

/* ---- Companies ---- */
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.company-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; transition: box-shadow var(--dur-fast); }
.company-card:hover { box-shadow: var(--sh-md); }
.company-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.company-avatar { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 1rem; flex-shrink: 0; }
.company-details { flex: 1; min-width: 0; }
.company-details strong { display: block; font-size: .92rem; }
.company-details small { font-size: .76rem; color: var(--text-muted); }
.company-actions { display: flex; gap: 6px; margin-top: 12px; }

/* ---- Departments ---- */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.dept-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; position: relative; overflow: hidden; }
.dept-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dept-icon { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 1.1rem; }
.dept-desc { font-size: .82rem; color: var(--text-muted); margin-bottom: 10px; }
.dept-actions { display: flex; gap: 6px; }
.sub-depts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sub-dept-chip { font-size: .72rem; padding: 3px 8px; border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft); }

/* ---- AI Providers ---- */
.ai-providers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.provider-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; }
.provider-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.provider-name { font-weight: 700; font-size: .95rem; }
.provider-details { font-size: .82rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.provider-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- SLA Monitor ---- */
.sla-section { margin-bottom: 20px; }
.sla-section-danger h3 { color: var(--red-500); }
.sla-section-warning h3 { color: #f59e0b; }
.sla-section-safe h3 { color: var(--green-500); }
.sla-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 8px; background: var(--surface); }
.sla-indicator { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sla-time { font-family: monospace; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.sla-title { flex: 1; min-width: 0; font-size: .88rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Notifications ---- */
.notifs-list { display: flex; flex-direction: column; gap: 8px; }
.notif-card { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.notif-icon { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; flex-shrink: 0; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: .88rem; }
.notif-msg { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* ---- Profile ---- */
.profile-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.profile-card { text-align: center; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; color: #fff; }
.profile-detail { padding: 16px; }

/* ---- Settings ---- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }

/* ---- Activity ---- */
.activity-list { display: flex; flex-direction: column; gap: 0; }

/* ---- Staff table ---- */
.user-cell { display: flex; align-items: center; gap: 8px; }

/* ---- Forms ---- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-check { display: flex; align-items: center; gap: 8px; }
.hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* ---- Modal ---- */
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-content { padding: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 20px; }
.page-btn { min-width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font-size: .85rem; font-weight: 600; cursor: pointer; display: grid; place-items: center; transition: all var(--dur-fast); }
.page-btn:hover:not(:disabled) { background: var(--surface-2); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-info { font-size: .82rem; color: var(--text-muted); }

/* ---- Empty/Error states ---- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state h3 { margin-bottom: 8px; }
.empty-mini { padding: 20px; text-align: center; color: var(--text-muted); font-size: .85rem; }
.error-page { text-align: center; padding: 80px 20px; }
.error-page h1 { font-size: 3rem; font-weight: 800; color: var(--red-500); margin-bottom: 8px; }

/* ---- Search ---- */
.search-box { width: 100%; max-width: 400px; }

/* ---- Text utilities ---- */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--red-500); }
.mono-small { font-family: monospace; font-size: .8rem; }

/* ---- Category chart ---- */
.cat-chart { display: flex; flex-direction: column; gap: 8px; }
.cat-bar-item { display: flex; align-items: center; gap: 10px; }
.cat-bar-label { width: 100px; font-size: .82rem; flex-shrink: 0; }
.cat-bar-track { flex: 1; height: 24px; background: var(--surface-2); border-radius: var(--r-sm); overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: var(--r-sm); transition: width .5s ease; }
.cat-bar-count { font-size: .78rem; font-weight: 600; min-width: 30px; }

/* ---- Chart legend ---- */
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: .78rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; }

/* ---- Ticket list mini ---- */
.ticket-list-mini { display: flex; flex-direction: column; gap: 8px; }
.ticket-row-mini { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); cursor: pointer; transition: background var(--dur-fast); }
.ticket-row-mini:hover { background: var(--surface); }

/* ---- Auth pages ---- */
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, var(--navy-900, #0a1628), var(--navy-700, #1a2f4e)); }
.auth-card-wide { max-width: 520px; width: 100%; background: var(--surface); border-radius: var(--r-xl); padding: 36px; box-shadow: var(--sh-xl); }
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--text-muted); font-size: .82rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-footer { text-align: center; margin-top: 20px; font-size: .85rem; color: var(--text-muted); }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-muted); text-decoration: none; }
.back-link:hover { color: var(--accent); }

/* ---- Public/Landing ---- */
.public-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.public-header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 64px; }
.public-nav { display: flex; gap: 20px; align-items: center; }
.public-nav a { font-size: .88rem; color: var(--text-soft); text-decoration: none; font-weight: 500; }
.public-nav a:hover { color: var(--accent); }
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; max-width: 1200px; margin: 0 auto; padding: 60px 20px; }
.hero-content h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.hero-content p { font-size: 1.05rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual { display: grid; place-items: center; }
.hero-card-mock { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 20px; width: 100%; max-width: 420px; box-shadow: var(--sh-xl); }
.features-section { max-width: 1200px; margin: 0 auto; padding: 60px 20px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 40px; }
.feature-icon { width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center; margin-bottom: 14px; font-size: 1.4rem; }
.cta-section { max-width: 1200px; margin: 0 auto; padding: 60px 20px; text-align: center; }
.faq-section { max-width: 800px; margin: 0 auto; padding: 40px 20px; }
.faq-list { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.public-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 40px 20px 20px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; }
.footer-col h4 { font-weight: 700; margin-bottom: 12px; font-size: .9rem; }
.footer-col a { display: block; padding: 4px 0; font-size: .82rem; color: var(--text-muted); text-decoration: none; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { max-width: 1200px; margin: 30px auto 0; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; font-size: .8rem; color: var(--text-muted); }

/* ---- Mock dashboard visual (landing) ---- */
.mock-header { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.mock-dot { width: 10px; height: 10px; border-radius: 50%; }
.mock-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.mock-row { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--r-sm); background: var(--surface-2); }
.mock-text { height: 8px; border-radius: 2px; background: var(--border); flex: 1; }
.mock-badge { padding: 2px 8px; border-radius: var(--r-full); font-size: .68rem; font-weight: 600; }
.mock-ai-chat { padding: 12px; border-radius: var(--r-md); background: rgba(16,185,129,.06); border: 1px solid rgba(16,185,129,.15); }
.mock-ai-msg { font-size: .82rem; margin-bottom: 6px; }
.mock-ai-reply { font-size: .82rem; padding: 8px; background: var(--surface); border-radius: var(--r-sm); }

/* ---- Docs ---- */
.docs-container { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.docs-sidebar { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100dvh - 120px); overflow-y: auto; }
.docs-nav { display: flex; flex-direction: column; gap: 2px; }
.docs-nav-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-sm); font-size: .85rem; color: var(--text-soft); text-decoration: none; cursor: pointer; transition: background var(--dur-fast); }
.docs-nav-item:hover { background: var(--surface-2); }
.docs-nav-item.active { background: rgba(16,185,129,.1); color: var(--accent-strong, #059669); font-weight: 600; }
.docs-content { min-width: 0; }
.docs-content h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 12px; }
.docs-content h3 { font-size: 1.05rem; font-weight: 600; margin: 20px 0 8px; }
.docs-content p { line-height: 1.7; color: var(--text-soft); margin-bottom: 12px; }
.docs-content ul, .docs-content ol { margin-bottom: 12px; padding-left: 20px; }
.docs-content li { line-height: 1.6; margin-bottom: 4px; }
.docs-content pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; overflow-x: auto; margin: 12px 0; font-size: .82rem; }
.docs-content code { font-family: monospace; font-size: .85rem; }
.docs-intro { padding: 16px 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.docs-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-muted); }

/* ---- Flow diagram (docs) ---- */
.flow-diagram { display: flex; flex-direction: column; gap: 0; margin: 20px 0; }
.flow-step { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-bottom: 8px; }
.flow-step::before { content: counter(flow); counter-increment: flow; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; }

/* ---- AI features (public) ---- */
.ai-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.ai-feature { display: flex; gap: 10px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); }
.ai-feature-icon { font-size: 1.3rem; flex-shrink: 0; }

/* ---- Section subtitle ---- */
.section-sub { color: var(--text-muted); font-size: .92rem; margin-bottom: 20px; }

/* ---- Card header ---- */
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; }

/* ---- Stat number ---- */
.stat-num { font-size: 2rem; font-weight: 800; }

/* ---- Status colors ---- */
.green { color: var(--green-500); }
.blue { color: #3b82f6; }
.urgent { color: var(--red-500); }
.resolved { color: var(--green-500); }

/* ---- Primary badge ---- */
.primary-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-sm); background: rgba(16,185,129,.12); color: var(--green-500); font-size: .72rem; font-weight: 700; }

/* ---- Icon btn small ---- */
.icon-btn-sm { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text-soft); cursor: pointer; transition: all var(--dur-fast); }
.icon-btn-sm:hover { background: var(--surface-2); }

/* ---- Container ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---- Lang switcher (full, for public page) ---- */
.lang-switcher { display: flex; gap: 6px; align-items: center; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .ticket-detail-layout { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid-2 { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .docs-container { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; max-height: none; }
}
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .kpi-grid-3, .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .kpi-grid-3, .kpi-grid-4 { grid-template-columns: 1fr; }
}

/* ============================================================
   MISSING CSS — Badge variants, status colors, state modifiers
   ============================================================ */

/* ---- Badge status variants ---- */
.badge-open { background: rgba(59,130,246,.15); color: #60a5fa; }
.badge-in_progress { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-progress { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-resolved { background: rgba(16,185,129,.15); color: var(--green-500); }
.badge-closed { background: rgba(107,114,128,.15); color: #9ca3af; }
.badge-reopened { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-pending { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-suspended { background: rgba(239,68,68,.15); color: var(--red-500); }
.badge-approved { background: rgba(16,185,129,.15); color: var(--green-500); }
.badge-danger { background: rgba(239,68,68,.15); color: var(--red-500); }
.badge-info { background: rgba(59,130,246,.15); color: #60a5fa; }
.badge-success { background: rgba(16,185,129,.15); color: var(--green-500); }
.badge-escalated { background: rgba(168,85,247,.15); color: #a855f7; }

/* ---- Badge priority variants ---- */
.badge-priority-normal { background: rgba(59,130,246,.15); color: #60a5fa; }
.badge-priority-urgent { background: rgba(239,68,68,.15); color: var(--red-500); font-weight: 700; }
.badge-priority-low { background: rgba(107,114,128,.15); color: #9ca3af; }
.badge-priority-high { background: rgba(245,158,11,.15); color: #fbbf24; }

/* ---- Badge role variants ---- */
.badge-role-super_admin { background: rgba(168,85,247,.15); color: #a855f7; font-weight: 700; }
.badge-role-admin { background: rgba(168,85,247,.15); color: #a855f7; }
.badge-role-secretary { background: rgba(59,130,246,.15); color: #60a5fa; }
.badge-role-dg { background: rgba(16,185,129,.15); color: var(--green-500); }
.badge-role-director_general { background: rgba(16,185,129,.15); color: var(--green-500); }
.badge-role-coordinator { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-role-officer { background: rgba(107,114,128,.15); color: #9ca3af; }
.badge-role-company { background: rgba(59,130,246,.15); color: #60a5fa; }
.badge-role-company_admin { background: rgba(59,130,246,.15); color: #60a5fa; }

/* ---- SLA severity states ---- */
.sla-danger { border-color: rgba(239,68,68,.3) !important; background: rgba(239,68,68,.04); }
.sla-warning { border-color: rgba(245,158,11,.3) !important; background: rgba(245,158,11,.04); }
.sla-safe { border-color: rgba(16,185,129,.3) !important; background: rgba(16,185,129,.04); }
.sla-time-danger { color: var(--red-500); }
.sla-time-warning { color: #f59e0b; }
.sla-time-safe { color: var(--green-500); }
.sla-indicator-danger { background: var(--red-500); box-shadow: 0 0 8px rgba(239,68,68,.4); }
.sla-indicator-warning { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,.4); }
.sla-indicator-safe { background: var(--green-500); }

/* ---- Provider card states ---- */
.provider-card.inactive { opacity: .55; }
.provider-card.active { border-color: rgba(16,185,129,.3); }
.provider-card.primary { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ---- Company card states ---- */
.company-card.pending { border-color: rgba(245,158,11,.3); }
.company-card.suspended { opacity: .6; border-color: rgba(239,68,68,.3); }

/* ---- Notification states ---- */
.notif-item.unread, .notif-card.unread { border-color: var(--accent); background: rgba(16,185,129,.03); }

/* ---- AI insight severity ---- */
.ai-insight.high { border-left: 3px solid var(--red-500); }
.ai-insight.medium { border-left: 3px solid #f59e0b; }
.ai-insight.low { border-left: 3px solid var(--green-500); }
.ai-insight.critical { border-left: 3px solid var(--red-500); background: rgba(239,68,68,.04); }

/* ---- Misc missing classes ---- */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; }
.logo-text { font-size: .95rem; line-height: 1.2; }
.logo-text strong { display: block; }
.logo-text small { font-size: .7rem; color: var(--text-muted); font-weight: 400; }

.docs-page { max-width: 900px; margin: 0 auto; }

.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); font-size: .85rem; }
.file-item .file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .file-size { color: var(--text-muted); font-size: .78rem; flex-shrink: 0; }
.file-item .file-remove { cursor: pointer; color: var(--red-500); width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--r-sm); }
.file-item .file-remove:hover { background: rgba(239,68,68,.1); }

.msg-count { color: var(--text-muted); font-weight: 400; font-size: .85rem; }

.ticket-evidence { margin-top: 16px; }
.ticket-evidence h4 { font-weight: 600; margin-bottom: 8px; font-size: .9rem; }
.ticket-evidence .evidence-grid { margin-top: 8px; }

.ticket-resolution { margin-top: 16px; padding: 14px; background: rgba(16,185,129,.06); border: 1px solid rgba(16,185,129,.15); border-radius: var(--r-md); }
.ticket-resolution h4 { font-weight: 600; margin-bottom: 8px; color: var(--green-500); }

/* ---- AI tags ---- */
.ai-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--r-full); font-size: .75rem; font-weight: 600; background: var(--surface-2); margin-right: 6px; margin-top: 6px; }
.ai-tag-high, .ai-tag-urgent { background: rgba(239,68,68,.12); color: var(--red-500); }
.ai-tag-medium, .ai-tag-normal { background: rgba(245,158,11,.12); color: #f59e0b; }
.ai-tag-low { background: rgba(16,185,129,.12); color: var(--green-500); }

/* ---- Star rating ---- */
.star { font-size: 1.4rem; color: var(--border); cursor: pointer; transition: color var(--dur-fast); user-select: none; }
.star.active, .star:hover { color: #fbbf24; }
