/* ZainoToolbox Global Styles */
:root {
  --navy: #1a2332;
  --navy-light: #243044;
  --navy-dark: #111827;
  --gold: #d4a843;
  --gold-light: #e8c56d;
  --gold-dark: #b8922e;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --red: #ef4444;
  --red-light: #fef2f2;
  --green: #22c55e;
  --green-light: #f0fdf4;
  --yellow: #eab308;
  --yellow-light: #fefce8;
  --blue: #3b82f6;
  --blue-light: #eff6ff;
  --pink: #ec4899;
  --pink-light: #fdf2f8;
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --transition: 0.2s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--navy);
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: var(--white);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand .logo {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--navy);
}

.sidebar-brand h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-brand span {
  font-size: 11px;
  color: var(--gray-400);
  display: block;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--gray-300);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.06);
  color: var(--white);
}

.sidebar-nav a.active {
  background: rgba(212,168,67,0.15);
  color: var(--gold);
}

.sidebar-nav a .icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar-nav .section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-500);
  padding: 16px 14px 6px;
  font-weight: 600;
}

/* Main Content */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}

.topbar .breadcrumb {
  font-size: 13px;
  color: var(--gray-400);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--navy);
  padding: 4px;
}

/* Content Area */
.content {
  padding: 28px 32px;
  flex: 1;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  padding: 24px;
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

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

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-600);
}

/* Summary Cards */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.summary-card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}

.summary-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.summary-card .sc-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.summary-card .sc-data h4 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--navy);
}

.summary-card .sc-data p {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* Stat colors */
.bg-blue { background: var(--blue-light); color: var(--blue); }
.bg-red { background: var(--red-light); color: var(--red); }
.bg-green { background: var(--green-light); color: var(--green); }
.bg-gold { background: #fef9ee; color: var(--gold-dark); }
.bg-yellow { background: var(--yellow-light); color: #b45309; }
.bg-pink { background: var(--pink-light); color: var(--pink); }

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

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

thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

tbody tr:hover {
  background: var(--gray-50);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-red { background: var(--red-light); color: var(--red); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-yellow { background: var(--yellow-light); color: #b45309; }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }
.badge-gold { background: #fef9ee; color: var(--gold-dark); }
.badge-pink { background: var(--pink-light); color: var(--pink); }

/* Filters */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filters input,
.filters select {
  padding: 8px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  background: var(--white);
  color: var(--navy);
  outline: none;
  transition: border-color var(--transition);
}

.filters input:focus,
.filters select:focus {
  border-color: var(--gold);
}

.filters input {
  min-width: 240px;
}

/* Kanban */
.kanban {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.kanban-col {
  min-width: 280px;
  flex: 1;
  background: var(--gray-100);
  border-radius: 12px;
  padding: 16px;
}

.kanban-col h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-col h3 .count {
  background: var(--gray-300);
  color: var(--gray-600);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.kanban-card {
  background: var(--white);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: all var(--transition);
}

.kanban-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.kanban-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.kanban-card p {
  font-size: 12px;
  color: var(--gray-500);
}

/* Health indicators */
.health-green { color: var(--green); }
.health-yellow { color: var(--yellow); }
.health-red { color: var(--red); }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.dot-green { background: var(--green); }
.dot-yellow { background: var(--yellow); }
.dot-red { background: var(--red); }
.dot-gray { background: var(--gray-400); }

/* Buttons */
.btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold-light); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--red); color: var(--white); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 15px; }

/* Schedule items */
.schedule-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-left: 3px solid var(--gold);
  background: var(--white);
  border-radius: 0 8px 8px 0;
  margin-bottom: 12px;
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--gold);
}

.schedule-item .time {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-dark);
  min-width: 80px;
}

.schedule-item .details h4 { font-size: 14px; font-weight: 600; }
.schedule-item .details p { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

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

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .main {
    margin-left: 0;
  }
  .hamburger {
    display: block;
  }
  .content {
    padding: 20px 16px;
  }
  .topbar {
    padding: 0 16px;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .kanban {
    flex-direction: column;
  }
  .kanban-col {
    min-width: 100%;
  }
  .filters input {
    min-width: 100%;
  }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(0.95) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.modal-field { margin-bottom: 14px; }
.modal-field label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 4px; }
.modal-field input, .modal-field select, .modal-field textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.modal-field textarea { min-height: 70px; resize: vertical; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; }
.btn-edit { background: var(--blue-light); color: var(--blue); }
.btn-delete { background: var(--red-light); color: var(--red); }
.btn-delete:hover { background: var(--red); color: white; }
.action-cell { white-space: nowrap; }
.action-cell button { margin-right: 4px; }

/* Add button in topbar/filters area */
.btn-add {
  padding: 10px 20px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-add:hover { background: var(--gold-light); transform: translateY(-1px); }

/* Search highlight */
.highlight {
  background: rgba(212,168,67,0.2);
  padding: 1px 3px;
  border-radius: 3px;
}

/* Pink theme override for family */
body.theme-pink {
  --gold: #ec4899;
  --gold-light: #f472b6;
  --gold-dark: #db2777;
}
body.theme-pink .sidebar { background: #1f1225; }
body.theme-pink .sidebar-nav a.active { background: rgba(236,72,153,0.15); color: var(--pink); }
body.theme-pink .sidebar-brand .logo { background: var(--pink); }
