:root {
  --ink: #0b1936;
  --ink-soft: #12244f;
  --fog: #d7e0ea;
  --paper: #f3f6f9;
  --muted: #6b7a8d;
  --accent: #1e6cff;
  --accent-deep: #1557d6;
  --line: rgba(215, 224, 234, 0.18);
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
}

.hidden { display: none !important; }

/* ── Login page (Cardflo-inspired split layout) ── */

.login-body {
  min-height: 100vh;
  background: #f7f9fc;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 0.95fr);
  min-height: 100vh;
}

.login-brand {
  position: relative;
  display: flex;
  align-items: center;
  padding: 48px clamp(28px, 5vw, 72px);
  color: var(--paper);
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(30, 108, 255, 0.28), transparent 55%),
    radial-gradient(700px 420px at 90% 100%, rgba(11, 25, 54, 0.4), transparent 50%),
    linear-gradient(165deg, #071018 0%, var(--ink) 45%, #12244f 100%);
  overflow: hidden;
}

.login-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 480px;
}

.login-brand-glow {
  position: absolute;
  width: 52vmin;
  height: 52vmin;
  right: -8%;
  bottom: 10%;
  border-radius: 38% 62% 45% 55% / 52% 42% 58% 48%;
  border: 1px solid rgba(215, 224, 234, 0.14);
  background: radial-gradient(circle at 30% 30%, rgba(30, 108, 255, 0.22), transparent 62%);
  pointer-events: none;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  margin-bottom: 36px;
  text-decoration: none;
  background: #fff;
  padding: 8px 12px;
  border-radius: 12px;
}

.brand-logo {
  display: block;
  height: 36px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.login-logo .brand-logo {
  height: 40px;
  max-width: 220px;
}

.app-brand .brand-logo {
  height: 32px;
  max-width: 180px;
}

.login-brand h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.login-brand > .login-brand-inner > p,
.login-brand-inner > p {
  margin: 0 0 28px;
  color: var(--fog);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 38ch;
}

.login-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.login-features li {
  position: relative;
  padding-left: 22px;
  color: rgba(243, 246, 249, 0.88);
  font-size: 0.95rem;
}

.login-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px clamp(24px, 4vw, 56px);
  background: #f7f9fc;
}

.login-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.login-back {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-back:hover { color: var(--accent-deep); }

.lang-switch {
  display: inline-flex;
  align-items: center;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  min-width: 112px;
  height: 36px;
  margin: 0;
  padding: 0 34px 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7a8d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lang-select:hover {
  border-color: #cbd5e1;
}

.lang-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 108, 255, 0.14);
}

.login-card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 36px 32px 32px;
  border: 1px solid #e8edf3;
  border-radius: 20px;
  background: #fff;
  box-shadow:
    0 24px 48px rgba(11, 18, 32, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.login-card-head {
  margin-bottom: 28px;
}

.login-card-head h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.login-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: #fbfcfd;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(30, 108, 255, 0.12);
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  padding-right: 72px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 0;
  bottom: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 10px;
  border-radius: 8px;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--accent-deep);
  background: rgba(30, 108, 255, 0.08);
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.86rem;
}

.login-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  box-shadow: 0 10px 24px rgba(30, 108, 255, 0.28);
}

.login-submit:hover {
  transform: translateY(-1px);
  background: var(--accent-deep);
  box-shadow: 0 14px 28px rgba(30, 108, 255, 0.32);
}

.login-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login-demo {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: #94a3b8;
}

.login-signup {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.login-signup a {
  color: var(--accent-deep);
  font-weight: 700;
  text-decoration: none;
}

.login-signup a:hover { text-decoration: underline; }

/* ── App dashboard (aligned with website / login tone) ── */

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 8% -20%, rgba(30, 108, 255, 0.1), transparent 55%),
    radial-gradient(700px 360px at 100% 0%, rgba(91, 140, 196, 0.08), transparent 50%),
    #f7f9fc;
  color: var(--ink);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--paper);
  padding: 0;
}

.app-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
  background: #fff;
  padding: 6px 10px;
  border-radius: 10px;
}

.app-menu-btn {
  display: none;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(215, 224, 234, 0.28);
  border-radius: 10px;
  background: transparent;
  color: var(--paper);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  align-self: stretch;
}

.app-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  margin: 0;
  padding: 0 14px;
  border-radius: 0;
  color: rgba(215, 224, 234, 0.72);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  background: transparent;
  transition: color 0.18s ease;
  white-space: nowrap;
}

