@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink: #12181B;
  --paper: #F7F5F0;
  --signal: #2FA84F;
  --alert: #B45309;
  --wire: #1B6E8C;
  --ink-soft: #5B6670;
  --border: #E0DCD3;
  --white: #ffffff;
  --shadow: 0 14px 40px rgba(18, 24, 27, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

body, html { min-height: 100%; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100%;
  background: linear-gradient(180deg, #1a237e 0%, #0d1445 100%);
  padding: 20px 0;
  transition: all 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.sidebar-brand {
  padding: 0 20px 30px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 20px;
  text-align: center;
}

.sidebar-brand h2 {
  color: var(--white);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
}

.sidebar-brand i {
  color: #4fc3f7;
  margin-right: 10px;
}

.sidebar-brand small {
  display: block;
  color: rgba(255,255,255,0.68);
  font-size: 12px;
  margin-top: 5px;
}

.sidebar-menu {
  list-style: none;
  padding: 0 10px;
  margin: 0;
}

.sidebar-menu li { margin-bottom: 5px; }

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255,255,255,0.74);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 15px;
  font-weight: 500;
}

.sidebar-menu a:hover {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  transform: translateX(5px);
}

.sidebar-menu a.active {
  background: rgba(79, 195, 247, 0.2);
  color: #4fc3f7;
  box-shadow: inset 3px 0 0 #4fc3f7;
}

.sidebar-menu a i { width: 24px; margin-right: 15px; font-size: 18px; }

.sidebar-menu .divider {
  height: 1px;
  background: rgba(255,255,255,0.12);
  margin: 15px 20px;
}

.main-content {
  margin-left: 260px;
  min-height: 100vh;
  padding: 20px 30px 40px;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  margin-bottom: 24px;
}

.top-header .greeting h1 {
  font-size: 22px;
  color: #1a237e;
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
}

.top-header .greeting p {
  color: var(--ink-soft);
  font-size: 14px;
  margin-top: 2px;
}

.top-header .header-actions { display: flex; align-items: center; gap: 15px; }

.top-header .header-actions .datetime { color: var(--ink-soft); font-size: 14px; }

.top-header .header-actions .btn-notification {
  background: #f0f2f5;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
}

.top-header .header-actions .btn-notification:hover { background: #e8eaf6; }

.top-header .header-actions .btn-notification .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: #ff6b6b;
  border-radius: 50%;
  border: 2px solid var(--white);
}

.page-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.page-header-compact { margin-bottom: 12px; }

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wire);
}

h2, .card h2, .invoice-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  margin: 0 0 8px;
}

.subtle {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.table-card,
.card,
.invoice-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.table-card { overflow: hidden; }

.card { padding: 28px; max-width: 480px; }

.invoice-card { padding: 32px; }

.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

td.mono, .mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}

.empty-state { padding: 24px 16px; color: var(--ink-soft); }

.signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  vertical-align: middle;
  margin-right: 8px;
}

.signal .bar {
  width: 3px;
  background: var(--border);
  border-radius: 1px;
}

.signal .bar:nth-child(1) { height: 5px; }
.signal .bar:nth-child(2) { height: 9px; }
.signal .bar:nth-child(3) { height: 14px; }

.signal.active .bar { background: var(--signal); }
.signal.suspended .bar:nth-child(1) { background: var(--alert); }

.status-label {
  font-size: 13px;
  font-weight: 500;
}

.status-label.active { color: var(--signal); }
.status-label.suspended { color: var(--alert); }

.status-pill {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-pill.paid, .status-pill.active {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-pill.pending {
  background: #fff3e0;
  color: #e65100;
}

.status-pill.cancelled, .status-pill.suspended {
  background: #ffebee;
  color: #c62828;
}

a.action {
  color: var(--wire);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-right: 12px;
}

a.action:hover, a.action:focus-visible { text-decoration: underline; }

a.btn-primary {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

a.btn-primary:hover, a.btn-primary:focus-visible { background: var(--wire); }

a.btn-secondary {
  display: inline-block;
  background: var(--wire);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

form { display: flex; flex-direction: column; gap: 14px; }

.field-group { display: flex; flex-direction: column; gap: 6px; }

label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  background: var(--white);
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--wire);
  outline-offset: 1px;
}

button,
input[type="submit"] {
  margin-top: 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
}

button:hover,
input[type="submit"]:hover { background: var(--wire); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.invoice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 18px 0 24px;
}

.invoice-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.invoice-meta strong { color: var(--ink); }

.invoice-summary {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}

.invoice-summary p { margin: 8px 0; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
}

.sidebar-overlay.active { display: block; }

.menu-toggle {
  display: none;
  background: #1a237e;
  color: var(--white);
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  margin-bottom: 15px;
}

@media (max-width: 992px) {
  .invoice-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

  .sidebar.open { transform: translateX(0); }

  .main-content {
    margin-left: 0;
    padding: 15px;
  }

  .menu-toggle { display: block; }

  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .top-header .header-actions { width: 100%; justify-content: space-between; }
}
