/* Gelibolu Belediyesi CRM — Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --sidebar-w: 260px;
  --topbar-h: 64px;

  --color-primary: #0c4a6e;
  --color-primary-hover: #075985;
  --color-primary-light: #e0f2fe;
  --color-accent: #0891b2;
  --color-accent-soft: #cffafe;

  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: #0c4a6e;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #f8fafc;

  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --bg-app: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;

  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #0284c7;
  --info-bg: #f0f9ff;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg-app);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* —— App shell —— */
.app-body--auth {
  min-height: 100vh;
}

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

.app-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  transition: transform var(--transition);
}

.app-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  text-decoration: none;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-sidebar__logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  flex-shrink: 0;
}

.app-sidebar__title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.app-sidebar__subtitle {
  font-size: 0.7rem;
  color: var(--sidebar-text);
  font-weight: 500;
}

.app-sidebar__nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.app-sidebar__label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
  padding: 0.5rem 0.75rem 0.35rem;
}

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: background var(--transition), color var(--transition);
}

.app-sidebar__link i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
  opacity: 0.85;
}

.app-sidebar__link:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}

.app-sidebar__link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.app-sidebar__link.active i { opacity: 1; }

.app-sidebar__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  color: #64748b;
}

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

.app-topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: var(--shadow-sm);
}

.app-topbar__toggle {
  display: none;
  border: none;
  background: var(--bg-app);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.app-topbar__title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin: 0;
}

.app-topbar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-topbar__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent-soft));
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.app-topbar__name {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.2;
}

.app-topbar__role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.app-content {
  flex: 1;
  padding: 1.5rem;
}

.app-footer {
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-soft);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* —— Page header —— */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.page-header__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* —— Cards —— */
.gb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.gb-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.gb-card__header h2,
.gb-card__header h3,
.gb-card__header strong {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.gb-card__header i {
  color: var(--color-accent);
  margin-right: 0.35rem;
}

.gb-card__body {
  padding: 1.25rem;
}

/* —— Stat cards —— */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.stat-card__icon--blue { background: var(--info-bg); color: var(--info); }
.stat-card__icon--teal { background: var(--color-accent-soft); color: var(--color-accent); }
.stat-card__icon--amber { background: var(--warning-bg); color: var(--warning); }
.stat-card__icon--red { background: var(--danger-bg); color: var(--danger); }
.stat-card__icon--green { background: var(--success-bg); color: var(--success); }

.stat-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.stat-card__value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

.stat-card__value--danger { color: var(--danger); }

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

.table.gb-table {
  margin: 0;
  font-size: 0.875rem;
}

.table.gb-table thead th {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.85rem 1rem;
  white-space: nowrap;
}

.table.gb-table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-color: var(--border);
}

.table.gb-table tbody tr:hover {
  background: #f8fafc;
}

