/* ═══════════════════════════════════════════════════════════
   CLINIUM TICKET SYSTEEM — GLOBAL STYLES v2.0
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

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

:root {
  --bg: #0d1117;
  --bg2: #161b26;
  --bg3: #1a2035;
  --sidebar: #0a0e1a;
  --card: #161b26;
  --card2: #1e2538;
  --border: rgba(79,195,247,0.12);
  --border2: rgba(255,255,255,0.06);
  --accent: #4fc3f7;
  --accent2: #0284c7;
  --accent-glow: rgba(79,195,247,0.2);
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #64748b;
  --red: #ef4444;
  --green: #10b981;
  --yellow: #f59e0b;
  --purple: #8b5cf6;
  --orange: #f97316;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --sidebar-w: 248px;
  --topbar-h: 60px;
}

html { font-size: 15px; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
img { max-width: 100%; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(79,195,247,0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(79,195,247,0.4); }

/* ── LAYOUT ── */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); height: 100vh; background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 100; overflow: hidden; transition: transform .3s ease; }
.main-area { margin-left: var(--sidebar-w); width: calc(100% - var(--sidebar-w)); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .3s ease, width .3s ease; }
.topbar { height: var(--topbar-h); background: var(--bg2); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 50; }
.page-content { padding: 24px; flex: 1; width: 100%; }

/* ── FULL-WIDTH: remove max-width from all top-level page wrappers ── */
.page-content > div { max-width: 100% !important; width: 100%; }

/* ── SIDEBAR ── */
.sidebar-logo { padding: 18px 20px 14px; border-bottom: 1px solid var(--border2); flex-shrink: 0; display: flex; align-items: center; min-height: 64px; }
.sidebar-logo img { height: 44px; width: auto; object-fit: contain; display: block; }
.sidebar-logo .logo-fallback { display: flex; align-items: center; }
.logo-text .main { display: block; color: #c8c8c8; font-weight: 800; font-size: 15px; letter-spacing: 2.5px; text-transform: uppercase; }
.logo-text .sub { display: block; color: var(--text3); font-size: 8.5px; letter-spacing: 3px; text-transform: uppercase; margin-top: 2px; }
.logo-brackets { color: #4fc3f7; }
.sidebar-section { padding: 6px 8px 2px; color: var(--text3); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; margin-top: 8px; }
.sidebar-nav { flex: 1; padding: 8px; overflow-y: auto; overflow-x: hidden; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text2); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; margin-bottom: 1px; white-space: nowrap; text-decoration: none; }
.nav-item:hover { background: rgba(79,195,247,0.08); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, rgba(79,195,247,0.15), rgba(99,102,241,0.15)); color: var(--accent); border-left: 2px solid var(--accent); margin-left: -2px; padding-left: 14px; }
.nav-item .ni { width: 20px; text-align: center; flex-shrink: 0; font-size: 15px; }
.nav-item .badge-count { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; font-size: 10px; font-weight: 700; padding: 1px 6px; min-width: 18px; text-align: center; }
.sidebar-footer { padding: 10px 8px 14px; border-top: 1px solid var(--border2); flex-shrink: 0; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: background .15s; text-decoration: none; }
.sidebar-user:hover { background: rgba(255,255,255,0.04); }
.sidebar-user-info .name { font-size: 13px; font-weight: 600; color: var(--text); }
.sidebar-user-info .role { font-size: 11px; color: var(--text3); }

/* ── TOPBAR ── */
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 8px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text2); font-size: 16px; position: relative; transition: background .15s; }
.topbar-btn:hover { background: rgba(79,195,247,0.1); color: var(--accent); }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text); }
.topbar-sub { font-size: 12px; color: var(--text3); margin-top: 1px; }
.mobile-toggle { display: none; }

