:root {
  --navy: #16324f;
  --navy-2: #1f4570;
  --accent: #0ea5a4;
  --bg: #f3f5f8;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-bg: var(--bg);
  --bs-primary: #1f4570;
  --bs-primary-rgb: 31, 69, 112;
}
body { font-size: .92rem; color: #1e293b; }
.btn-primary { --bs-btn-bg: #1f4570; --bs-btn-border-color: #1f4570; --bs-btn-hover-bg: #16324f; --bs-btn-hover-border-color: #16324f; --bs-btn-active-bg: #16324f; }
.btn-outline-primary { --bs-btn-color: #1f4570; --bs-btn-border-color: #1f4570; --bs-btn-hover-bg: #1f4570; --bs-btn-hover-border-color: #1f4570; }
a { color: #1f4570; }

.brandbar { background: var(--navy); color: #fff; padding: .55rem 0; }
.brandbar .brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; display: flex; align-items: center; gap: .55rem; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 800; }
.brandbar .userlink { color: #dbe7f3; text-decoration: none; font-size: .88rem; }
.mainnav { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 0; }
.mainnav .nav-link { color: #475569; font-weight: 500; padding: .8rem .85rem !important; border-bottom: 2px solid transparent; }
.mainnav .nav-link:hover { color: var(--navy); }
.mainnav .nav-link.active { color: var(--navy); border-bottom-color: var(--accent); }

.card { border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid #edf1f5; }
.table { --bs-table-bg: transparent; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; font-weight: 600; border-bottom-width: 1px; }
.table-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.table-card .table { margin: 0; }
.table-card .table td, .table-card .table th { padding: .6rem .8rem; vertical-align: middle; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f8fafc; }

/* Dashboard tiles, modeled on the original app's icon grid */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
.tile { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.1rem .8rem; text-align: center; text-decoration: none; color: #1e293b; font-weight: 600; transition: transform .12s, box-shadow .12s, border-color .12s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15, 23, 42, .08); border-color: #cbd5e1; color: #0f172a; }
.tile i { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto .6rem; border-radius: 14px; font-size: 1.6rem; color: #fff; }
.tile small { display: block; font-weight: 400; color: #64748b; font-size: .76rem; margin-top: .15rem; }
.t-blue { background: #2563eb; } .t-teal { background: #0d9488; } .t-amber { background: #d97706; } .t-violet { background: #7c3aed; }
.t-green { background: #16a34a; } .t-rose { background: #e11d48; } .t-slate { background: #475569; } .t-cyan { background: #0891b2; }

.kpi { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: .9rem 1rem; height: 100%; }
.kpi .label { font-size: .75rem; color: #64748b; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kpi .value { font-size: 1.45rem; font-weight: 700; color: #0f172a; }
.kpi a { text-decoration: none; }

/* line item editor */
#items td { vertical-align: top; }
#items textarea { min-height: 38px; resize: vertical; }
#items .num { text-align: right; }
.totals td { padding: .25rem .5rem; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #16324f, #1f4570 60%, #0ea5a4); }
.login-card { width: 100%; max-width: 380px; }

dl.info dt { font-weight: 500; color: #64748b; font-size: .8rem; }
dl.info dd { margin-bottom: .6rem; }

#calendar { background: #fff; padding: 1rem; border-radius: 10px; border: 1px solid #e2e8f0; }
.fc .fc-button-primary { background: #1f4570; border-color: #1f4570; }
.fc .fc-button-primary:not(:disabled).fc-button-active { background: #16324f; }
.fc-event { cursor: pointer; }

@media print {
  body { background: #fff; }
  main { padding: 0 !important; }
}
a.kpi, a.kpi:hover { text-decoration: none; color: inherit; }
a.kpi:hover { border-color: #cbd5e1; }
.fc a { text-decoration: none; color: inherit; }
#items td:nth-child(2) { min-width: 300px; }
