/* Launch I.T. Reports — app.css */
:root {
  --bg:       #f5f5f4;
  --surface:  #ffffff;
  --card:     #ffffff;
  --border:   #e5e5e3;
  --text:     #1c1c1a;
  --muted:    #6b6b68;
  --accent:   #185FA5;
  --accent-bg:#e6f1fb;
  --success:  #3b6d11;
  --success-bg:#eaf3de;
  --warning:  #854f0b;
  --warning-bg:#faeeda;
  --danger:   #a32d2d;
  --danger-bg:#fcebeb;
  --radius:   8px;
  --sidebar:  200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }

/* Shell */
.shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar); flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 0 0 1rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.logo { padding: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 0.5rem; }
.logo-name { font-size: 15px; font-weight: 600; color: var(--text); }
.logo-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.nav-section { font-size: 10px; font-weight: 600; color: var(--muted); padding: 0.75rem 1rem 0.25rem; text-transform: uppercase; letter-spacing: 0.06em; display: block; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 1rem;
  font-size: 13px; color: var(--muted); border-left: 2px solid transparent;
  transition: background 0.1s;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-bg); font-weight: 500; }
.nav-item svg { flex-shrink: 0; }

.sync-status { margin-top: auto; padding: 1rem; border-top: 1px solid var(--border); }
.sync-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 11px; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sync-dot.ok { background: #63992280; }
.sync-dot.err { background: var(--danger); }
.sync-label { color: var(--muted); flex: 1; }
.sync-time { color: var(--muted); }

/* Main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 12px; color: var(--muted); }

.content { padding: 1.25rem 1.5rem; flex: 1; }

/* KPI grid */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 1.25rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.kpi-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.kpi-value { font-size: 24px; font-weight: 600; }
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.kpi-sub.up   { color: var(--success); }
.kpi-sub.warn { color: var(--warning); }
.kpi-sub.danger { color: var(--danger); }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 1.25rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-title { font-size: 13px; font-weight: 600; }
.card-tag { font-size: 11px; padding: 2px 8px; border-radius: var(--radius); background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

/* Bar chart */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-label { font-size: 12px; color: var(--muted); width: 110px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.4s ease; }
.bar-val { font-size: 12px; color: var(--muted); width: 60px; text-align: right; flex-shrink: 0; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; padding: 0 12px 8px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.data-table a { color: var(--accent); }
.data-table a:hover { text-decoration: underline; }

/* Pills / badges */
.pill { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px; }
.pill.open    { background: var(--warning-bg); color: var(--warning); }
.pill.closed  { background: var(--success-bg); color: var(--success); }
.pill.critical{ background: var(--danger-bg);  color: var(--danger); }
.pill.paid    { background: var(--success-bg); color: var(--success); }
.pill.unpaid  { background: var(--warning-bg); color: var(--warning); }
.pill.draft   { background: var(--bg); color: var(--muted); }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; width: 340px; }
.login-logo { font-size: 18px; font-weight: 700; margin-bottom: 0.25rem; }
.login-sub  { font-size: 13px; color: var(--muted); margin-bottom: 1.5rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; color: var(--muted); }
.field input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; background: var(--surface); color: var(--text); outline: none; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.btn { display: inline-block; padding: 9px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; border: none; }
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { opacity: 0.9; }
.alert { padding: 8px 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 1rem; }
.alert-danger { background: var(--danger-bg); color: var(--danger); }

/* MRR trend chart */
.trend-chart { display: flex; align-items: flex-end; gap: 8px; height: 100px; padding-top: 0.5rem; }
.trend-col { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.trend-bar { width: 100%; background: var(--accent-bg); border-radius: 3px 3px 0 0; transition: background 0.2s; }
.trend-bar.current { background: var(--accent); }
.trend-bar:hover { opacity: 0.8; }
.trend-label { font-size: 10px; color: var(--muted); }

/* Section title */
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 1.5rem 0 0.75rem; }
.section-title:first-child { margin-top: 0; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
}
