:root {
  --navy: #121c45;
  --navy-light: #1c2a5e;
  --steel: #436882;
  --steel-dark: #34526a;
  --orange: #c8763a;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --border: #e2e6ec;
  --text: #262d3d;
  --muted: #6b7685;
  --danger: #c0392b;
  --radius: 3px;
  --font-heading: "Poppins", "Roboto", sans-serif;
  --font-body: "Roboto", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}

h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* --- Login --- */
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy) 45%, var(--steel) 100%);
}
.login-box {
  background: var(--panel);
  padding: 44px 40px 36px;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(9, 14, 36, 0.35);
  width: 360px;
}
.login-logo {
  display: block;
  height: 42px;
  margin: 0 auto 22px;
}
.login-box h1 {
  font-size: 15px;
  margin: 0 0 28px;
  text-align: center;
  color: var(--muted);
  font-weight: 500;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* --- Layout --- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px;
  background: var(--navy);
  color: #c3cbe0;
  padding: 0 0 20px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  padding: 22px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
}
.sidebar .brand .brand-word {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.03em;
  color: #ffffff;
}
.sidebar .brand .tagline {
  color: #7f8ab0;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 8px;
  font-weight: 500;
}
.sidebar nav a {
  display: block;
  padding: 12px 20px;
  color: #c3cbe0;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.sidebar nav a.active {
  background: rgba(67, 104, 130, 0.35);
  color: #fff;
  border-left-color: var(--orange);
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar .user-info {
  margin-top: auto;
  padding: 16px 20px;
  font-size: 12px;
  color: #7f8ab0;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.main { flex: 1; padding: 28px 36px; overflow-x: auto; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar h2 { margin: 0; font-size: 22px; color: var(--navy); }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--steel); outline-offset: 0; border-color: var(--steel); }
textarea { resize: vertical; min-height: 70px; }

button {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: none;
  background: var(--steel);
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.02em;
}
button:hover { background: var(--steel-dark); }
button.secondary { background: #eef1f6; color: var(--text); }
button.secondary:hover { background: #e2e6ec; }
button.danger { background: var(--danger); }
button.danger:hover { background: #a5301f; }
button:disabled { opacity: 0.5; cursor: default; }

.search-row { display: flex; gap: 10px; }
.search-row input { width: 260px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  padding: 12px 16px;
  background: #f8f9fc;
  border-bottom: 2px solid var(--border);
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f2f5f9; cursor: pointer; }
.empty-row td { text-align: center; color: var(--muted); padding: 30px; cursor: default; }
.empty-row:hover { background: none; }

.card { background: var(--panel); border-radius: var(--radius); padding: 24px; border: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 12px; color: var(--muted); font-weight: 700; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }

.error-msg { color: var(--danger); font-size: 13px; margin: 8px 0 0; min-height: 16px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #e3ebf1; color: var(--steel-dark); }

.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.detail-header h2 { margin: 0 0 4px; color: var(--navy); }
.detail-meta { color: var(--muted); font-size: 13px; }
.section-title { font-size: 13px; font-weight: 700; margin: 24px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(9, 14, 36, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  padding: 20px;
}
.modal { background: #fff; border-radius: var(--radius); padding: 24px; width: 420px; max-width: 100%; }
.modal h3 { margin-top: 0; color: var(--navy); }
