:root {
  --navy: #10233f;
  --navy-light: #16335a;
  --gold: #c8992e;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1c2531;
  --muted: #6b7686;
  --border: #e4e8ee;
  --red: #c0392b;
  --green: #1e8a5b;
  --amber: #b8790e;
  --blue: #2563a6;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  padding-bottom: 64px; /* space for mobile bottom nav */
}
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { margin: 0 0 8px; }

.topbar {
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.topbar .brand img { height: 30px; width: 30px; border-radius: 6px; background:#fff; }
.topbar .user-menu { font-size: 13px; display:flex; align-items:center; gap:10px; }
.topbar .user-menu a { color: #d9e2f1; }

.layout { display: flex; min-height: calc(100vh - 54px); }
.sidebar {
  width: 220px;
  background: var(--navy-light);
  color: #dde5f2;
  padding: 14px 0;
  flex-shrink: 0;
}
.sidebar a {
  display: block;
  padding: 10px 18px;
  color: #cddaf0;
  font-size: 14px;
}
.sidebar a.active, .sidebar a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .group-label {
  padding: 14px 18px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #8fa0c0;
}
@media (max-width: 860px) { .sidebar { display: none; } }

.main { flex: 1; padding: 18px; max-width: 1200px; }

.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--border);
  z-index: 30;
}
.bottom-nav .items { display: flex; }
.bottom-nav a {
  flex: 1; text-align: center; padding: 8px 2px; font-size: 11px; color: var(--muted);
}
.bottom-nav a.active { color: var(--navy); font-weight: 600; }
.bottom-nav .icon { display: block; font-size: 18px; margin-bottom: 2px; }
@media (max-width: 860px) { .bottom-nav { display: block; } }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; text-align: left;
}
.stat-card .num { font-size: 26px; font-weight: 700; color: var(--navy); }
.stat-card .label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
.card h3 { font-size: 15px; color: var(--navy); border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 12px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.data-table tr:hover { background: #fafbfd; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-blue { background: #e6f0fa; color: var(--blue); }
.badge-amber { background: #fbf0da; color: var(--amber); }
.badge-red { background: #fbe3e0; color: var(--red); }
.badge-green { background: #e1f4ec; color: var(--green); }
.badge-gray { background: #eceff3; color: var(--muted); }

.btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px; border: none;
  background: var(--navy); color: #fff; font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--navy-light); }
.btn-gold { background: var(--gold); color: #26210a; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-red { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.form-group { margin-bottom: 14px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #35415a; }
input[type=text], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=email], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
textarea { resize: vertical; min-height: 70px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--navy), #0a1526); padding: 20px;
}
.login-box { background: #fff; border-radius: 14px; padding: 32px 28px; width: 100%; max-width: 380px; }
.login-box h1 { font-size: 19px; color: var(--navy); text-align: center; }
.login-box .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 14px; }
.alert-error { background: #fbe3e0; color: var(--red); }
.alert-success { background: #e1f4ec; color: var(--green); }

.timeline { border-left: 2px solid var(--border); margin-left: 8px; }
.timeline-item { position: relative; padding: 4px 0 16px 20px; }
.timeline-item::before {
  content: ''; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--navy);
}
.timeline-item .t-time { font-size: 11.5px; color: var(--muted); }
.timeline-item .t-title { font-weight: 600; font-size: 13.5px; }

.owner-tag { font-size: 12.5px; padding: 3px 9px; border-radius: 6px; background: #eef2fb; color: var(--navy); font-weight: 600; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--navy); border-color: var(--gold); font-weight: 600; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 140px; }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
