/* ==========================================================================
   Base Design Tokens, Typography, Layout, Sidebar & Topbar
   ========================================================================== */
:root {
  --navy: #182941;
  --navy2: #213851;
  --ink: #1d2c3f;
  --muted: #617186;
  --border: #e1e7ef;
  --pale: #f5f7fb;
  --paper: #fff;
  --orange: #d97726;
  --orangelight: #fff2e6;
  --green: #087d5a;
  --greenlight: #eaf8f1;
  --red: #b84242;
  --redlight: #fff1ef;
  --radius: 12px;
  --shadow: 0 3px 16px rgba(24, 41, 65, 0.045);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--pale);
  color: var(--ink);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

a {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #96b7ff;
  outline-offset: 2px;
}

/* Shell & Navigation */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  width: 238px;
  min-width: 238px;
  height: 100vh;
  background: var(--navy);
  color: #dce5ee;
  display: flex;
  flex-direction: column;
  padding: 27px 15px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 12px 32px;
  color: white;
}

.mark {
  width: 38px;
  height: 38px;
  background: var(--orange);
  color: white;
  font-weight: 850;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 19px;
}

.brand strong {
  display: block;
  font-size: 20px;
  letter-spacing: -0.6px;
  line-height: 1.1;
}

.brand small {
  font-size: 10px;
  letter-spacing: 2px;
  opacity: 0.65;
}

.side-label {
  font-size: 10px;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  opacity: 0.45;
  padding: 4px 15px 10px;
  font-weight: 800;
}

.nav {
  display: grid;
  gap: 5px;
}

.navbtn {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  color: #d4deea;
  font-weight: 600;
  width: 100%;
}

.navbtn:hover {
  background: #2a3c54;
}

.navbtn.active {
  background: #33455d;
  color: white;
}

.navico {
  font-size: 17px;
  width: 20px;
  text-align: center;
}

.navbtn .count {
  margin-left: auto;
  border-radius: 7px;
  font-size: 11px;
  min-width: 25px;
  padding: 2px 6px;
  text-align: center;
  background: rgba(255, 255, 255, 0.12);
}

.navbtn.active .count {
  background: var(--orange);
}

.sidebar-foot {
  margin-top: auto;
  padding: 17px 13px 2px;
  border-top: 1px solid #34465a;
  font-size: 12px;
  color: #b0c2d3;
}

.sidebar-foot b {
  color: #fff;
}

.sidebar-foot small {
  display: block;
  margin-top: 7px;
  color: #8fa4b8;
}

/* Layout */
.main {
  flex: 1;
  min-width: 0;
}

.topbar {
  height: 72px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  gap: 10px;
}

.crumb {
  font-weight: 750;
  font-size: 15px;
}

.crumb span {
  color: #9daabd;
  margin: 0 9px;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-chip {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  border: 1px solid #f2d3bc;
  border-radius: 50px;
  color: #a9571d;
  background: #fff6ef;
  padding: 7px 12px;
}

.content {
  padding: 29px 34px 50px;
  max-width: 1600px;
  margin: auto;
}

/* Page Headers & Buttons */
.pagehead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.pagehead h1 {
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -0.8px;
  margin: 0 0 7px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 850;
  font-size: 10px;
  color: var(--orange);
  margin: 0 0 9px;
}

.pageactions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: white;
  color: var(--ink);
  border-radius: 9px;
  padding: 10px 14px;
  font-weight: 750;
  white-space: nowrap;
  min-height: 38px;
  transition: background 0.15s;
}

.btn:hover:not(:disabled) {
  background: #f3f6fb;
}

.btn.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}

.btn.primary:hover:not(:disabled) {
  background: #2b4764;
}

.btn.orange {
  background: var(--orange);
  border-color: var(--orange);
  color: white;
}

.btn.orange:hover:not(:disabled) {
  background: #c2621b;
}

.btn.danger {
  color: var(--red);
  border-color: #f4ceca;
}

.btn.sm {
  min-height: 29px;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 7px;
}

.btn.textbtn {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 6px 8px;
  text-decoration: underline;
}

/* Utilities */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.push {
  margin-left: auto;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 11px;
}

.small {
  font-size: 12px;
}

.mono {
  font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #4c6077;
}

.strong {
  font-weight: 750;
}

.hide {
  display: none !important;
}

/* Notice Banner */
.notice {
  border: 1px solid #e5e7ff;
  border-left: 4px solid #657da6;
  background: #f0f4fc;
  border-radius: 10px;
  padding: 13px 17px;
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.notice.warning {
  border-color: #f8d8b4;
  border-left-color: var(--orange);
  background: var(--orangelight);
}

.notice.success {
  border-color: #c5eadd;
  border-left-color: var(--green);
  background: var(--greenlight);
}

.notice b {
  display: block;
  margin-bottom: 2px;
}

.notice p {
  margin: 0;
  font-size: 12px;
  color: #53667d;
}

.notice.warning p {
  color: #895528;
}

/* Responsive Rules */
@media (max-width: 900px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    min-width: 0;
    width: 100%;
    height: auto;
    padding: 12px 15px;
  }
  .brand {
    margin: 3px 6px 11px;
  }
  .side-label,
  .sidebar-foot {
    display: none;
  }
  .nav {
    display: flex;
    overflow: auto;
    gap: 3px;
  }
  .navbtn {
    width: auto;
    white-space: nowrap;
    padding: 9px 11px;
  }
  .navico {
    display: none;
  }
  .topbar {
    padding: 0 20px;
    height: 61px;
  }
  .content {
    padding: 23px 20px 40px;
  }
}

@media (max-width: 600px) {
  .topbar .crumb {
    font-size: 12px;
  }
  .top-right {
    gap: 4px;
  }
  .demo-chip {
    display: none;
  }
  .pagehead {
    display: block;
  }
  .pagehead .pageactions {
    margin-top: 14px;
  }
  .content {
    padding: 18px 12px 30px;
  }
}
