/* ===========================
   AI TossUp Matching System
   Common Styles
   =========================== */

:root {
  --primary: #1a3a6c;
  --primary-light: #2557a7;
  --primary-dark: #0f2548;
  --secondary: #3b82f6;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --bg-main: #f0f4f8;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --sidebar-width: 240px;
  --header-height: 64px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
}

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

html {
  font-size: 14px;
}

body {
  font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===========================
   LAYOUT
   =========================== */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ===========================
   SIDEBAR
   =========================== */

.sidebar {
  width: var(--sidebar-width);
  background: var(--primary);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.logo-sub {
  font-size: 9px;
  font-weight: 400;
  opacity: 0.7;
  display: block;
  margin-top: 2px;
}

.sidebar-section {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-section-label {
  padding: 4px 16px 8px;
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
}

.nav-item a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.nav-item a.active {
  background: rgba(59,130,246,0.3);
  color: #fff;
  border-left: 3px solid var(--secondary);
}

.nav-item a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--secondary);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.8);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
}

.user-role {
  font-size: 10px;
  opacity: 0.6;
}

/* ===========================
   MAIN CONTENT
   =========================== */

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===========================
   HEADER
   =========================== */

.header {
  height: var(--header-height);
  background: var(--bg-white);
  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;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  transition: var(--transition);
  position: relative;
}

.header-btn:hover {
  background: var(--bg-main);
  border-color: var(--primary-light);
  color: var(--primary);
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
  border: 2px solid #fff;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.breadcrumb span:last-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* ===========================
   PAGE CONTENT
   =========================== */

.page-content {
  padding: 24px;
  flex: 1;
}

/* ===========================
   CARDS
   =========================== */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon {
  font-size: 15px;
}

.card-body {
  padding: 20px;
}

/* ===========================
   KPI CARDS
   =========================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-card.blue::before { background: var(--secondary); }
.kpi-card.green::before { background: var(--accent-green); }
.kpi-card.orange::before { background: var(--accent-orange); }
.kpi-card.red::before { background: var(--accent-red); }
.kpi-card.navy::before { background: var(--primary); }
.kpi-card.purple::before { background: #8b5cf6; }

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.kpi-value .unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.kpi-change {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-change.up { color: var(--accent-green); }
.kpi-change.down { color: var(--accent-red); }
.kpi-change.neutral { color: var(--text-muted); }

.kpi-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.kpi-icon.blue { background: rgba(59,130,246,0.1); }
.kpi-icon.green { background: rgba(16,185,129,0.1); }
.kpi-icon.orange { background: rgba(245,158,11,0.1); }
.kpi-icon.red { background: rgba(239,68,68,0.1); }
.kpi-icon.navy { background: rgba(26,58,108,0.1); }
.kpi-icon.purple { background: rgba(139,92,246,0.1); }

/* ===========================
   TABLES
   =========================== */

.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background: var(--bg-main);
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: #f8faff;
}

tbody td {
  padding: 11px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

.company-name {
  font-weight: 600;
  color: var(--primary-light);
  cursor: pointer;
}

.company-name:hover {
  text-decoration: underline;
}

/* ===========================
   BADGES / TAGS
   =========================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue { background: rgba(59,130,246,0.1); color: #2557a7; }
.badge-green { background: rgba(16,185,129,0.1); color: #059669; }
.badge-orange { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-red { background: rgba(239,68,68,0.1); color: #dc2626; }
.badge-purple { background: rgba(139,92,246,0.1); color: #7c3aed; }
.badge-gray { background: rgba(100,116,139,0.1); color: #475569; }
.badge-navy { background: rgba(26,58,108,0.1); color: #1a3a6c; }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-green { background: var(--accent-green); }
.dot-orange { background: var(--accent-orange); }
.dot-red { background: var(--accent-red); }
.dot-gray { background: var(--text-muted); }
.dot-blue { background: var(--secondary); }

/* ===========================
   BUTTONS
   =========================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-light);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-main);
  border-color: var(--primary-light);
}

.btn-success {
  background: var(--accent-green);
  color: #fff;
}

.btn-success:hover {
  background: #059669;
}

.btn-warning {
  background: var(--accent-orange);
  color: #fff;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-danger {
  background: var(--accent-red);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

.btn-icon {
  padding: 6px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--primary-light);
  color: #fff;
  border-color: var(--primary-light);
}

/* ===========================
   SEARCH / FILTER BAR
   =========================== */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 380px;
}

