:root {
  --navy: #082C78;
  --navy-dark: #061B4B;
  --blue: #0867B2;
  --cyan: #08A8E5;
  --background: #F4F7FC;
  --white: #FFFFFF;
  --text: #172B4D;
  --muted: #718096;
  --border: #E2E9F3;
  --shadow: 0 5px 24px rgba(8,44,120,.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont,
               "Segoe UI", sans-serif;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 255px;
  flex-shrink: 0;
  background: linear-gradient(170deg,
              var(--navy-dark), var(--navy));
  color: white;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
}

.brand {
  padding: 10px 12px 38px;
}

.brand h2 {
  margin: 0;
  font-size: 29px;
  letter-spacing: 4px;
  font-weight: 800;
}

.brand p {
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 6px;
  font-size: 12px;
  margin: 5px 0;
}

.sidebar-label {
  font-size: 11px;
  color: #92B9E9;
  letter-spacing: 2px;
  padding: 0 12px 14px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

nav a {
  color: #D6E5FA;
  text-decoration: none;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  transition: background .2s;
}

nav a:hover,
nav a:focus-visible {
  background: rgba(255,255,255,.13);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  padding: 20px 12px 0;
  color: #A9C4E7;
  font-size: 12px;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 36px;
  max-width: 1600px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.eyebrow {
  color: var(--blue);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
}

h1 {
  margin: 5px 0;
  font-size: 30px;
  color: var(--navy-dark);
}

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

.status {
  background: #E8F4FF;
  color: var(--blue);
  border: 1px solid #C7E4FF;
  padding: 9px 15px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--cyan);
}

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

.stat strong {
  color: var(--navy);
  font-size: 34px;
  font-weight: 750;
}

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  scroll-margin-top: 20px;
}

.panel h2 {
  color: var(--navy-dark);
  font-size: 19px;
  margin: 0 0 8px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

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

input[type="search"] {
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 9px;
  min-width: 240px;
  font: inherit;
  font-size: 13px;
}

input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.empty-state {
  background: #F7FAFE;
  color: var(--muted);
  padding: 35px;
  text-align: center;
  border: 1px dashed #C7D9EF;
  border-radius: 12px;
  font-size: 13px;
}

.approval-list {
  min-height: 100px;
}

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 700px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; padding: 16px; }
  .brand { padding: 8px 12px; }
  nav { flex-direction: row; flex-wrap: wrap; }
  nav a { padding: 10px; }
  .sidebar-label, .sidebar-footer { display: none; }
  .main { padding: 20px; }
  .topbar, .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .panel { padding: 18px; }
  input[type="search"] { min-width: 0; width: 100%; }
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 190px;
  height: auto;
  object-fit: contain;
  background: white;
  border-radius: 12px;
  padding: 12px;
}

.approval-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 14px;
  background: #FFFFFF;
}

.approval-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.approval-card h3 {
  margin: 0 0 6px;
  color: var(--navy-dark);
  font-size: 16px;
}

.record-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.approval-badge {
  background: #FFF4DD;
  color: #946200;
  padding: 7px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.email-subject {
  margin: 18px 0;
  font-size: 13px;
  color: var(--text);
}

.approval-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-outline {
  background: white;
  color: var(--blue);
  border: 1px solid #BBD4EE;
}

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

.btn-success {
  background: #087D5B;
  color: white;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.email-preview {
  margin-top: 18px;
  padding: 18px;
  border-radius: 10px;
  background: #F4F7FC;
  border: 1px solid var(--border);
}

.email-preview[hidden] {
  display: none;
}

.email-body {
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .approval-card-header {
    flex-direction: column;
  }
}
