:root {
  --navy: #1b365d;
  --navy-dark: #12243f;
  --navy-soft: #2c4a73;
  --page: #f3f5f8;
  --line: #e3e8ef;
  --text: #1f2933;
  --muted: #6b7280;
  --sidebar-w: 250px;
}

html, body { height: 100%; }
body.app-body {
  background: var(--page);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy-dark);
  color: #fff;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 1.1rem 1.25rem;
  font-weight: 700;
  letter-spacing: .04em;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand small { display: block; font-weight: 400; opacity: .7; letter-spacing: 0; }
.sidebar-nav { padding: .75rem 0; overflow: auto; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: rgba(255,255,255,.82);
  text-decoration: none;
  padding: .55rem 1.25rem;
  font-size: .94rem;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.sidebar-nav a.active { border-left: 3px solid #c9d6ea; padding-left: calc(1.25rem - 3px); }

.app-main { margin-left: var(--sidebar-w); min-height: 100%; }
.app-topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.app-content { padding: 1.25rem; }
.search-wrap { flex: 1; max-width: 560px; position: relative; }
.search-wrap input { border-radius: 999px; }
.search-results {
  position: absolute;
  left: 0; right: 0; top: 110%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: .5rem;
  display: none;
  z-index: 20;
  overflow: hidden;
}
.search-results a { display: block; padding: .6rem .9rem; color: var(--text); text-decoration: none; }
.search-results a:hover { background: #f4f7fb; }

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: .6rem;
  padding: 1rem 1.1rem;
}
.stat-card .label { color: var(--muted); font-size: .82rem; }
.stat-card .value { font-size: 1.7rem; font-weight: 700; color: var(--navy); }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: .6rem;
  margin-bottom: 1rem;
}
.panel-h {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  color: var(--navy);
}
.panel-b { padding: 1rem; }

.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.overdue, .text-overdue { color: #b42318 !important; font-weight: 600; }

.auth-page {
  min-height: 100vh;
  background: var(--navy-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: .75rem;
  padding: 2rem 1.75rem;
}
.auth-card h1 { font-size: 1.35rem; color: var(--navy); }
.timeline { border-left: 2px solid var(--line); margin-left: .6rem; padding-left: 1.1rem; }
.timeline-day { font-size: .78rem; font-weight: 700; color: var(--navy); margin: 1rem 0 .4rem; }
.timeline-item { margin-bottom: 1rem; }
.timeline-item .meta { font-size: .8rem; color: var(--muted); }

.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-soft); color: #fff; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .app-main { margin-left: 0; }
}
