:root {
  --bg: #eef1f6;
  --card: #ffffff;
  --primary: #0f172a;
  --sidebar: #0b1220;
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --border: #d8dee9;
  --text: #0f172a;
  --muted: #64748b;
  --success: #059669;
  --warning: #d97706;
  --info: #0284c7;
}

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; background: var(--sidebar); color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { padding: 1.25rem; display: flex; gap: 0.75rem; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand img { height: 36px; }
.sidebar-brand strong { display: block; font-size: 0.95rem; }
.sidebar-brand small { display: block; font-size: 0.68rem; opacity: 0.65; line-height: 1.3; margin-top: 0.15rem; }
.sidebar-nav { flex: 1; padding: 0.75rem 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 1.1rem;
  color: rgba(255,255,255,0.78); text-decoration: none; font-size: 0.86rem; transition: background 0.15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.active { background: var(--accent); color: #fff; }
.nav-icon { width: 1.2rem; text-align: center; font-size: 0.95rem; }
.nav-section {
  padding: 0.85rem 1.1rem 0.25rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.45);
  font-weight: 600;
}
.help-box {
  background: #eaf4fb;
  border: 1px solid #bee3f8;
  color: #1a5276;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.55;
}
.help-box em { font-style: normal; font-weight: 600; }
.stat-hint { font-size: 0.68rem; color: var(--muted); margin-top: 0.15rem; }
.stat-card .stat-hint { color: rgba(127,140,141,0.95); }
.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-footer a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.85rem; }
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border); padding: 0.85rem 1.5rem;
  display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 10;
}
.topbar-title h1 { font-size: 1.15rem; color: var(--primary); }
.topbar-title p { font-size: 0.8rem; color: var(--muted); }
.sidebar-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 6px; padding: 0.4rem 0.65rem; font-size: 1.1rem; cursor: pointer; }
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-success { background: #d5f5e3; color: #1e8449; border: 1px solid #a9dfbf; }
.alert-error { background: #fadbd8; color: #922b21; border: 1px solid #f5b7b1; }
.page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.page-header h2 { font-size: 1.1rem; color: var(--primary); }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--accent); }
.text-muted { color: var(--muted); font-size: 0.85rem; }
.bakiye-pozitif { color: var(--success); font-weight: 600; }
.bakiye-negatif { color: var(--accent); font-weight: 600; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.report-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; }
.report-card h3 { font-size: 0.95rem; margin-bottom: 0.75rem; color: var(--primary); }
.report-card a { display: block; padding: 0.4rem 0; color: var(--primary); text-decoration: none; font-size: 0.88rem; }
.report-card a:hover { color: var(--accent); }
.dashboard-tasks { margin-bottom: 1rem; }
.dashboard-tasks .page-header, .card > .page-header { margin-bottom: .75rem; }
.task-list { display: grid; gap: .45rem; }
.task-list-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.task-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem; border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none; background: #fafbfd; }
.task-row:hover { border-color: var(--info); background: #f4f9fd; }
.task-row > a { color: var(--text); text-decoration: none; flex: 1; }
.task-row span { min-width: 0; }
.task-row strong, .task-row small { display: block; }
.task-row small { color: var(--muted); margin-top: .2rem; font-size: .76rem; }
.task-action { display: flex; align-items: center; gap: .65rem; flex-shrink: 0; }
.empty-state { padding: 1.2rem; text-align: center; color: var(--muted); background: #fafbfd; border: 1px dashed var(--border); border-radius: 8px; }
.stat-card.accent .num { color: var(--accent); }
.stat-card.success .num { color: var(--success); }
.stat-card.info .num { color: var(--info); }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.header {
  background: var(--primary);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header img { height: 40px; }
.header h1 { font-size: 1.25rem; font-weight: 600; }
.header p { font-size: 0.85rem; opacity: 0.8; }

.nav {
  display: flex;
  gap: 0.5rem;
}

.nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.2s;
}

.nav a:hover { background: rgba(255,255,255,0.12); color: white; }
.nav a.active { background: var(--accent); color: white; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  width: 100%;
}

.container.narrow { max-width: 960px; }

.card {
  background: var(--card);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}

.card h2 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: #ecf0f1; color: var(--primary); }
.btn-secondary:hover { background: #d5dbdb; }
.btn-danger { background: #fdecea; color: var(--accent); }
.btn-danger:hover { background: #fadbd8; }
.btn-whatsapp { background: #25d366; color: white; }
.btn-whatsapp:hover { background: #1da851; color: white; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 100;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--accent); }
.toast.success { background: var(--success); }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}

.stat-card .num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .lbl {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

.filters input, .filters select {
  width: auto;
  min-width: 180px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  background: #e8ecf0;
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover { background: #fafbfc; }

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}
.badge-sm {
  padding: 0.15rem 0.45rem;
  font-size: 0.68rem;
  border-radius: 12px;
  white-space: nowrap;
}
.stat-card.filter-stat {
  cursor: pointer;
  border: 2px solid transparent;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.stat-card.filter-stat:hover {
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.stat-card.filter-stat.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(192,57,43,0.12);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.actions-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.status-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 280px;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.status-btn {
  padding: 0.25rem 0.55rem;
  border: 1.5px solid var(--btn-color, #999);
  background: white;
  color: var(--btn-color, #999);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.status-btn:hover {
  background: var(--btn-color, #999);
  color: white;
}

.status-btn.active {
  background: var(--btn-color, #999);
  color: white;
}

.status-btn-del {
  --btn-color: #c0392b;
  border-color: #c0392b;
  color: #c0392b;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.items-table th {
  background: #e8ecf0;
  padding: 0.6rem 0.5rem;
  font-size: 0.78rem;
  text-align: left;
  border: 1px solid var(--border);
}

.items-table td {
  padding: 0.35rem;
  border: 1px solid var(--border);
}

.items-table input {
  border: none;
  padding: 0.4rem;
  background: transparent;
}

.col-miktar { width: 80px; }
.col-birim { width: 110px; }
.col-tutar { width: 110px; text-align: right; font-weight: 600; }
.col-kdv { width: 60px; }
.col-action { width: 40px; text-align: center; }

.totals {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.totals-box { width: 280px; }

.totals-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.totals-row.total {
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: none;
  padding-top: 0.6rem;
  color: var(--accent);
}

.actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.loading {
  pointer-events: none;
  opacity: 0.6;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.25s;
}

body.sidebar-open {
  overflow: hidden;
}

body.sidebar-open .sidebar-overlay {
  display: block;
  opacity: 1;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 768px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }

  .app-shell {
    display: block;
    width: 100%;
    max-width: 100vw;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: min(280px, 88vw);
    height: 100vh;
    height: 100dvh;
    z-index: 100;
    transition: left 0.25s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    flex-shrink: unset;
  }
  .sidebar.open { left: 0; }

  .main-area {
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
  }
  .topbar { padding: 0.65rem 1rem; gap: 0.65rem; }
  .topbar-title { min-width: 0; flex: 1; }
  .topbar-title h1 { font-size: 1rem; line-height: 1.3; word-break: break-word; }
  .topbar-title p { font-size: 0.75rem; }
  .container {
    padding: 1rem 0.85rem 2.5rem;
    max-width: 100%;
    overflow-x: hidden;
  }
  .card {
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .page-header .btn { width: 100%; justify-content: center; min-height: 44px; }
  .page-header .actions-row { margin-top: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .stat-card { padding: 0.75rem 0.5rem; }
  .stat-card .num { font-size: 1.15rem; word-break: break-word; }
  .stat-card .lbl { font-size: 0.7rem; line-height: 1.25; }
  .help-box { font-size: 0.84rem; padding: 0.75rem; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters input, .filters select, .filters .btn { width: 100%; min-width: unset; }
  .actions, .actions-row {
    flex-direction: column;
    align-items: stretch;
  }
  .actions .btn,
  .actions-row .btn,
  .actions-row form,
  .actions-row form .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  .actions-row form { display: block !important; }
  .totals { justify-content: stretch; }
  .totals-box { width: 100%; max-width: none; }
  .status-row { min-width: unset !important; width: 100%; }
  .status-actions { gap: 0.4rem; }
  .status-btn { min-height: 36px; padding: 0.35rem 0.65rem; }
  .toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    text-align: center;
  }
  .report-grid { grid-template-columns: 1fr; }
  .table-scroll { margin: 0; padding: 0; overflow-x: visible; }

  /* Tüm tablolar mobilde kart görünümü */
  .data-table { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table tbody { display: block; }
  .data-table tbody tr {
    display: block;
    margin-bottom: 0.85rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fafbfc;
  }
  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border: none;
    text-align: right;
    word-break: break-word;
  }
  .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    flex-shrink: 0;
    text-align: left;
    max-width: 42%;
  }
  .data-table td:not([data-label])::before,
  .data-table td[data-label=""]::before {
    content: none;
    display: none;
  }
  .data-table td.no-label::before { display: none; }
  .data-table td.no-label {
    justify-content: center;
    padding-top: 0.65rem;
    border-top: 1px dashed var(--border);
    margin-top: 0.35rem;
  }
  .data-table td.cell-status {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .data-table td.cell-status::before { margin-bottom: 0.35rem; }
  .data-table td.cell-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .data-table td.cell-actions .btn { width: 100%; margin-top: 0.35rem; }
  .data-table td form { width: 100%; }
  .data-table td form .btn { width: 100%; }

  .items-table { display: block; width: 100%; }
  .items-table thead { display: none; }
  .items-table tbody { display: block; }
  .items-table tbody tr {
    display: block;
    margin-bottom: 0.85rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafbfc;
  }
  .items-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border: none;
  }
  .items-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    flex-shrink: 0;
  }
  .items-table td.no-label::before { display: none; }
  .items-table td.no-label {
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
  }
  /* Satır sil (×) butonu — dokunmatik için büyüt */
  .items-table td .btn-danger {
    min-width: 44px;
    min-height: 40px;
    justify-content: center;
    font-size: 1.1rem;
  }
  .items-table .tutar-cell,
  .items-table .col-tutar { white-space: nowrap; }
  /* + Satır Ekle butonları tam genişlik */
  .card > .btn-secondary { width: 100%; justify-content: center; min-height: 44px; }
  .items-table td input,
  .items-table td select {
    flex: 1;
    min-width: 0;
    text-align: right;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    padding: 0.45rem;
  }
  .items-table .col-tutar { text-align: right; font-weight: 600; }
  #itemsTable .item-row td:nth-child(1)::before { content: "Ürün"; }
  #itemsTable .item-row td:nth-child(2)::before { content: "Açıklama"; }
  #itemsTable .item-row td:nth-child(3)::before { content: "Miktar"; }
  #itemsTable .item-row td:nth-child(4)::before { content: "Birim"; }
  #itemsTable .item-row td:nth-child(5)::before { content: "Birim Fiyat"; }
  #itemsTable .item-row td:nth-child(6)::before { content: "KDV"; }

  input, select, textarea { font-size: 16px; max-width: 100%; }
  img { max-width: 100%; height: auto; }
}

@media (max-width: 400px) {
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .stat-card .num { font-size: 1rem; }
}

/* Premium arayüz — 2026 */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --primary: #172554;
  --sidebar: #0b1533;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --border: #e4e8f1;
  --text: #1e293b;
  --muted: #64748b;
  --success: #059669;
  --warning: #d97706;
  --info: #2563eb;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 2px 8px rgba(15,23,42,.035);
  --shadow-md: 0 12px 32px rgba(15,23,42,.075);
  --radius: 16px;
}

html { background: var(--bg); }
body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 85% -10%, rgba(99,102,241,.08), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  letter-spacing: -.005em;
}

.sidebar {
  width: 274px;
  background: linear-gradient(180deg, #101d43 0%, #0a122b 60%, #080f24 100%);
  border-right: 1px solid rgba(255,255,255,.05);
  box-shadow: 10px 0 40px rgba(15,23,42,.08);
}
.sidebar-brand { min-height: 92px; padding: 1.25rem 1.2rem; gap: .75rem; }
.sidebar-brand img { display:block; width:84px; max-width:84px; height:42px; object-fit:contain; flex:0 0 84px; }
.sidebar-brand > div { min-width:0; overflow:hidden; }
.sidebar-brand strong, .sidebar-brand small { overflow:hidden; text-overflow:ellipsis; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  flex: 0 0 42px; color: #fff; font-size: .78rem; font-weight: 800; letter-spacing: .04em;
  background: linear-gradient(145deg,#7771ff,#4f46e5); box-shadow: 0 8px 24px rgba(79,70,229,.38), inset 0 1px rgba(255,255,255,.3);
}
.brand-kicker { display:block; color:#8fa2cd; font-size:.56rem; font-weight:700; letter-spacing:.13em; margin-bottom:.18rem; }
.sidebar-brand strong { font-size: .98rem; letter-spacing: -.01em; color: #f8fafc; }
.sidebar-brand small { color:#94a3c7; opacity:1; }
.sidebar-nav { padding: .7rem .75rem 1.2rem; }
.nav-section { padding: 1.05rem .75rem .35rem; color:#6f83ad; font-size:.61rem; letter-spacing:.13em; }
.sidebar-nav a {
  position: relative; min-height: 42px; padding: .62rem .75rem; margin: .16rem 0; border-radius: 10px;
  color:#b8c4df; font-size:.835rem; font-weight:500; transition: background .18s,color .18s,transform .18s;
}
.sidebar-nav a:hover { background:rgba(255,255,255,.065); color:#fff; transform:translateX(2px); }
.sidebar-nav a.active { background:linear-gradient(100deg,rgba(99,102,241,.95),rgba(79,70,229,.78)); box-shadow:0 7px 18px rgba(49,46,129,.28); color:#fff; }
.sidebar-nav a.active::after { content:""; position:absolute; right:-.75rem; width:3px; height:20px; border-radius:3px 0 0 3px; background:#a5b4fc; }
.nav-icon { width:1.35rem; font-size:1rem; filter:saturate(.8); }
.sidebar-footer { margin:.5rem .75rem .75rem; border:1px solid rgba(255,255,255,.07); border-radius:10px; padding:.7rem .85rem; }
.sidebar-footer a { display:block; color:#aab8d5; }

.topbar {
  min-height: 74px; padding: .85rem 2rem; background:rgba(255,255,255,.88); border-color:rgba(226,232,240,.9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar-title h1 { color:#111c3d; font-size:1.22rem; font-weight:750; letter-spacing:-.025em; }
.topbar-title p { color:#7a879d; margin-top:.12rem; }
.topbar-meta { margin-left:auto; display:flex; align-items:center; gap:.75rem; }
.topbar-date { color:#7a879d; font-size:.75rem; font-weight:600; padding:.42rem .7rem; border:1px solid var(--border); border-radius:9px; background:#fff; }
.user-chip { width:34px; height:34px; display:grid; place-items:center; color:#fff; border-radius:11px; font-size:.78rem; font-weight:750; background:linear-gradient(145deg,#334155,#172554); box-shadow:0 5px 12px rgba(23,37,84,.18); }
.container { max-width: 1380px; padding: 1.7rem 2rem 3.5rem; }
.container.narrow { max-width: 1040px; }

.card, .report-card {
  border:1px solid rgba(226,232,240,.92); border-radius:var(--radius); box-shadow:var(--shadow-sm);
  padding:1.35rem; background:rgba(255,255,255,.96); transition:box-shadow .2s,border-color .2s;
}
.card:hover { border-color:#dbe1ec; box-shadow:0 5px 18px rgba(15,23,42,.055); }
.card h2 { color:#172554; font-size:.93rem; font-weight:750; border:0; padding:0 0 .75rem; margin-bottom:1rem; display:block; position:relative; }
.card h2::after { content:""; position:absolute; left:0; bottom:0; width:34px; height:3px; border-radius:4px; background:linear-gradient(90deg,#4f46e5,#818cf8); }
.page-header h2 { color:#172554; font-size:1.05rem; font-weight:750; letter-spacing:-.02em; }

.help-box { background:linear-gradient(100deg,#eff6ff,#f5f7ff); border:1px solid #d8e5fa; color:#34506f; border-radius:13px; padding:.9rem 1.05rem; box-shadow:0 1px 2px rgba(37,99,235,.025); }
.alert { border-radius:12px; padding:.85rem 1rem; box-shadow:var(--shadow-sm); }
.alert-success { background:#ecfdf5; border-color:#a7f3d0; color:#047857; }
.alert-error { background:#fef2f2; border-color:#fecaca; color:#b91c1c; }

.stat-cards { gap:.85rem; }
.stat-card {
  position:relative; overflow:hidden; text-align:left; min-height:112px; padding:1rem 1.05rem;
  border:1px solid rgba(226,232,240,.95); border-radius:14px; box-shadow:var(--shadow-sm); background:linear-gradient(145deg,#fff,#fbfcff);
}
.stat-card::before { content:""; position:absolute; width:72px; height:72px; right:-24px; top:-25px; border-radius:50%; background:rgba(79,70,229,.065); }
.stat-card .num { color:#172554; font-size:1.34rem; font-weight:780; letter-spacing:-.035em; position:relative; }
.stat-card .lbl { color:#475569; font-size:.76rem; font-weight:650; margin-top:.3rem; }
.stat-card .stat-hint { color:#94a3b8; }
.stat-card.success { border-top:3px solid #10b981; }
.stat-card.accent { border-top:3px solid #ef4444; }
.stat-card.info { border-top:3px solid #3b82f6; }
.stat-card.filter-stat:hover { border-color:#c7d2fe; box-shadow:0 10px 24px rgba(79,70,229,.1); transform:translateY(-2px); }
.stat-card.filter-stat.active { border-color:#6366f1; box-shadow:0 0 0 3px rgba(99,102,241,.1); }

label { color:#64748b; font-size:.75rem; font-weight:650; margin-bottom:.38rem; }
input, select, textarea {
  min-height:42px; padding:.62rem .78rem; color:#1e293b; background:#fff; border:1px solid #dbe2ec; border-radius:10px;
  font-size:.86rem; transition:border-color .15s,box-shadow .15s,background .15s;
}
textarea { min-height:88px; resize:vertical; }
input:hover, select:hover, textarea:hover { border-color:#c4ccda; }
input:focus, select:focus, textarea:focus { border-color:#6366f1; background:#fff; box-shadow:0 0 0 4px rgba(99,102,241,.1); }

.btn { min-height:38px; padding:.58rem .95rem; border-radius:9px; font-size:.8rem; font-weight:700; justify-content:center; box-shadow:none; }
.btn:hover { transform:translateY(-1px); }
.btn-primary { background:linear-gradient(135deg,#5b55e7,#4338ca); color:#fff; box-shadow:0 6px 14px rgba(79,70,229,.18); }
.btn-primary:hover { background:linear-gradient(135deg,#4f46e5,#3730a3); box-shadow:0 8px 18px rgba(79,70,229,.24); }
.btn-secondary { background:#f1f4f8; color:#334155; border:1px solid #e2e8f0; }
.btn-secondary:hover { background:#e8edf4; color:#172554; }
.btn-danger { background:#fff1f2; color:#dc2626; border:1px solid #ffe0e3; }
.btn-danger:hover { background:#fee2e2; }
.btn-sm { min-height:32px; padding:.4rem .68rem; border-radius:8px; font-size:.74rem; }

.data-table { border-collapse:separate; border-spacing:0; }
.data-table th { background:#f4f6fa; color:#7b8798; padding:.7rem .8rem; border:0; border-bottom:1px solid #e4e8f0; font-size:.68rem; letter-spacing:.075em; }
.data-table th:first-child { border-radius:10px 0 0 0; }
.data-table th:last-child { border-radius:0 10px 0 0; }
.data-table td { padding:.78rem .8rem; border-bottom:1px solid #edf0f5; color:#334155; }
.data-table tbody tr { transition:background .15s; }
.data-table tbody tr:hover { background:#f8f9fd; }
.data-table tbody tr:last-child td { border-bottom:0; }

.items-table { border-collapse:separate; border-spacing:0; border:1px solid #e4e8f0; border-radius:12px; overflow:hidden; }
.items-table th { background:#f4f6fa; border:0; border-bottom:1px solid #e4e8f0; color:#718096; font-size:.69rem; letter-spacing:.04em; text-transform:uppercase; }
.items-table td { border:0; border-bottom:1px solid #edf0f5; padding:.4rem .45rem; }
.items-table tr:last-child td { border-bottom:0; }
.items-table input { min-height:36px; border:1px solid transparent; border-radius:8px; }
.items-table input:focus { border-color:#c7d2fe; background:#f9faff; }
.totals-box { background:#f8f9fc; border:1px solid #e7eaf1; border-radius:12px; padding:.65rem .9rem; }
.totals-row { border-color:#e6eaf1; color:#475569; }
.totals-row.total { color:#4338ca; font-size:1rem; }
.task-row { border-color:#e6eaf1; border-radius:11px; background:#fbfcfe; padding:.78rem .85rem; transition:.17s; }
.task-row:hover { border-color:#c7d2fe; background:#f8f8ff; transform:translateY(-1px); box-shadow:0 5px 14px rgba(79,70,229,.06); }
.empty-state { background:#fafbfc; border:1px dashed #d8dee9; border-radius:12px; color:#8793a5; }
.badge { border-radius:999px; box-shadow:inset 0 0 0 1px rgba(255,255,255,.2); }
.status-btn { border-radius:8px; padding:.34rem .62rem; }
.toast { border-radius:12px; box-shadow:0 16px 40px rgba(15,23,42,.2); }

@media (max-width: 768px) {
  .sidebar { width:min(292px,90vw); }
  .topbar { min-height:66px; padding:.7rem .9rem; }
  .topbar-meta { gap:.4rem; }
  .topbar-date { display:none; }
  .container { padding:1rem .8rem 2.5rem; }
  .card { padding:1rem; border-radius:14px; }
  .stat-card { min-height:100px; padding:.85rem; }
  .data-table tbody tr, .items-table tbody tr { background:#fff; border-radius:12px; box-shadow:var(--shadow-sm); }
  .sidebar-toggle { border-radius:10px; background:#f5f7fb; color:#172554; }
}
