@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

:root {
  --bg:         #08080a;
  --bg2:        #0f0f13;
  --bg3:        #16161c;
  --bg4:        #1e1e26;
  --border:     rgba(255,255,255,0.06);
  --border2:    rgba(255,255,255,0.11);
  --text:       #ececf0;
  --muted:      #6b6b7a;
  --muted2:     #4a4a58;
  --accent:     #00d4ff;
  --accent-dim: rgba(0,212,255,0.08);
  --accent-mid: rgba(0,212,255,0.15);
  --green:      #00c278;
  --green-dim:  rgba(0,194,120,0.1);
  --red:        #ff4d6d;
  --red-dim:    rgba(255,77,109,0.1);
  --amber:      #f59e0b;
  --amber-dim:  rgba(245,158,11,0.1);
  --font-head:  'Syne', sans-serif;
  --font-body:  'DM Sans', sans-serif;
  --sidebar-w:  240px;
  --radius:     12px;
  --radius-lg:  18px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  overflow: hidden;
}

.sidebar-header {
  padding: 28px 24px 24px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 900;
  color: #08080a;
  flex-shrink: 0;
}

.sidebar-logo .logo-text span { color: var(--accent); }

.sidebar-user {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 34px; height: 34px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-mid);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--muted); }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted2);
  padding: 12px 12px 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s;
  position: relative;
}

.sidebar-nav a .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}

.sidebar-nav a:hover {
  background: var(--bg3);
  color: var(--text);
}

.sidebar-nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-mid);
}

.sidebar-nav a.active .nav-icon { filter: none; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.18s;
}

.sidebar-footer a:hover { background: var(--red-dim); color: var(--red); }

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

/* ── TOPBAR ── */
.topbar {
  height: 64px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left { display: flex; flex-direction: column; }
.topbar-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.topbar-breadcrumb { font-size: 12px; color: var(--muted); }

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

.topbar-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  background: var(--accent);
  color: #08080a;
  border: none;
  border-radius: 9px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
  letter-spacing: 0.01em;
}
.topbar-btn:hover { opacity: 0.85; }
.topbar-btn-ghost {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border2);
}
.topbar-btn-ghost:hover { opacity: 1; border-color: rgba(255,255,255,0.2); }

/* ── PAGE CONTENT ── */
.page { padding: 32px 36px; flex: 1; }

/* ── STAT CARDS ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--border2); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.c-blue::before  { background: var(--accent); }
.stat-card.c-green::before { background: var(--green); }
.stat-card.c-red::before   { background: var(--red); }
.stat-card.c-amber::before { background: var(--amber); }

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

.stat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}

.c-blue  .stat-icon { background: var(--accent-dim); }
.c-green .stat-icon { background: var(--green-dim); }
.c-red   .stat-icon { background: var(--red-dim); }
.c-amber .stat-icon { background: var(--amber-dim); }

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-head);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
}

.c-blue  .stat-value { color: var(--accent); }
.c-green .stat-value { color: var(--green); }
.c-red   .stat-value { color: var(--red); }
.c-amber .stat-value { color: var(--amber); }

/* ── GRID ── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.content-grid.full { grid-template-columns: 1fr; }

/* ── CARDS ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.card-head h2 {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.card-head .card-meta { font-size: 12px; color: var(--muted); }
.card-link { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 600; }
.card-link:hover { text-decoration: underline; }

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

table.data-table {
  width: 100%;
  border-collapse: collapse;
}

table.data-table thead th {
  padding: 11px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data-table tbody td {
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover td { background: var(--bg3); }

.td-name { font-weight: 600; color: var(--text); }
.td-mono { font-family: monospace; font-size: 12px; color: var(--muted); }
.td-amount { font-weight: 700; font-family: var(--font-head); letter-spacing: -0.5px; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-green  { background: var(--green-dim);  color: var(--green); border: 1px solid rgba(0,194,120,0.2); }
.badge-green::before  { background: var(--green); }
.badge-red    { background: var(--red-dim);    color: var(--red);   border: 1px solid rgba(255,77,109,0.2); }
.badge-red::before    { background: var(--red); }
.badge-amber  { background: var(--amber-dim);  color: var(--amber); border: 1px solid rgba(245,158,11,0.2); }
.badge-amber::before  { background: var(--amber); }
.badge-blue   { background: var(--accent-dim); color: var(--accent);border: 1px solid var(--accent-mid); }
.badge-blue::before   { background: var(--accent); }

/* ── ACTION BUTTONS ── */
.action-btns { display: flex; align-items: center; gap: 6px; }

.btn-action {
  display: inline-flex; align-items: center;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border2);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn-action:hover           { color: var(--text);    border-color: rgba(255,255,255,0.2); background: var(--bg4); }
.btn-action.btn-danger:hover{ color: var(--red);     border-color: rgba(255,77,109,0.3);  background: var(--red-dim); }
.btn-action.btn-success:hover{color: var(--green);   border-color: rgba(0,194,120,0.3);   background: var(--green-dim); }
.btn-action.btn-accent:hover{ color: var(--accent);  border-color: var(--accent-mid);     background: var(--accent-dim); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 22px;
  padding: 36px 32px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}

.modal-head h2 {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.modal-close {
  width: 32px; height: 32px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.modal-close:hover { color: var(--text); background: var(--bg4); }

/* ── FORM ELEMENTS ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 4px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.08);
}

.form-group textarea { resize: vertical; min-height: 90px; }
.form-group select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b7a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.form-group select option { background: var(--bg3); }

.form-submit {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #08080a;
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 12px;
  letter-spacing: 0.02em;
}
.form-submit:hover { opacity: 0.85; }

/* ── ALERT ── */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
}
.alert-success { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(0,194,120,0.2); }
.alert-danger  { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(255,77,109,0.2); }
.alert-info    { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent-mid); }

/* ── EMPTY STATE ── */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 36px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── LOGIN PAGE ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 22px;
  padding: 48px 44px;
  width: 100%;
  max-width: 400px;
}

.login-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 42px; height: 42px;
  background: var(--accent);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 20px; font-weight: 900;
  color: #08080a;
}

.login-logo .logo-text {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
}
.login-logo .logo-text span { color: var(--accent); }

.login-card h1 { font-family: var(--font-head); font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.login-card .login-sub { font-size: 14px; color: var(--muted); margin-bottom: 32px; }
.login-error { background: var(--red-dim); border: 1px solid rgba(255,77,109,0.25); color: var(--red); border-radius: 10px; padding: 12px 16px; font-size: 13px; margin-bottom: 20px; }

/* ── PRINT INVOICE ── */
@media print {
  .no-print { display: none !important; }
}

 RESPONSIVE ── *//* ─
@media (max-width: 1100px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .page { padding: 20px; }
  .topbar { padding: 0 20px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
