@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #14131F;
  --ink-soft: #1C1B2C;
  --panel: #FFFFFF;
  --page-bg: #F3F2FA;
  --indigo: #4F46E5;
  --indigo-soft: #6D64F0;
  --amber: #E2A33D;
  --emerald: #1FA97A;
  --rose: #D6483C;
  --text: #1D1B2E;
  --text-muted: #6B6880;
  --border: rgba(29,27,46,0.08);
  --shadow: 0 10px 28px rgba(20,19,31,0.08);
  --radius: 14px;
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); margin: 0 0 0.4em; letter-spacing: -0.01em; }
a { color: var(--indigo); text-decoration: none; }
a:hover { color: var(--indigo-soft); }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

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

.app-sidebar {
  width: 236px; flex-shrink: 0;
  background: var(--ink);
  color: #E9E8F5;
  padding: 24px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.app-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 22px;
  font-family: var(--font-display); font-weight: 700; font-size: 19px; color: #fff;
}
.app-brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--indigo-soft); box-shadow: 0 0 0 4px rgba(109,100,240,0.25); }
.app-nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em; color: #7C7A94; margin: 16px 8px 6px; }
.app-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px;
  color: #C6C4DA; font-weight: 500; font-size: 13.5px;
}
.app-nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.app-nav-link.active { background: var(--indigo); color: #fff; font-weight: 600; }

.app-main { flex: 1; padding: 30px 38px; max-width: 1200px; }
.app-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.app-topbar .who { font-size: 12.5px; color: var(--text-muted); text-align: right; }
.app-topbar .who strong { color: var(--text); }

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.panel h2 { font-size: 17px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 14px; margin-bottom: 18px; }
.stat-tile { background: var(--panel); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.stat-tile .v { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--indigo); }
.stat-tile .l { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-top: 2px; }

table.app-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.app-table th, table.app-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.app-table th { text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.05em; color: var(--text-muted); }
table.app-table tr:last-child td { border-bottom: none; }

label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], textarea, select {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border);
  background: #FBFBFE; font-family: var(--font-body); font-size: 13.5px; color: var(--text);
}
input:focus, textarea:focus, select:focus { border-color: var(--indigo); outline: none; }
textarea { min-height: 80px; resize: vertical; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 9px; border: none; font-weight: 600; font-size: 13px; cursor: pointer; font-family: var(--font-body); }
.btn-primary { background: var(--indigo); color: #fff; }
.btn-primary:hover { background: var(--indigo-soft); }
.btn-secondary { background: #EEEDFB; color: var(--indigo); }
.btn-secondary:hover { background: #E2E0FA; }
.btn-danger { background: var(--rose); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-pending { background: #FBE9CE; color: #8A5A16; }
.badge-confirmed, .badge-preparing { background: #E4E1FB; color: #4636C7; }
.badge-ready { background: #D6F2E6; color: var(--emerald); }
.badge-served { background: #D9E8F7; color: #2A5D82; }
.badge-paid, .badge-completed { background: #D6F2E6; color: #1F7A56; }
.badge-cancelled { background: #F8DAD6; color: var(--rose); }
.badge-active { background: #D6F2E6; color: #1F7A56; }
.badge-inactive, .badge-suspended, .badge-disabled { background: #F8DAD6; color: var(--rose); }
.badge-trial { background: #FBE9CE; color: #8A5A16; }

.flash { padding: 11px 15px; border-radius: 9px; margin-bottom: 16px; font-size: 13.5px; font-weight: 500; }
.flash-success { background: #D6F2E6; color: #1F7A56; }
.flash-error { background: #F8DAD6; color: #93261A; }
.flash-info { background: #DDE6FA; color: #2B4C99; }

.muted { color: var(--text-muted); }

.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); padding: 20px; }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border-radius: 18px; padding: 34px 30px; box-shadow: 0 20px 50px rgba(0,0,0,0.35); }
.auth-card .app-brand { justify-content: center; padding-bottom: 20px; color: var(--text); }
.auth-card .app-brand span { color: var(--text); }
.auth-card h1 { text-align: center; font-size: 21px; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 22px; }
.auth-card .btn { width: 100%; margin-top: 4px; justify-content: center; }
.auth-foot { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 18px; }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .app-sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 12px; align-items: center; }
  .app-brand { padding: 0 10px 0 0; }
  .app-nav-label { display: none; }
  .app-main { padding: 18px; }
}