/* ── NOTIF PANEL ── */
.notif-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 360px; background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 300; overflow: hidden; }
.notif-panel-header { padding: 14px 16px; border-bottom: 1px solid var(--border2); display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; }
.notif-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border2); cursor: pointer; transition: background .1s; }
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { background: rgba(79,195,247,0.05); border-left: 3px solid var(--accent); }
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-msg { font-size: 13px; color: var(--text); line-height: 1.4; }
.notif-item-time { font-size: 11px; color: var(--text3); margin-top: 3px; }
.notif-empty { padding: 32px; text-align: center; color: var(--text3); font-size: 13px; }
.notif-badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; border-radius: 50%; width: 16px; height: 16px; font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg2); }
.notif-wrapper { position: relative; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; text-decoration: none; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, #0284c7, #4fc3f7); color: #fff; box-shadow: 0 2px 12px rgba(79,195,247,0.25); }
.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(79,195,247,0.35); }
.btn-secondary { background: rgba(255,255,255,0.06); color: var(--text2); border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-success { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.btn-success:hover { background: rgba(16,185,129,0.25); }
.btn-warning { background: rgba(245,158,11,0.15); color: var(--yellow); border: 1px solid rgba(245,158,11,0.3); }
.btn-warning:hover { background: rgba(245,158,11,0.25); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; font-size: 15px; }

/* ── CARDS ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h3, .card-header .card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border2); }
.card:hover { border-color: rgba(79,195,247,0.2); }
.card-glow:hover { box-shadow: 0 0 0 1px rgba(79,195,247,0.3), 0 8px 30px rgba(79,195,247,0.05); }

/* ── STAT CARDS ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; align-items: flex-start; gap: 14px; transition: all .2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.2); border-color: rgba(79,195,247,0.25); }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text2); margin-top: 4px; }
.stat-change { font-size: 11px; margin-top: 4px; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.form-input { width: 100%; padding: 10px 14px; background: rgba(255,255,255,0.04); border: 1.5px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; transition: all .15s; outline: none; }
.form-input:focus { border-color: var(--accent); background: rgba(79,195,247,0.05); box-shadow: 0 0 0 3px rgba(79,195,247,0.1); }
.form-input::placeholder { color: var(--text3); }
textarea.form-input { resize: vertical; min-height: 100px; }
select.form-input { cursor: pointer; }
select.form-input option { background: var(--bg3); color: var(--text); }
.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 5px; }
.char-count { text-align: right; font-size: 11px; color: var(--text3); margin-top: 4px; }
.input-group { display: flex; gap: 0; }
.input-group .form-input { border-radius: 8px 0 0 8px; }
.input-group .btn { border-radius: 0 8px 8px 0; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 16px; font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .7px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--border2); font-size: 13px; color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; transition: background .1s; }
tr.clickable:hover td { background: rgba(79,195,247,0.04); }
.th-sortable { cursor: pointer; user-select: none; }
.th-sortable:hover { color: var(--accent); }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 100px; font-size: 11px; font-weight: 700; white-space: nowrap; }

/* ── TAGS ── */
.tag { background: rgba(79,195,247,0.1); color: var(--accent); padding: 2px 9px; border-radius: 100px; font-size: 11px; font-weight: 600; border: 1px solid rgba(79,195,247,0.2); }
.tag-red { background: rgba(239,68,68,0.1); color: var(--red); border-color: rgba(239,68,68,0.2); }
.tag-green { background: rgba(16,185,129,0.1); color: #10b981; border-color: rgba(16,185,129,0.2); }
.tag-yellow { background: rgba(245,158,11,0.1); color: var(--yellow); border-color: rgba(245,158,11,0.2); }
.tag-gray { background: rgba(100,116,139,0.15); color: var(--text3); border-color: rgba(100,116,139,0.2); }
.tags-wrap { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-removable { display: flex; align-items: center; gap: 4px; }
.tag-removable button { background: none; border: none; cursor: pointer; color: inherit; padding: 0; line-height: 1; font-size: 13px; opacity: .7; }
.tag-removable button:hover { opacity: 1; }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); animation: fadeIn .2s ease; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 28px; width: 100%; max-height: 90vh; overflow-y: auto; animation: slideUp .25s ease; }
.modal-sm { max-width: 440px; }
.modal-md { max-width: 620px; }
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 1000px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-title { font-size: 17px; font-weight: 800; color: var(--text); }
.modal-close { background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text3); font-size: 16px; transition: all .15s; }
.modal-close:hover { background: rgba(239,68,68,0.15); color: var(--red); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding-top: 16px; border-top: 1px solid var(--border2); margin-top: 16px; }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25); color: #fcd34d; }
.alert-info { background: rgba(79,195,247,0.1); border: 1px solid rgba(79,195,247,0.25); color: #7dd3fc; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); color: #6ee7b7; }
.alert-icon { font-size: 16px; flex-shrink: 0; }

/* ── PROGRESS ── */
.progress { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 3px; transition: width .5s ease; }

/* ── TABS ── */
.tab-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab-btn { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--text3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── SEARCH ── */
.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; color: var(--text3); font-size: 14px; pointer-events: none; }
.search-wrap input { padding-left: 38px; }
.search-wrap .search-clear { position: absolute; right: 10px; background: none; border: none; color: var(--text3); cursor: pointer; padding: 4px; font-size: 14px; }

/* ── FILE UPLOAD ── */
.file-drop { border: 2px dashed rgba(79,195,247,0.25); border-radius: 10px; padding: 24px; text-align: center; cursor: pointer; transition: all .2s; background: rgba(79,195,247,0.03); }
.file-drop:hover, .file-drop.drag { border-color: var(--accent); background: rgba(79,195,247,0.07); }
.file-drop-icon { font-size: 28px; margin-bottom: 8px; color: var(--text3); }
.file-drop-text { color: var(--text2); font-size: 14px; font-weight: 500; }
.file-drop-hint { color: var(--text3); font-size: 12px; margin-top: 4px; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 10px; }
.att-item { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1; cursor: pointer; }
.att-item img { width: 100%; height: 100%; object-fit: cover; }
.att-item-file { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px; background: var(--bg3); }
.att-item-file .fi { font-size: 22px; color: var(--text3); }
.att-item-file .fn { font-size: 9px; color: var(--text3); text-align: center; word-break: break-all; margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.att-remove { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.7); color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ── LIGHTBOX ── */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 500; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 95vw; max-height: 95vh; object-fit: contain; border-radius: 8px; }
.lightbox-close { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,0.15); border: none; color: #fff; border-radius: 50%; width: 44px; height: 44px; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.page-header-left h1 { font-size: 20px; font-weight: 800; color: var(--text); }
.page-header-left p { color: var(--text3); font-size: 13px; margin-top: 3px; }
.page-header-right { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── FILTER BAR ── */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 14px 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
.filter-select { height: 36px; padding: 0 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 7px; color: var(--text); font-size: 13px; cursor: pointer; min-width: 120px; outline: none; }
.filter-select:focus { border-color: var(--accent); }
.filter-select option { background: var(--bg3); }
.filter-sep { width: 1px; height: 24px; background: var(--border2); margin: 0 4px; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text3); }
.empty-state-icon { font-size: 40px; margin-bottom: 14px; opacity: .5; color: var(--text3); }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text2); margin-bottom: 6px; }
.empty-state p { font-size: 13px; line-height: 1.5; }

