/* GLO Staff Dashboard — Shared Styles */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Sarabun', sans-serif; background: #F2F6FF; color: #1E2B40; font-size: 14px; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #F0F4FA; }
::-webkit-scrollbar-thumb { background: #BDD0EE; border-radius: 4px; }

/* LAYOUT */
.app { display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
.sidebar { width: 220px; min-width: 220px; height: 100vh; background: #1A47A1; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; }
.sidebar-logo { padding: 16px 14px 12px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.logo-badge { display: flex; align-items: center; gap: 8px; }
.logo-icon { width: 34px; height: 34px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #1A47A1; flex-shrink: 0; }
.logo-text { color: #fff; font-size: 13px; font-weight: 600; line-height: 1.3; }
.logo-sub { color: rgba(255,255,255,0.55); font-size: 10.5px; }
.sidebar-section { padding: 10px 12px 3px; color: rgba(255,255,255,0.4); font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin: 1px 6px; border-radius: 7px; cursor: pointer; color: rgba(255,255,255,0.7); font-size: 13px; transition: all 0.14s; user-select: none; text-decoration: none; }
.nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.18); color: #fff; font-weight: 600; }
.nav-icon { font-size: 15px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: #E45D3A; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.nav-badge.teal { background: #0D9488; }
.sidebar-bottom { margin-top: auto; padding: 12px 8px; border-top: 1px solid rgba(255,255,255,0.12); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer; transition: background 0.14s; }
.user-chip:hover { background: rgba(255,255,255,0.08); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #3B6FD4; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-name { color: #fff; font-size: 12.5px; font-weight: 500; }
.user-role { color: rgba(255,255,255,0.45); font-size: 10.5px; }

/* MAIN */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar { height: 52px; background: #fff; border-bottom: 1px solid #DDE6F5; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; }
.topbar-left { display: flex; align-items: center; gap: 6px; }
.topbar-title { font-size: 15px; font-weight: 700; color: #1E2B40; }
.topbar-sub { font-size: 11.5px; color: #8AA0C0; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-tag { background: #EEF3FB; color: #3B6FD4; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; border: 1px solid #C5D6F5; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; display: inline-block; margin-right: 4px; }
.status-live { font-size: 12px; color: #22A24A; font-weight: 600; }
.content { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* SCREEN TABS */
.screen-tabs { display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap; }
.screen-tab { padding: 6px 16px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid #DDE6F5; color: #5A7098; background: #fff; transition: all 0.14s; white-space: nowrap; }
.screen-tab:hover { border-color: #3B6FD4; color: #3B6FD4; }
.screen-tab.active { background: #1A47A1; color: #fff; border-color: #1A47A1; }

/* CARDS */
.card { background: #fff; border-radius: 12px; border: 1px solid #E5EDF8; box-shadow: 0 1px 3px rgba(30,43,64,0.06); padding: 16px 18px; }
.card-title { font-size: 13px; font-weight: 700; color: #1E2B40; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.card-dot { width: 5px; height: 5px; border-radius: 50%; background: #1A47A1; }

/* KPI */
.kpi-row { display: grid; gap: 12px; margin-bottom: 18px; }
.kpi-4 { grid-template-columns: repeat(4,1fr); }
.kpi-3 { grid-template-columns: repeat(3,1fr); }
.kpi-card { background: #fff; border-radius: 12px; border: 1px solid #E5EDF8; box-shadow: 0 1px 3px rgba(30,43,64,0.05); padding: 14px 16px; position: relative; overflow: hidden; }
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 12px 12px 0 0; }
.kpi-card.blue::before { background: #3B6FD4; }
.kpi-card.teal::before { background: #0D9488; }
.kpi-card.gold::before { background: #D97706; }
.kpi-card.rose::before { background: #E45D3A; }
.kpi-card.green::before { background: #22A24A; }
.kpi-card.purple::before { background: #7C3AED; }
.kpi-label { font-size: 11.5px; color: #7A90B3; margin-bottom: 5px; font-weight: 500; }
.kpi-value { font-size: 24px; font-weight: 700; color: #1E2B40; line-height: 1; }
.kpi-value.blue { color: #3B6FD4; }
.kpi-value.teal { color: #0D9488; }
.kpi-value.gold { color: #D97706; }
.kpi-value.rose { color: #E45D3A; }
.kpi-value.green { color: #22A24A; }
.kpi-value.red { color: #DC2626; }
.kpi-sub { font-size: 11px; color: #A0B0C8; margin-top: 4px; }
.kpi-icon { position: absolute; top: 12px; right: 14px; font-size: 20px; opacity: 0.12; }

/* CHARTS */
.charts-row { display: grid; gap: 14px; margin-bottom: 18px; }
.charts-2 { grid-template-columns: 1fr 1fr; }
.charts-3 { grid-template-columns: 1fr 1fr 1fr; }
.chart-wrap { height: 200px; position: relative; }
.chart-wrap.tall { height: 260px; }

/* TABLE */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { background: #F4F7FD; color: #5A7098; font-size: 11px; font-weight: 700; text-align: left; padding: 9px 12px; border-bottom: 1px solid #E5EDF8; letter-spacing: 0.02em; white-space: nowrap; }
tbody td { padding: 9px 12px; border-bottom: 1px solid #F0F4FA; color: #2A3A56; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #F7FAFF; }

/* BADGES */
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.badge.pending { background: #FEF3C7; color: #B45309; }
.badge.done    { background: #DCFCE7; color: #15803D; }
.badge.review  { background: #EDE9FE; color: #6D28D9; }
.badge.active  { background: #DBEAFE; color: #1D4ED8; }
.badge.wait    { background: #FEF9C3; color: #A16207; }
.badge.alert   { background: #FFE4E6; color: #BE123C; }
.badge.high    { background: #FFE4E6; color: #BE123C; }
.badge.medium  { background: #FEF3C7; color: #B45309; }
.badge.low     { background: #DCFCE7; color: #15803D; }
.badge.info    { background: #EFF6FF; color: #1D4ED8; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 13px; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; transition: all 0.14s; font-family: 'Sarabun', sans-serif; white-space: nowrap; }
.btn-primary { background: #1A47A1; color: #fff; }
.btn-primary:hover { background: #153A87; }
.btn-teal { background: #0D9488; color: #fff; }
.btn-teal:hover { background: #0B7D73; }
.btn-ghost { background: #EEF3FB; color: #3B6FD4; border: 1px solid #C5D6F5; }
.btn-ghost:hover { background: #DDE8F8; }
.btn-danger { background: #FEE2E2; color: #DC2626; border: 1px solid #FECACA; }
.btn-danger:hover { background: #FECACA; }
.btn-gold { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.btn-gold:hover { background: #FDE68A; }
.btn-sm { padding: 4px 9px; font-size: 11px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* INPUTS */
input[type=text], input[type=search], select, textarea {
  border: 1px solid #DDE6F5; border-radius: 7px; padding: 7px 11px;
  font-family: 'Sarabun', sans-serif; font-size: 13px; color: #1E2B40;
  background: #fff; outline: none; transition: border-color 0.14s;
}
input[type=text]:focus, input[type=search]:focus, select:focus, textarea:focus { border-color: #3B6FD4; box-shadow: 0 0 0 3px rgba(59,111,212,0.1); }
textarea { resize: vertical; min-height: 80px; width: 100%; }

/* INFO BARS */
.info-bar { border-radius: 8px; padding: 8px 13px; font-size: 12.5px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.info-bar.blue { background: #EFF8FF; border: 1px solid #BAE6FD; color: #0369A1; }
.info-bar.warn { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.info-bar.danger { background: #FFF1F2; border: 1px solid #FECDD3; color: #BE123C; }
.info-bar.green { background: #F0FDF4; border: 1px solid #BBF7D0; color: #15803D; }

/* UTILS */
.section-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-hdr h2 { font-size: 14px; font-weight: 700; color: #1E2B40; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.ann-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid #F0F4FA; }
.ann-tag { background: #EEF3FB; border: 1px solid #C5D6F5; color: #3B6FD4; font-size: 10.5px; padding: 2px 8px; border-radius: 5px; font-weight: 500; }

/* RAG / SYNC */
.rag-row { display: flex; align-items: center; gap: 9px; background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 7px; padding: 8px 12px; font-size: 12px; color: #15803D; margin-bottom: 14px; }
.rag-dot { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; flex-shrink: 0; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* PROGRESS BAR */
.progress-bar { height: 7px; background: #E5EDF8; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.progress-fill.blue { background: #3B6FD4; }
.progress-fill.teal { background: #0D9488; }
.progress-fill.gold { background: #D97706; }
.progress-fill.green { background: #22C55E; }
.progress-fill.red { background: #EF4444; }

/* LEFT BORDER ROWS */
.lborder-high { border-left: 3px solid #EF4444 !important; }
.lborder-med  { border-left: 3px solid #F59E0B !important; }
.lborder-low  { border-left: 3px solid #22C55E !important; }

/* STEP PROGRESS */
.step-bar { display: flex; align-items: center; gap: 0; margin-bottom: 20px; }
.step-item { display: flex; align-items: center; flex: 1; }
.step-circle { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.step-circle.done { background: #1A47A1; color: #fff; }
.step-circle.active { background: #3B6FD4; color: #fff; box-shadow: 0 0 0 3px rgba(59,111,212,0.25); }
.step-circle.idle { background: #E5EDF8; color: #A0B0C8; }
.step-label { font-size: 11px; margin-left: 7px; color: #5A7098; white-space: nowrap; }
.step-label.active { color: #1A47A1; font-weight: 700; }
.step-line { flex: 1; height: 2px; background: #E5EDF8; margin: 0 4px; }
.step-line.done { background: #1A47A1; }
