/* AryaOS SB-015 News — Executive Intelligence Portal CSS */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #162032;
  --bg-card-hover: #1c2940;
  --bg-glass: rgba(17, 24, 39, 0.85);
  --border-subtle: #1f2d42;
  --border-focus: #38bdf8;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;
  --font-sans: 'Inter', 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-glow: 0 0 25px -5px rgba(56, 189, 248, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Glass Header */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  font-size: 1.85rem;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
}

.brand-titles h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-titles p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.brand-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 9999px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Date Selector Dropdown */
.date-selector-container {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
}

.date-selector-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.date-select {
  background: transparent;
  color: var(--text-main);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  outline: none;
}

.date-select option {
  background: var(--bg-secondary);
  color: var(--text-main);
  padding: 0.5rem;
}

.nav-arrow-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.nav-arrow-btn:hover {
  color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.05);
}

/* Search Box */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.4rem 0.75rem 0.4rem 2rem;
  font-size: 0.82rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  outline: none;
  width: 190px;
  transition: all 0.2s ease;
}

.search-input:focus {
  width: 260px;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.search-icon {
  position: absolute;
  left: 0.65rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  pointer-events: none;
}

.stat-modal-btn {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(129, 140, 248, 0.1));
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.stat-modal-btn:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.2);
}

/* Sub-nav & KPI Ribbon */
.portal-subnav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.5rem 1.5rem;
}

.subnav-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.kpi-ribbon {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.kpi-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kpi-item strong {
  color: #fff;
  font-weight: 600;
}

.kpi-pill {
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.kpi-pill-score {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.kpi-pill-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Quick Navigation Tabs */
.quick-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

/* Main Layout */
.portal-main {
  max-width: 1440px;
  margin: 1.5rem auto;
  padding: 0 1.5rem 4rem 1.5rem;
}

/* Content Container */
.report-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
}

/* Typography Inside Brief */
.report-content h1 {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: #fff;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.report-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-top: 2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.report-content h3 {
  font-size: 1.12rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
}

.report-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

.report-content p {
  margin-bottom: 0.9rem;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.report-content ul, .report-content ol {
  margin-left: 1.4rem;
  margin-bottom: 1rem;
  color: #cbd5e1;
}

.report-content li {
  margin-bottom: 0.45rem;
}

.report-content hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 2rem 0;
}

.report-content a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: all 0.15s;
  border-bottom: 1px dotted rgba(56, 189, 248, 0.4);
}

.report-content a:hover {
  color: #fff;
  border-bottom-color: var(--accent-cyan);
}

/* Executive Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
  line-height: 1.2;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-new {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-new .badge-dot {
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
}

.badge-update {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-update .badge-dot {
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}

/* G-R-S Score Badge */
.grs-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(147, 51, 234, 0.15);
  border: 1px solid rgba(147, 51, 234, 0.35);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  vertical-align: middle;
}

.grs-badge.score-high {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.grs-badge.score-mid {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.grs-badge.score-base {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

.grs-scores {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.grs-divider {
  color: var(--text-dim);
}

.grs-total {
  font-size: 0.88rem;
  font-weight: 800;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.25rem 0;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

th {
  background: #1e293b;
  color: #f8fafc;
  padding: 0.75rem 1rem;
  font-weight: 700;
  border-bottom: 2px solid var(--border-subtle);
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: #cbd5e1;
  vertical-align: top;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Callouts */
.executive-callout {
  background: rgba(30, 41, 59, 0.6);
  border-left: 4px solid var(--accent-cyan);
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.executive-callout p:last-child {
  margin-bottom: 0;
}

/* Stats Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-window {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  width: 100%;
  max-width: 860px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8);
  padding: 2rem;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  font-size: 1.35rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.stat-card-val {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 0.25rem;
}

.stat-card-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Floating Actions */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent-cyan);
  color: #0a0e17;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
  transition: all 0.2s;
  opacity: 0;
  pointer-events: none;
  z-index: 90;
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .search-input {
    width: 100%;
  }
  .search-input:focus {
    width: 100%;
  }
  .subnav-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .report-content {
    padding: 1.25rem;
  }
}