/* ── COMMENT ── */
.comment { padding: 16px; background: rgba(255,255,255,0.02); border: 1px solid var(--border2); border-radius: 10px; transition: border-color .15s; }
.comment:hover { border-color: var(--border); }
.comment.internal { background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.2); }
.comment-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.comment-author { display: flex; align-items: center; gap: 8px; }
.comment-meta { font-size: 12px; color: var(--text3); }
.comment-text { font-size: 13.5px; color: var(--text2); line-height: 1.7; white-space: pre-wrap; }

/* ── HISTORY ── */
.history-item { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border2); }
.history-item:last-child { border-bottom: none; }
.history-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex-shrink: 0; margin-top: 5px; }
.history-content { flex: 1; font-size: 13px; color: var(--text2); }
.history-time { font-size: 11px; color: var(--text3); }

/* ── KB ── */
.kb-article-content { color: var(--text2); line-height: 1.8; font-size: 14px; }
.kb-article-content h1,.kb-article-content h2,.kb-article-content h3 { color: var(--text); margin: 1.2em 0 .5em; }
.kb-article-content h2 { font-size: 16px; font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid var(--border2); }
.kb-article-content h3 { font-size: 14px; font-weight: 700; }
.kb-article-content p { margin-bottom: .8em; }
.kb-article-content ul,.kb-article-content ol { padding-left: 1.5em; margin-bottom: .8em; }
.kb-article-content li { margin-bottom: .3em; }
.kb-article-content code { background: rgba(79,195,247,0.1); padding: 1px 5px; border-radius: 4px; font-size: .9em; color: var(--accent); font-family: 'Courier New', monospace; }
.kb-article-content pre { background: var(--bg3); padding: 14px; border-radius: 8px; overflow-x: auto; margin-bottom: 1em; border: 1px solid var(--border2); }
.kb-article-content pre code { background: none; padding: 0; color: var(--text2); }
.kb-article-content strong { color: var(--text); font-weight: 700; }
.kb-article-content blockquote { border-left: 3px solid var(--accent); padding-left: 14px; color: var(--text3); margin: 1em 0; font-style: italic; }

/* ── SKELETON ── */
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.04) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── SWITCH ── */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; cursor: pointer; inset: 0; background: rgba(255,255,255,0.1); border-radius: 24px; transition: .3s; border: 1px solid var(--border); }
.switch-slider:before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: var(--text3); border-radius: 50%; transition: .3s; }
.switch input:checked + .switch-slider { background: rgba(79,195,247,0.25); border-color: var(--accent); }
.switch input:checked + .switch-slider:before { transform: translateX(20px); background: var(--accent); }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border2); margin: 16px 0; }

/* ── TOOLTIP ── */
[data-tooltip] { position: relative; cursor: default; }
[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--bg3); color: var(--text); padding: 5px 10px; border-radius: 6px; font-size: 11px; white-space: nowrap; margin-bottom: 6px; border: 1px solid var(--border); z-index: 100; pointer-events: none; }

/* ── ANIMATIONS ── */
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes slideUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
@keyframes spin { to{transform:rotate(360deg)} }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.fade-in { animation: fadeIn .3s ease; }
.slide-up { animation: slideUp .3s ease; }
.spin { animation: spin 1s linear infinite; display: inline-block; }
.pulse { animation: pulse 2s ease infinite; }

