/* Brindisa Asset Management — shared styles
   Brand: navy + warm off-white, matching Retail Checks / Building Checks.
   Type: Playfair Display (headings/brand) + IBM Plex Sans (UI) + IBM Plex Mono (tags, data)
*/

@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap");

:root {
  --navy: #2e2e50;
  --navy-dark: #201f3a;
  --ink: #24243f;
  --ink-soft: #5b5b74;
  --paper: #fbfbf9;
  --bg: #efece6;
  --bg-dark: #e3ded3;
  --gold: #c89b3c;
  --gold-light: #f6ecd4;
  --olive: #2e2e50; /* buttons reuse navy as the primary action colour */
  --olive-dark: #201f3a;
  --olive-light: #e3e2ea;
  --mustard: #c89b3c;
  --mustard-light: #f6ecd4;
  --rust: #a43e2b;
  --rust-light: #f5e2dd;
  --stone-dark: #ded9cd;
  --line: #ddd8cb;

  --font-display: "Playfair Display", Georgia, serif;

  --radius: 6px;
  --shadow: 0 1px 2px rgba(28, 33, 29, 0.06), 0 1px 1px rgba(28, 33, 29, 0.04);

  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  color: var(--navy);
}

a { color: var(--navy); }

code, .mono, .tag-chip, .field-value.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- layout shell ---------- */

.topbar {
  background: var(--navy);
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.6rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .brand {
  display: flex;
  align-items: center;
}

.topbar .brand img {
  height: 40px;
  width: auto;
  display: block;
}

.topbar nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.topbar nav a {
  color: #cfcfe0;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius);
}

.topbar nav a:hover,
.topbar nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-head p {
  color: var(--ink-soft);
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
}

/* ---------- cards / panels ---------- */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
}

.card + .card { margin-top: 1rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: block;
  text-decoration: none;
  color: inherit;
}

a.stat {
  cursor: pointer;
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

a.stat:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow);
}

.stat .n {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
  display: block;
  color: var(--navy);
}

.stat .label {
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin-top: 0.35rem;
  display: block;
}

.stat.warn .n { color: var(--mustard); }
.stat.alert .n { color: var(--rust); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.1;
}

.btn:hover { background: var(--navy-dark); border-color: var(--navy-dark); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn.ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}
.btn.ghost:hover { background: var(--olive-light); border-color: var(--navy); }

.btn.danger { background: var(--rust); border-color: var(--rust); }
.btn.danger:hover { background: #832f20; border-color: #832f20; }

.btn.small { padding: 0.35rem 0.6rem; font-size: 0.82rem; }

/* ---------- forms ---------- */

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}

input, select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
}

.field { margin-bottom: 1rem; }

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.3rem; }

/* ---------- status pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.pill.status-active { background: var(--olive-light); color: var(--navy); }
.pill.status-in-repair { background: var(--mustard-light); color: #7a5c1e; }
.pill.status-disposed { background: var(--stone-dark); color: var(--ink-soft); }
.pill.due-soon { background: var(--rust-light); color: var(--rust); }

/* ---------- tag chip (signature element) ---------- */

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--navy);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem 0.2rem 0.4rem;
  border-radius: 3px;
  position: relative;
}

.tag-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
}

/* ---------- table ---------- */

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 0.6rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:hover { background: var(--olive-light); }

.table-wrap {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- filters bar ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
  align-items: end;
}

.filters .field { margin-bottom: 0; min-width: 150px; }

/* ---------- empty / loading states ---------- */

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--ink-soft);
}

.empty-state .btn { margin-top: 0.75rem; }

.loading { color: var(--ink-soft); font-size: 0.9rem; padding: 1rem 0; }

.error-box {
  background: var(--rust-light);
  color: var(--rust);
  border: 1px solid #e2b3a6;
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--navy);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  z-index: 50;
}

/* ---------- dashboard two-column layout ---------- */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

.dashboard-grid .card {
  display: flex;
  flex-direction: column;
  margin-top: 0; /* .card + .card adds stacking margin meant for vertical lists; not wanted here */
}

@media (max-width: 800px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  main { padding: 1rem 0.85rem 3rem; }
  .page-head { flex-direction: column; align-items: flex-start; }
}