.app-nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -14px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.18s ease, transform 0.18s ease;
  transform: scaleX(0.6);
  transform-origin: center;
}

.app-nav a:hover {
  color: #fff;
  background: transparent;
}

.app-nav a.active {
  color: #fff;
  font-weight: 600;
  background: transparent;
}

.app-nav a.active::after {
  background: var(--accent);
  transform: scaleX(1);
}

.app-header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  min-width: 0;
  justify-content: flex-end;
}

.app-header-titles {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.app-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--paper);
}

.app-user {
  font-size: 0.82rem;
  color: var(--fog);
  opacity: 0.88;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.app-shell .btn-outline {
  margin: 0;
  padding: 8px 16px;
  min-height: 36px;
  border: 1px solid rgba(215, 224, 234, 0.28);
  border-radius: 10px;
  background: transparent;
  color: var(--paper);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.app-shell .btn-outline:hover {
  border-color: var(--accent);
  background: rgba(30, 108, 255, 0.12);
  color: #fff;
}

.portal-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.page-header {
  margin-bottom: 20px;
}

.page-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.btn-ghost-light {
  margin: 0;
  padding: 10px 16px;
  min-height: 42px;
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn-ghost-light:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: rgba(30, 108, 255, 0.04);
}

.page-header h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.page-header .muted {
  margin: 0;
}

.entity-table {
  width: 100%;
  border-collapse: collapse;
}

.entity-table th,
.entity-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #eef2f7;
  font-size: 0.9rem;
}

.entity-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
}

.entity-table tr.is-current td {
  background: rgba(30, 108, 255, 0.04);
}

.pill-current {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(30, 108, 255, 0.12);
  color: var(--accent-deep);
  font-size: 0.75rem;
  font-weight: 700;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-btn {
  margin: 0 !important;
  min-height: 32px !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  border: 1px solid #d8e0ea !important;
  background: #fff !important;
  color: var(--ink) !important;
  box-shadow: none !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  width: auto !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
}

.mini-btn:hover {
  border-color: var(--accent) !important;
  color: var(--accent-deep) !important;
  transform: none !important;
  box-shadow: none !important;
  background: rgba(30, 108, 255, 0.04) !important;
}

.back-link {
  display: inline-flex;
  align-items: center;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--accent-deep);
}

.entity-edit-form {
  max-width: 560px;
}

a.btn-ghost-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(11, 25, 54, 0.45);
}

.modal-mask.hidden { display: none; }

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e8edf3;
  box-shadow: 0 24px 60px rgba(11, 25, 54, 0.2);
  padding: 22px 22px 20px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.modal-close {
  margin: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  grid-template-columns: none !important;
}

.check-row input {
  width: auto !important;
  min-height: 0 !important;
  margin: 0;
}

.portal-grid-2 {
  grid-template-columns: 1fr 1fr;
}