/* ── OVERDUE / SLA ── */
.overdue-badge { background: rgba(239,68,68,0.15); color: var(--red); font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.sla-ok { color: var(--green); }
.sla-warn { color: var(--yellow); }
.sla-breach { color: var(--red); animation: pulse 2s ease infinite; }

/* ── SATISFACTION STARS ── */
.stars { display: flex; gap: 4px; }
.star { font-size: 22px; cursor: pointer; transition: transform .1s; opacity: .3; }
.star.active { opacity: 1; color: var(--yellow); }
.star:hover { transform: scale(1.2); }

/* ── RICH TEXT TOOLBAR ── */
.rich-toolbar { display: flex; gap: 4px; padding: 8px 10px; background: rgba(255,255,255,0.03); border: 1.5px solid var(--border); border-bottom: none; border-radius: 8px 8px 0 0; flex-wrap: wrap; }
.rich-toolbar button { background: rgba(255,255,255,0.05); border: 1px solid transparent; border-radius: 5px; color: var(--text2); padding: 4px 8px; font-size: 12px; cursor: pointer; transition: all .1s; font-weight: 600; }
.rich-toolbar button:hover { background: rgba(79,195,247,0.15); color: var(--accent); border-color: rgba(79,195,247,0.2); }
.rich-textarea { border-radius: 0 0 8px 8px !important; }

/* ── ANNOUNCEMENTS ── */
.announcement { padding: 12px 16px; border-radius: 8px; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.announcement.info { background: rgba(79,195,247,0.08); border: 1px solid rgba(79,195,247,0.2); }
.announcement.warning { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); }
.announcement.danger { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); }

/* ── PRIORITY GRID (create ticket) ── */
.priority-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.priority-opt { border: 2px solid var(--border); border-radius: 10px; padding: 14px 10px; cursor: pointer; text-align: center; transition: all .15s; background: rgba(255,255,255,0.02); }
.priority-opt:hover { border-color: var(--accent); background: rgba(79,195,247,0.05); }
.priority-opt.selected { background: rgba(79,195,247,0.08); }
.priority-opt .p-icon { font-size: 20px; margin-bottom: 6px; }
.priority-opt .p-label { font-size: 13px; font-weight: 700; }
.priority-opt .p-desc { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; width: 100%; }
  .page-content > div { max-width: 100% !important; width: 100%; }
  .mobile-toggle { display: flex; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 99; }
  .sidebar-overlay.show { display: block; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
  .form-row-4 { grid-template-columns: 1fr 1fr; }
  .priority-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .page-content { padding: 14px; }
  .page-header { flex-direction: column; }
  .filter-bar { flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ── AUTH PAGES ── */
.auth-page { min-height: 100vh; background: radial-gradient(ellipse at top, #0d1f3c 0%, #0d1117 60%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo img { height: 48px; }
.auth-form-card { background: rgba(22,27,38,0.95); border: 1px solid rgba(79,195,247,0.15); border-radius: 18px; padding: 34px; backdrop-filter: blur(10px); box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
.auth-title { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.auth-sub { font-size: 13px; color: var(--text3); margin-bottom: 28px; }
.auth-demo { background: rgba(79,195,247,0.06); border: 1px solid rgba(79,195,247,0.12); border-radius: 10px; padding: 14px; margin-top: 18px; }
.auth-demo-title { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.auth-demo-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.auth-demo-item:last-child { border: none; }
.auth-demo-btn { background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 5px; color: var(--text3); font-size: 11px; padding: 3px 8px; cursor: pointer; transition: all .15s; }
.auth-demo-btn:hover { background: rgba(79,195,247,0.1); color: var(--accent); }

/* ── TICKET DETAIL ── */
.ticket-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ticket-meta-item { display: flex; flex-direction: column; gap: 4px; }
.ticket-meta-label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .7px; }
.ticket-meta-value { font-size: 13px; color: var(--text); font-weight: 500; }

/* ── USER CARD ── */
.user-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: all .15s; }
.user-card:hover { border-color: rgba(79,195,247,0.3); box-shadow: 0 4px 20px rgba(0,0,0,0.2); }

/* ── PROFILE ── */
.profile-banner { height: 100px; background: linear-gradient(135deg, #0d1f3c, #1a1035); border-radius: var(--radius) var(--radius) 0 0; position: relative; overflow: hidden; }
.profile-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(79,195,247,0.15), rgba(99,102,241,0.1)); }

/* ── REPORTS ── */
.report-chart { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-val { font-size: 10px; color: var(--text3); }
.bar-fill { width: 100%; border-radius: 4px 4px 0 0; transition: height .5s ease; background: linear-gradient(180deg, var(--accent), var(--accent2)); }
.bar-lbl { font-size: 10px; color: var(--text3); white-space: nowrap; }