.call-number {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

/* —— Badges —— */
.gb-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.badge-priority-acil { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-priority-yuksek { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-priority-normal { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-priority-dusuk { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.badge-status-yeni { background: #f0f9ff; color: #0369a1; }
.badge-status-atandi { background: #eff6ff; color: #1d4ed8; }
.badge-status-sahada { background: #fffbeb; color: #b45309; }
.badge-status-islemde { background: #fef3c7; color: #92400e; }
.badge-status-beklemede { background: #f1f5f9; color: #475569; }
.badge-status-cozuldu { background: #ecfdf5; color: #047857; }
.badge-status-kapatildi { background: #f1f5f9; color: #334155; }
.badge-status-iptal { background: #fef2f2; color: #b91c1c; }

/* —— Forms & filters —— */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.form-control, .form-select {
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  padding: 0.5rem 0.85rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}

.form-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.btn {
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  transition: all var(--transition);
}

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

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

.btn-outline-primary {
  color: var(--color-primary);
  border-color: var(--border-strong);
}

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

.btn-success {
  background: var(--success);
  border-color: var(--success);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--bg-app);
  color: var(--text);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* —— Timeline —— */
.timeline {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border);
  margin-left: 0.5rem;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.25rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.65rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--color-accent-soft);
}

.timeline-item__title {
  font-weight: 600;
  font-size: 0.875rem;
}

.timeline-item__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* —— Media gallery —— */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.media-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fafbfc;
}

.media-card img,
.media-card video {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.media-card__caption {
  padding: 0.5rem 0.65rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.media-thumb { border-radius: var(--radius-sm); }

/* —— Detail hero —— */
.detail-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #164e63 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.detail-hero__code {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  opacity: 0.85;
  background: rgba(255,255,255,0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.detail-hero h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0.5rem 0 0.25rem;
  letter-spacing: -0.02em;
}

.detail-hero__meta {
  font-size: 0.85rem;
  opacity: 0.9;
}

.detail-hero .gb-badge {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* —— Sidebar panel (assign forms) —— */
.side-panel .gb-card + .gb-card {
  margin-top: 1rem;
}

.info-dl dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.info-dl dd {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

/* —— Alerts —— */
.alert {
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
}

.alert-success { background: var(--success-bg); color: #047857; }
.alert-danger { background: var(--danger-bg); color: #b91c1c; }

/* —— Login —— */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--sidebar-bg);
}

.login-page__visual {
  flex: 1;
  display: none;
  background: linear-gradient(160deg, #0c4a6e 0%, #0f172a 50%, #164e63 100%);
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.login-page__visual::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(8, 145, 178, 0.15);
  top: -100px;
  right: -100px;
}

.login-page__visual-content {
  position: relative;
  z-index: 1;
  max-width: 420px;
  color: #fff;
}

.login-page__visual h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.login-page__visual p {
  opacity: 0.85;
  font-size: 1rem;
  line-height: 1.6;
}

.login-page__form-side {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-app);
}

.login-card {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.login-card__brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-card__logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
}

.login-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.login-card__sub {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* —— Work plan cards —— */
.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}

.plan-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.plan-card__body { padding: 1.25rem; flex: 1; }

.plan-card__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

.plan-card .progress {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
}

.plan-card .progress-bar {
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
}

/* —— Empty state —— */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2.5rem;
  opacity: 0.4;
  margin-bottom: 1rem;
}

/* —— Mobile data cards (table alternative) —— */
.mobile-data-list {
  display: none;
  padding: 0.75rem;
  gap: 0.75rem;
  flex-direction: column;
}

.data-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: #fafbfc;
}

.data-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.data-card__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.data-card__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  font-size: 0.875rem;
}

.data-card__grid--3 { grid-template-columns: repeat(3, 1fr); }

.data-card__lbl {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.data-card__actions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.data-card__actions .btn {
  width: 100%;
  min-height: 44px;
}

/* —— Reports —— */
.filter-bar--report .filter-bar__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.report-kpi-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.report-kpi-strip__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.report-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.report-chart-card .chart-wrap {
  position: relative;
  height: 220px;
}

.report-chart-card .chart-wrap--donut {
  height: 200px;
  max-width: 280px;
  margin: 0 auto;
}

.stat-grid--report {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.report-perf .page-header--compact {
  margin-bottom: 1rem;
}

.report-perf-table-wrap {
  overflow-x: auto;
}

.report-perf-table th,
.report-perf-table td {
  white-space: nowrap;
  font-size: 0.8125rem;
}

.report-perf-tabs {
  border-bottom: 1px solid var(--border);
  gap: 0.25rem;
}

.report-perf-tabs .nav-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.5rem 1rem;
}

.report-perf-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
}

.report-perf-tabs-card .gb-card__header {
  padding-bottom: 0;
}

.data-card--compact {
  padding: 0.75rem 1rem;
}

/* —— Mobile —— */
@media (min-width: 992px) {
  .login-page__visual { display: flex; align-items: center; }
  .mobile-data-list { display: none !important; }
  .desktop-table { display: block; }
}

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

  .app-sidebar.is-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

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

  .app-topbar__toggle { display: flex; }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1035;
  }

  .sidebar-backdrop.is-visible { display: block; }

  .app-content {
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .app-topbar {
    padding: 0 1rem;
    padding-top: env(safe-area-inset-top);
    min-height: var(--topbar-h);
    height: auto;
  }

  .app-topbar__title {
    font-size: 0.9rem;
    max-width: 50vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-header__title { font-size: 1.25rem; }

  .page-header__actions {
    width: 100%;
  }

  .page-header__actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
    justify-content: center;
  }

  .filter-bar .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .filter-bar .btn {
    min-height: 44px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .stat-card__value { font-size: 1.5rem; }

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

  .report-chart-grid {
    grid-template-columns: 1fr;
  }

  .report-chart-card:first-child {
    grid-column: 1;
  }

  .report-chart-card .chart-wrap {
    height: 200px;
  }

  .gb-card__body { padding: 1rem; }

  .gb-table-wrap.desktop-table,
  .desktop-table { display: none !important; }

  .mobile-data-list { display: flex; }

  .detail-hero {
    padding: 1.25rem;
  }

  .detail-hero h1 { font-size: 1.15rem; }

  .side-panel { margin-top: 0; }

  .info-dl dt.col-sm-3,
  .info-dl dd.col-sm-9 {
    width: 100%;
  }

  .btn-sm {
    min-height: 40px;
    padding: 0.4rem 0.75rem;
  }

  .gb-card__header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media (max-width: 575.98px) {
  .stat-grid,
  .stat-grid--report {
    grid-template-columns: 1fr;
  }

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

@media print {
  .app-sidebar,
  .app-topbar,
  .sidebar-backdrop,
  .d-print-none,
  .app-footer { display: none !important; }

  .app-main { margin-left: 0 !important; }

  .app-content { padding: 0; }

  .gb-card { break-inside: avoid; box-shadow: none; }

  .report-chart-grid { grid-template-columns: 1fr 1fr; }

  .mobile-data-list { display: none !important; }

  .desktop-table { display: block !important; }
}

/* —— Work plans / Kanban —— */
.plan-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-grid--compact .stat-card--compact {
  padding: 0.85rem 1rem;
}

.stat-grid--compact .stat-card__value {
  font-size: 1.25rem;
}

.team-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.team-workload-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.team-workload-grid {
  display: flex;
  gap: 0.75rem;
  min-width: min-content;
}

.team-workload-item {
  flex: 0 0 auto;
  min-width: 140px;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.kanban-col {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 120px;
  min-width: 220px;
}

.kanban-col__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.kanban-col--progress .kanban-col__header { border-top: 3px solid var(--info); }
.kanban-col--wait .kanban-col__header { border-top: 3px solid var(--text-soft); }
.kanban-col--blocked .kanban-col__header { border-top: 3px solid var(--danger); }
.kanban-col--done .kanban-col__header { border-top: 3px solid var(--success); }

.kanban-col__body {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.kanban-card--overdue {
  border-color: #fecaca;
  background: #fffbfb;
}

.kanban-card__head {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  align-items: flex-start;
  margin-bottom: 0.35rem;
}

.kanban-card__title {
  font-size: 0.85rem;
  line-height: 1.3;
}

.kanban-card__overdue {
  font-size: 0.7rem;
  color: var(--danger);
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

.kanban-card__meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-bottom: 0.35rem;
}

.kanban-card__progress {
  height: 4px;
  margin-bottom: 0.35rem;
}

.kanban-card__details summary {
  cursor: pointer;
  list-style: none;
}

.kanban-card__details summary::-webkit-details-marker { display: none; }

.task-comments {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.75rem;
}

.task-comments li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.task-comments__author {
  font-weight: 600;
  color: var(--color-primary);
}

.task-comments__time {
  color: var(--text-soft);
  font-size: 0.65rem;
}

@media (max-width: 991.98px) {
  .kanban-board {
    grid-template-columns: repeat(4, minmax(260px, 85vw));
  }

  .kanban-col {
    min-width: 260px;
  }

  .side-panel {
    order: -1;
  }
}

/* Bootstrap overrides */
.navbar { display: none; }
.card { border-color: var(--border); border-radius: var(--radius); }
.list-group-item { border-color: var(--border); }