.search-box input {
  width: 100%;
  padding: 9px 36px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-white);
  color: var(--text-primary);
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.filter-select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-white);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  min-width: 130px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--secondary);
}

.filter-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ===========================
   SCORE BARS
   =========================== */

.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.score-label {
  font-size: 12px;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}

.score-high .score-bar-fill { background: var(--accent-green); }
.score-high .score-label { color: var(--accent-green); }
.score-med .score-bar-fill { background: var(--accent-orange); }
.score-med .score-label { color: var(--accent-orange); }
.score-low .score-bar-fill { background: var(--accent-red); }
.score-low .score-label { color: var(--accent-red); }

/* ===========================
   TABS
   =========================== */

.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 0;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary-light);
}

/* ===========================
   MODALS
   =========================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-white);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: var(--bg-main);
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--border);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

/* ===========================
   FORMS
   =========================== */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-white);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ===========================
   SECTION HEADERS
   =========================== */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===========================
   AI MATCH CARDS
   =========================== */

.match-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
  background: var(--bg-white);
  transition: var(--transition);
  position: relative;
}

.match-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #c7d8ff;
}

.match-card.top-match {
  border-color: var(--accent-green);
  background: linear-gradient(to right, rgba(16,185,129,0.02), #fff);
}

.match-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.match-rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.match-rank.rank-1 { background: linear-gradient(135deg, #f59e0b, #f97316); }
.match-rank.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); }
.match-rank.rank-3 { background: linear-gradient(135deg, #b45309, #92400e); }

.match-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.match-service {
  font-size: 11px;
  color: var(--text-muted);
}

.match-score-badge {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.match-score-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.score-excellent { color: var(--accent-green); }
.score-good { color: var(--secondary); }
.score-fair { color: var(--accent-orange); }

.match-score-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.match-reason {
  background: rgba(59,130,246,0.04);
  border-left: 3px solid var(--secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.match-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.match-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===========================
   ACTIVITY TIMELINE
   =========================== */

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-dot {
  position: absolute;
  left: -23px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg-white);
  box-shadow: 0 0 0 2px var(--border);
}

.timeline-dot.green { background: var(--accent-green); box-shadow: 0 0 0 2px rgba(16,185,129,0.3); }
.timeline-dot.blue { background: var(--secondary); box-shadow: 0 0 0 2px rgba(59,130,246,0.3); }
.timeline-dot.orange { background: var(--accent-orange); box-shadow: 0 0 0 2px rgba(245,158,11,0.3); }
.timeline-dot.gray { background: var(--text-muted); }

.timeline-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 3px;
}

.timeline-text {
  font-size: 13px;
  color: var(--text-primary);
}

/* ===========================
   PROGRESS RINGS / CHARTS
   =========================== */

.mini-chart-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ===========================
   ALERT BOXES
   =========================== */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.alert-warning {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.3);
  color: #92400e;
}

.alert-info {
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.25);
  color: #1e40af;
}

.alert-success {
  background: rgba(16,185,129,0.07);
  border: 1px solid rgba(16,185,129,0.25);
  color: #065f46;
}

.alert-danger {
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.25);
  color: #991b1b;
}

/* ===========================
   DETAIL SECTIONS
   =========================== */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.detail-item label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.detail-item span {
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ===========================
   EMPTY STATES
   =========================== */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 13px;
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 240px;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    --sidebar-width: 240px;
  }

  .main-content {
    margin-left: 0;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: 100%;
  }

  .menu-toggle {
    display: flex !important;
  }

  .page-content {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-value {
    font-size: 22px;
  }
}

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-white);
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
}

/* ===========================
   TOOLTIP
   =========================== */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 300;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ===========================
   SCROLLBAR
   =========================== */

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===========================
   AI BADGE
   =========================== */

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: linear-gradient(135deg, #1a3a6c, #3b82f6);
  color: #fff;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ===========================
   PAGE INTRO BANNER
   =========================== */

.page-intro {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-md);
  padding: 20px 24px;
  color: #fff;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.page-intro::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.page-intro .intro-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.page-intro h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-intro p {
  font-size: 12px;
  opacity: 0.8;
}

/* ===========================
   ACTIVE STATUS INDICATOR
   =========================== */

.active-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

/* ===========================
   GRID LAYOUTS
   =========================== */

.content-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.content-grid-3-1 {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .content-grid-2,
  .content-grid-3-1 {
    grid-template-columns: 1fr;
  }
}
