:root {
  --ink: #17201c;
  --muted: #65736b;
  --line: #d7e3da;
  --paper: #fff;
  --soft: #f2f7f2;
  --surface: #f8fbf8;
  --deep: #0f5132;
  --deep-2: #123f2d;
  --leaf: #1f7a4d;
  --gold: #c99724;
  --sky: #2f6f9f;
  --danger: #b83a35;
  --shadow-soft: 0 16px 36px rgba(18, 41, 28, 0.08);
  --shadow-lg: 0 26px 60px rgba(18, 41, 28, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(31, 122, 77, 0.06), transparent 22%),
    linear-gradient(180deg, #f6faf6 0%, #eef4ef 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  padding: 22px;
  border-right: 0;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.mark { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.mark img { display: block; max-width: 28px; max-height: 28px; object-fit: contain; }
.brand strong, .brand span, .nav a span, small { display: block; }
small, .muted { color: var(--muted); }
.sidebar small,
.sidebar .muted { color: rgba(229, 239, 233, 0.72); }
.nav { display: grid; gap: 6px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  color: rgba(229, 239, 233, 0.78);
  border-radius: 8px;
}
.nav a.active, .nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.content {
  padding: clamp(18px, 4vw, 44px);
  background:
    radial-gradient(circle at top right, rgba(31, 122, 77, 0.04), transparent 24%),
    linear-gradient(180deg, #f4f8f4 0%, #eef4ef 100%);
}
.topline { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.eyebrow { color: var(--gold); font-size: .78rem; font-weight: 850; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 1.35rem; line-height: 1.2; letter-spacing: 0; }
h2 { margin-bottom: 12px; font-size: 1.4rem; }
h3 { margin-bottom: 0; font-size: 1.02rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--deep) 0%, var(--leaf) 100%); box-shadow: 0 12px 26px rgba(15, 81, 50, 0.2); }
.btn.secondary { color: var(--deep); background: rgba(255, 255, 255, 0.96); border-color: var(--line); }
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 3px solid rgba(31, 122, 77, 0.18); outline-offset: 2px; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
.card, .panel { background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-soft); }
.card { padding: 18px; }
.card strong { display: block; margin: 8px 0 2px; font-size: 2rem; }
.panel { padding: 20px; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.two { grid-template-columns: minmax(0, 1fr) 360px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 13px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .76rem; text-transform: uppercase; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.status { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 999px; font-size: .76rem; font-weight: 850; }
.approved, .active, .held { color: #17633c; background: #e6f4ec; }
.pending_review, .open, .in_transit, .departed_origin { color: #235f8c; background: #e6f0f8; }
.pending { color: #8a5a08; background: #fff3d7; }
.rejected, .suspended, .failed { color: var(--danger); background: #fde8e6; }
.submitted, .created { color: #8a5a08; background: #fff3d7; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 430px; }
.login-hero { position: relative; display: grid; align-content: end; padding: clamp(28px, 7vw, 80px); color: #fff; background: linear-gradient(90deg, rgba(11, 35, 25, .92), rgba(11, 35, 25, .55)), url("https://images.unsplash.com/photo-1625246333195-78d9c38ad449?auto=format&fit=crop&w=1600&q=80") center/cover; }
.login-hero h1 { max-width: 760px; font-size: clamp(3rem, 7vw, 6rem); line-height: .95; }
.login-panel { display: grid; align-content: center; padding: 34px; background: rgba(255, 255, 255, 0.98); }
label { display: grid; gap: 8px; margin-bottom: 14px; font-weight: 750; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
input:focus, select:focus, textarea:focus { border-color: rgba(31, 122, 77, 0.48); box-shadow: 0 0 0 4px rgba(31, 122, 77, 0.1); }
.alert { padding: 12px 14px; margin-bottom: 14px; color: var(--danger); background: #fde8e6; border-radius: 8px; }
.notice { padding: 12px 14px; margin-bottom: 14px; color: #17633c; background: #e6f4ec; border-radius: 8px; }
.demo-users { display: grid; gap: 8px; margin-top: 18px; padding: 14px; background: var(--surface); border-radius: 8px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-links { margin-top: 14px; }
.register-wrap { min-height: 100vh; display: grid; place-items: center; grid-template-columns: 1fr; padding: 24px; background: linear-gradient(90deg, rgba(11, 35, 25, .86), rgba(11, 35, 25, .62)), url("https://images.unsplash.com/photo-1625246333195-78d9c38ad449?auto=format&fit=crop&w=1600&q=80") center/cover; }
.register-wrap .login-hero { display: none; }
.register-panel { width: min(960px, 100%); align-content: center; padding: 22px; background: rgba(255,255,255,.98); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 22px 70px rgba(10, 28, 20, .24); }
.register-panel .brand { justify-content: center; margin-bottom: 14px; text-align: left; }
.register-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.register-form label { gap: 6px; margin-bottom: 0; font-size: .84rem; }
.register-form input, .register-form select, .register-form textarea { min-height: 36px; padding: 7px 10px; }
.register-form textarea { height: 36px; resize: none; }
.register-submit { grid-column: 1 / -1; min-height: 40px; }
.register-panel .auth-links { justify-content: center; margin-top: 12px; }
.profile-panel, .form-panel { max-width: 920px; }
.profile-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.profile-form label { margin-bottom: 0; }
.profile-form .wide { grid-column: 1 / -1; }
.profile-form textarea { min-height: 86px; resize: vertical; }
.response-box { display: grid; gap: 8px; margin-top: 16px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-soft); }

@media (max-width: 980px) {
  .shell, .login-wrap, .two, .stats { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 16px; }
  .brand { margin-bottom: 18px; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav a { min-height: 44px; }
  .stats { gap: 12px; }
  .card strong { font-size: 1.7rem; }
  .login-wrap { min-height: auto; }
  .login-hero { min-height: 320px; align-content: end; }
  .login-hero h1 { font-size: clamp(2.2rem, 8vw, 4rem); line-height: 1; }
  .login-panel { padding: 24px; }
  .panel { padding: 16px; }
  .actions .btn { flex: 1 1 180px; }
  .register-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-form { grid-template-columns: 1fr; }
  .profile-form .wide { grid-column: auto; }
}

@media (max-width: 640px) {
  .content, .login-panel, .login-hero { padding: 18px; }
  .sidebar { padding: 14px; }
  .nav { grid-template-columns: 1fr; }
  .topline, .panel-head { align-items: stretch; flex-direction: column; }
  .topline .actions, .panel-head .actions, .auth-links, .actions { width: 100%; }
  .actions .btn { width: 100%; flex: 1 1 auto; }
  .card, .panel, .register-panel { border-radius: 8px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  th, td { padding: 12px 8px; }
  h1 { font-size: 1.2rem; }
  h2 { font-size: 1.2rem; }
  .login-hero { min-height: 260px; }
  .login-hero h1 { font-size: 2.2rem; }
  .login-panel { padding: 18px; }
  .register-wrap { min-height: auto; padding: 14px; }
  .register-panel { width: 100%; padding: 18px; }
  .register-form { grid-template-columns: 1fr; }
  .register-panel .brand, .register-panel .auth-links { justify-content: flex-start; }
  .demo-users { padding: 12px; }
}
