/* ===== Asialuxe Travel — Dashboard Styles (Light Theme) ===== */

:root {
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;
  --accent: #f97316;
  --accent-light: #fff7ed;
  --success: #22c55e;
  --success-light: #dcfce7;
  --warning: #eab308;
  --warning-light: #fefce8;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --purple: #8b5cf6;
  --purple-light: #f5f3ff;
  --cyan: #06b6d4;
  --cyan-light: #ecfeff;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #1e293b;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.06), 0 4px 6px rgba(0,0,0,.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --sidebar-w: 240px;
  --header-h: 64px;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Layout ===== */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .3s ease;
}

.sidebar-logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 8px;
}

.sidebar-logo h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-logo span {
  font-size: .75rem;
  color: rgba(255,255,255,.5);
  display: block;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  transition: all .15s ease;
  margin-bottom: 2px;
}

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

.sidebar-nav a.active {
  background: var(--primary);
  color: #fff;
}

.sidebar-nav a .nav-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .75rem;
  color: rgba(255,255,255,.4);
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

.header {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.header-meta {
  font-size: .82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-meta .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-weight: 600;
  font-size: .78rem;
}

.content {
  padding: 28px 32px;
  max-width: 1400px;
}

/* ===== Mobile hamburger ===== */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

/* ===== KPI Cards ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}

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

.kpi-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

.kpi-label {
  font-size: .82rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

.kpi-card.primary { border-left: 4px solid var(--primary); }
.kpi-card.accent { border-left: 4px solid var(--accent); }
.kpi-card.success { border-left: 4px solid var(--success); }
.kpi-card.purple { border-left: 4px solid var(--purple); }
.kpi-card.cyan { border-left: 4px solid var(--cyan); }
.kpi-card.warning { border-left: 4px solid var(--warning); }

/* ===== Cards & Sections ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

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

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

.card-subtitle {
  font-size: .82rem;
  color: var(--text-secondary);
}

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

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

/* ===== Charts ===== */
.chart-container {
  position: relative;
  width: 100%;
}

.chart-container-sm {
  max-height: 260px;
}

.chart-container-sm canvas {
  max-height: 260px;
}

/* ===== Progress Bars ===== */
.progress-bar-container {
  margin-bottom: 16px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.progress-label-text {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}

.progress-label-value {
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
}

.progress-bar {
  height: 10px;
  background: var(--border-light);
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width .8s ease;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.progress-bar-fill.success { background: linear-gradient(90deg, #22c55e, #16a34a); }
.progress-bar-fill.warning { background: linear-gradient(90deg, #eab308, #ca8a04); }
.progress-bar-fill.danger { background: linear-gradient(90deg, #ef4444, #dc2626); }
.progress-bar-fill.accent { background: linear-gradient(90deg, var(--accent), #ea580c); }
.progress-bar-fill.purple { background: linear-gradient(90deg, var(--purple), #7c3aed); }

/* ===== Tables ===== */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

thead th {
  background: var(--bg);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

tbody tr:hover {
  background: var(--border-light);
}

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

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 600;
  gap: 4px;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: #16a34a; }
.badge-warning { background: var(--warning-light); color: #a16207; }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-cyan { background: var(--cyan-light); color: #0891b2; }
.badge-gray { background: #f1f5f9; color: var(--text-secondary); }

/* ===== Status Dots ===== */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.active { background: var(--success); }
.status-dot.blocked { background: var(--danger); }
.status-dot.realtime { background: var(--warning); }

/* ===== Alert boxes ===== */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: .88rem;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.alert-danger {
  background: var(--danger-light);
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-warning {
  background: var(--warning-light);
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-info {
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.alert-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-content strong {
  display: block;
  margin-bottom: 2px;
}

/* ===== Task list ===== */
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  margin-bottom: 4px;
  font-size: .88rem;
  transition: background .15s;
}

.task-item:hover {
  background: var(--border-light);
}

.task-check {
  font-size: 1.1rem;
}

.task-text {
  flex: 1;
}

.task-project {
  font-size: .75rem;
  color: var(--text-light);
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 28px;
}

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

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.timeline-item.b2c::before { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }
.timeline-item.both::before { background: var(--purple); box-shadow: 0 0 0 2px var(--purple-light); }

.timeline-date {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.timeline-text {
  font-size: .88rem;
  color: var(--text);
}

/* ===== Gantt-like bars ===== */
.gantt-container {
  padding: 8px 0;
}

.gantt-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 12px;
}

.gantt-label {
  width: 120px;
  font-size: .82rem;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
  color: var(--text);
}

.gantt-track {
  flex: 1;
  height: 28px;
  background: var(--border-light);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.gantt-bar {
  position: absolute;
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 600;
  color: white;
  min-width: 16px;
  transition: width .6s ease;
}

.gantt-sessions {
  font-size: .75rem;
  color: var(--text-secondary);
  width: 60px;
  text-align: right;
  flex-shrink: 0;
}

/* ===== Donut center text ===== */
.donut-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.donut-center {
  position: absolute;
  text-align: center;
}

.donut-center .value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.donut-center .label {
  font-size: .72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== Section header ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.section-header .section-icon {
  font-size: 1.4rem;
}

/* ===== Description block ===== */
.desc-block {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.desc-block strong {
  color: var(--text);
}

/* ===== Tech stack pills ===== */
.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tech-pill {
  padding: 4px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
}

/* ===== Priority groups ===== */
.priority-group {
  margin-bottom: 20px;
}

.priority-group-title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
  padding-left: 4px;
}

.priority-group-title.critical { color: var(--danger); }
.priority-group-title.high { color: var(--accent); }
.priority-group-title.medium { color: var(--warning); }
.priority-group-title.low { color: var(--text-light); }

/* ===== Summary cards row ===== */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  text-align: center;
  padding: 24px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.summary-card .sc-icon { font-size: 2rem; margin-bottom: 8px; }
.summary-card .sc-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.summary-card .sc-label { font-size: .82rem; color: var(--text-secondary); margin-top: 4px; }
.summary-card.done { border-top: 4px solid var(--success); }
.summary-card.in-progress { border-top: 4px solid var(--warning); }
.summary-card.todo { border-top: 4px solid var(--text-light); }

/* ===== Timeline Hourly Grid ===== */
.tl-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: .82rem;
  color: var(--text-secondary);
}

.tl-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.tl-grid-header {
  display: grid;
  grid-template-columns: 70px repeat(24, 1fr) 120px;
  gap: 1px;
  margin-bottom: 2px;
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  background: var(--bg-card);
  padding: 4px 0;
}

.tl-hour-label {
  text-align: center;
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-light);
  padding: 2px 0;
}

.tl-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tl-row {
  display: grid;
  grid-template-columns: 70px repeat(24, 1fr) 120px;
  gap: 1px;
  align-items: center;
  min-height: 30px;
  border-radius: 4px;
  transition: background .15s;
}

.tl-row:hover {
  background: var(--border-light);
}

.tl-row-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  padding: 4px 8px 4px 0;
  text-align: right;
  line-height: 1.2;
}

.tl-weekday {
  font-size: .65rem;
  font-weight: 500;
  color: var(--text-light);
}

.tl-cell {
  height: 24px;
  border-radius: 2px;
  background: var(--border-light);
  transition: transform .15s;
}

.tl-cell.tl-active {
  opacity: 0.85;
  cursor: default;
}

.tl-cell.tl-active:hover {
  opacity: 1;
  transform: scaleY(1.3);
}

.tl-row-meta {
  font-size: .72rem;
  color: var(--text-secondary);
  padding-left: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ===== Checklist filter ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}

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

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 20px; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .summary-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    display: block;
  }

  .hamburger {
    display: block;
  }

  .main {
    margin-left: 0;
  }

  .content {
    padding: 16px;
  }

  .header {
    padding: 0 16px;
  }

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

  .kpi-value {
    font-size: 1.4rem;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }

  .gantt-label {
    width: 80px;
    font-size: .75rem;
  }

  .tl-grid-header,
  .tl-row {
    grid-template-columns: 55px repeat(24, 1fr) 80px;
  }

  .tl-row-label {
    font-size: .7rem;
    padding-right: 4px;
  }

  .tl-cell {
    height: 18px;
  }

  .tl-row-meta {
    font-size: .65rem;
    padding-left: 4px;
  }

  .tl-hour-label {
    font-size: .55rem;
  }
}

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

  .kpi-card {
    padding: 14px;
  }
}

/* ===== Print ===== */
@media print {
  .sidebar, .hamburger, .sidebar-overlay { display: none !important; }
  .main { margin-left: 0; }
  .header { position: static; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff; }
}

/* ===== Animation ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card, .kpi-card {
  animation: fadeIn .4s ease both;
}

.kpi-card:nth-child(2) { animation-delay: .05s; }
.kpi-card:nth-child(3) { animation-delay: .1s; }
.kpi-card:nth-child(4) { animation-delay: .15s; }
.kpi-card:nth-child(5) { animation-delay: .2s; }
.kpi-card:nth-child(6) { animation-delay: .25s; }