main.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.app-shell .card {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 18px;
  padding: 24px;
  box-shadow:
    0 18px 40px rgba(11, 18, 32, 0.05),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.app-shell .card h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.full { grid-column: 1 / -1; }

.entity-name {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.entity-meta {
  margin: 0;
  display: grid;
  gap: 10px;
}

.entity-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

.entity-meta dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.entity-meta dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: right;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.app-shell .form-stack label {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: inherit;
  color: inherit;
}

.app-shell .form-stack label > span {
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
}

.app-shell select,
.app-shell textarea,
.app-shell input:not([type="file"]),
.app-shell input[type="date"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: #fbfcfd;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.app-shell textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.app-shell select:focus,
.app-shell textarea:focus,
.app-shell input:not([type="file"]):focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(30, 108, 255, 0.12);
}

.form-msg {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.86rem;
}

.form-msg.ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.form-msg.err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.hint-list {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.7;
}

.hint-list li { margin-bottom: 6px; }

.subhead {
  margin: 18px 0 10px;
  font-size: 0.98rem;
  font-family: var(--font-display);
}

.muted.small {
  font-size: 0.82rem;
}

.app-shell .btn-accent,
.app-shell .btn-primary,
.app-shell button:not(.btn-outline):not(.password-toggle):not(.app-menu-btn) {
  margin-top: 4px;
  padding: 12px 20px;
  min-height: 46px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(30, 108, 255, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.app-shell .btn-accent:hover,
.app-shell .btn-primary:hover,
.app-shell button:not(.btn-outline):not(.password-toggle):not(.app-menu-btn):hover {
  transform: translateY(-1px);
  background: var(--accent-deep);
  box-shadow: 0 14px 26px rgba(30, 108, 255, 0.28);
}

.app-shell .muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 8px 0 16px;
  border: 1px solid #e8edf3;
  border-radius: 14px;
}

.app-shell table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.app-shell th,
.app-shell td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #eef2f7;
  font-size: 0.9rem;
  vertical-align: middle;
}

.app-shell th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.app-shell tbody tr:last-child td { border-bottom: none; }

.app-shell tbody tr:hover td { background: #f8fbfb; }

.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-NOT_STARTED { background: #fee2e2; color: #991b1b; }
.status-UPLOADED { background: #fef3c7; color: #92400e; }
.status-APPROVED { background: #d1fae5; color: #065f46; }
.status-REJECTED { background: #fecaca; color: #7f1d1d; }
.status-DRAFT { background: #e2e8f0; color: #334155; }
.status-SUBMITTED { background: #dbeafe; color: #1e40af; }
.status-IN_REVIEW { background: #e0e7ff; color: #3730a3; }
.status-PENDING { background: #fef3c7; color: #92400e; }
.status-SCANNING { background: #dbeafe; color: #1e40af; }
.status-DONE, .status-COMPLETED, .status-SUCCESS { background: #d1fae5; color: #065f46; }
.status-FAILED, .status-ERROR { background: #fecaca; color: #7f1d1d; }

.progress-bar {
  height: 10px;
  background: #e8edf3;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 10px;
}

#progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.completeness {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.completeness strong { color: var(--accent-deep); }

.app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #e8edf3;
  border-radius: 14px;
  margin-bottom: 10px;
  background: #fbfcfd;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.app-row:last-child { margin-bottom: 0; }

.app-row:hover {
  border-color: rgba(30, 108, 255, 0.45);
  background: #fff;
  box-shadow: 0 8px 20px rgba(30, 108, 255, 0.08);
}

.app-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.app-row-main strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.app-row-no {
  color: var(--muted);
  font-size: 0.82rem;
}

.app-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.app-row-pct {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent-deep);
  font-size: 0.95rem;
  min-width: 3ch;
  text-align: right;
}

.app-shell input[type=file] {
  font-size: 0.8rem;
  max-width: 100%;
  min-height: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.app-shell .checklist-expiry {
  max-width: 160px;
  margin: 0;
}

@media (max-width: 960px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: auto;
    padding: 40px 28px 36px;
  }

  .login-brand h1 {
    font-size: 1.65rem;
  }

  .login-features {
    display: none;
  }

  .login-panel {
    padding: 0 20px 40px;
    margin-top: -12px;
  }

  .login-panel-top {
    margin-bottom: 16px;
  }

  .login-card {
    padding: 28px 22px 24px;
    border-radius: 18px;
  }
}

@media (max-width: 900px) {
  .app-header-inner {
    padding: 14px 16px;
    gap: 12px;
  }

  .app-menu-btn { display: inline-flex; }

  .app-nav {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(100% + 8px);
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(11, 18, 32, 0.96);
    z-index: 50;
  }

  .app-nav.open { display: flex; }

  .app-nav a {
    height: auto;
    padding: 10px 12px;
    border-radius: 8px;
    justify-content: flex-start;
    text-align: left;
  }

  .app-nav a::after { display: none; }

  .app-nav a.active {
    color: #fff;
    background: rgba(30, 108, 255, 0.14);
    box-shadow: inset 2px 0 0 var(--accent);
  }

  .app-header {
    position: sticky;
  }

  .app-header-inner {
    position: relative;
  }

  .app-header-meta {
    margin-left: auto;
  }

  .app-user {
    max-width: 36vw;
  }

  .portal-main {
    padding: 16px 12px 28px;
  }

  main.grid,
  .portal-grid-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .app-shell .card {
    padding: 18px;
    border-radius: 16px;
  }

  .app-shell .btn-accent,
  .app-shell .btn-primary,
  .app-shell button:not(.btn-outline):not(.password-toggle):not(.app-menu-btn) {
    width: 100%;
  }

  .app-row {
    flex-direction: column;
    align-items: flex-start;
  }

  #checklist-table { min-width: 520px; font-size: 13px; }
  .app-shell th,
  .app-shell td { padding: 10px 8px; vertical-align: top; }
  .app-shell input[type="date"] { min-height: 40px; }
}
