:root {
  --ink: #142F3D;
  --ink-soft: #58758A;
  --navy: #123D4D;
  --navy-deep: #0d303d;
  --line: #d9e1e4;
  --surface: #FFFFFF;
  --canvas: #FFFFFF;
  --mist: #edf1f0;
  --green: #123D4D;
  --green-soft: #eaf1f6;
  --amber-soft: #fff4db;
  --amber: #936719;
  --red: #a84242;
  --shadow: 0 18px 44px rgba(18, 55, 74, .10);
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--ink-soft); line-height: 1.55; }
.eyebrow { margin: 0 0 8px; color: var(--navy); font-size: .73rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.brand { align-items: center; display: inline-flex; gap: 10px; text-decoration: none; white-space: nowrap; font-size: .98rem; letter-spacing: .01em; }
.brand strong { font-weight: 700; }
.brand-logo { display: block; height: auto; max-width: min(100%, 680px); object-fit: contain; width: auto; }
.brand-logo-header { height: 80px; max-width: 380px; transform: scale(2); transform-origin: left center; }
.brand-mark { align-items: center; background: var(--navy); color: white; display: inline-flex; font-family: "DM Sans", sans-serif; font-size: 1.05rem; font-weight: 700; height: 30px; justify-content: center; width: 30px; }

.screen { min-height: 100vh; }
.login-screen { background: #FFFFFF; color: #142F3D; display: grid; grid-template-columns: minmax(360px, 520px) 1fr; }
.login-panel { align-self: center; background: transparent; box-shadow: none; margin: 8vh auto; max-width: 760px; padding: clamp(28px, 5vw, 56px) 0 0; width: min(calc(100% - 48px), 760px); }
.brand-login { align-items: center; display: flex; justify-content: center; margin-bottom: 24px; position: relative; top: -48px; width: 100%; }
.brand-login .brand-logo { height: 110px; margin-inline: auto; max-width: 250px; object-fit: cover; object-position: center; width: 250px; }
.login-panel { font-family: "Inter", sans-serif; }
.login-screen .eyebrow, .login-screen label { color: #142F3D; }
.login-screen .eyebrow { font-size: 15px; font-weight: 600; letter-spacing: 1.2px; line-height: 1.2; margin-bottom: 16px; }
.login-screen .muted { color: #142F3D; }
.login-panel h1 { font-family: "Manrope", sans-serif; font-size: clamp(2.4rem, 5vw, 52px); font-weight: 700; letter-spacing: -1.2px; line-height: 1.05; margin: 0 0 16px; }
.login-panel .muted { font-size: clamp(1.05rem, 2vw, 19px); font-weight: 400; line-height: 1.5; margin: 0 0 34px; }
.login-screen .icon-button { color: #142F3D; }
.login-screen .form-stack input { background: #FFFFFF; border-color: #123D4D; color: #142F3D; }
.login-screen .form-stack label { font-size: 16px; font-weight: 600; line-height: 1.25; }
.login-screen .form-stack input { font-size: 18px; font-weight: 400; line-height: 1.4; }
.login-screen .button-primary { background: #123D4D; font-family: "Inter", sans-serif; font-size: 17px; font-weight: 600; }
.login-screen .button-primary:hover { background: #0d303d; }
.page-heading h1 { font-family: "DM Sans", sans-serif; letter-spacing: 0; }
.login-aside { background: var(--navy-deep); position: relative; overflow: hidden; }
.login-video, .login-video-overlay { height: 100%; inset: 0; position: absolute; width: 100%; }
.login-video { object-fit: cover; }
.login-video-overlay { background: rgba(7, 25, 35, .78); }

.app-header { align-items: center; background: var(--navy-deep); border-bottom: 1px solid var(--navy-deep); color: #FFFFFF; display: grid; gap: 28px; grid-template-columns: 1fr auto; min-height: 70px; padding: 0 clamp(20px, 5vw, 72px); }
.main-nav { align-items: stretch; display: flex; gap: 24px; height: 70px; }
.main-nav a { align-items: center; border-bottom: 3px solid transparent; color: rgba(255,255,255,.78); display: inline-flex; font-size: .9rem; font-weight: 600; padding: 3px 2px 0; text-decoration: none; }
.main-nav a:hover, .main-nav a:focus-visible, .main-nav a.active { border-color: #FFFFFF; color: #FFFFFF; }
.header-user { align-items: center; display: flex; gap: 18px; justify-content: flex-end; }
#current-user { color: rgba(255,255,255,.82); font-size: .85rem; }

.view { margin: 0 auto; max-width: 1440px; padding: clamp(34px, 5vw, 72px) clamp(20px, 5vw, 72px) 80px; }
.shipments-toolbar { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 18px; }
.table-toolbar { align-items: center; display: flex; gap: 12px; justify-content: flex-end; margin-bottom: 10px; }
.table-toolbar label { color: var(--ink); font-size: .84rem; font-weight: 700; }
.table-toolbar select { background: white; border: 1px solid var(--navy); color: var(--ink); min-height: 42px; min-width: 220px; padding: 0 12px; }
.page-heading { align-items: flex-end; display: flex; gap: 28px; justify-content: space-between; margin-bottom: 42px; }
.page-heading h1 { font-size: clamp(2.1rem, 4vw, 3.5rem); line-height: 1; margin: 0 0 10px; }
.page-heading .muted { margin: 0; }
.button { align-items: center; border: 1px solid transparent; cursor: pointer; display: inline-flex; font-size: .88rem; font-weight: 700; justify-content: center; min-height: 42px; padding: 0 18px; text-decoration: none; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .icon-button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(18,55,74,.25); outline-offset: 2px; }
.button-primary { background: var(--navy); color: white; }
.button-primary:hover { background: var(--navy-deep); }
.button-secondary { background: white; border-color: var(--line); color: var(--ink); }
.button-secondary:hover { border-color: var(--navy); }
.button-quiet { background: transparent; color: var(--ink-soft); min-height: 34px; padding: 0 4px; }
.button-quiet:hover { color: var(--ink); }
.app-header .button-quiet { color: rgba(255,255,255,.82); }
.app-header .button-quiet:hover { color: #FFFFFF; }
.button-wide { width: 100%; }
.text-link, .text-button { background: none; border: 0; color: var(--navy); cursor: pointer; font-size: .84rem; font-weight: 700; padding: 0; text-decoration: none; }
.text-link:hover, .text-button:hover { text-decoration: underline; }

.stat-grid { display: grid; gap: 1px; grid-template-columns: repeat(4, 1fr); margin-bottom: 54px; background: var(--line); border: 1px solid var(--line); }
.stat { background: var(--surface); min-height: 142px; padding: 24px; }
.stat-label { color: var(--ink-soft); display: block; font-size: .8rem; font-weight: 600; margin-bottom: 22px; }
.stat-value { font-family: "DM Sans", sans-serif; font-size: 2.35rem; font-weight: 700; }
.stat[data-tone="green"] .stat-value { color: var(--navy); }
.stat[data-tone="amber"] .stat-value { color: var(--navy); }
.dashboard-lower { display: grid; gap: 56px; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr); }
.section-heading { align-items: end; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; margin-bottom: 0; padding-bottom: 15px; }
.section-heading h2 { font-family: "DM Sans", sans-serif; font-size: 1.25rem; margin: 0; }
.recent-list { background: var(--surface); }
.recent-item { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 18px; justify-content: space-between; padding: 17px 4px; }
.recent-item:last-child { border-bottom: 0; }
.recent-title { font-weight: 700; }
.recent-meta { color: var(--ink-soft); font-size: .82rem; margin-top: 4px; }
.operations-note { border-left: 3px solid var(--navy); padding: 4px 0 4px 22px; }
.operations-note strong { display: block; font-size: 1.1rem; line-height: 1.35; margin-bottom: 12px; }
.operations-note p { margin: 0 0 20px; }

.table-wrap { background: var(--surface); border: 1px solid var(--navy); overflow-x: auto; }
table { border-collapse: collapse; min-width: 760px; width: 100%; }
th, td { border-bottom: 1px solid var(--navy); padding: 17px 20px; text-align: left; }
th { background: var(--navy); color: white; font-size: .72rem; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
td { font-size: .9rem; }
tbody tr:nth-child(even) { background: #f7f9f8; }
tbody tr:hover { background: #eef5f1; }
tbody tr:last-child td { border-bottom: 0; }
.action-column { text-align: center; width: 190px; }
.row-actions { align-items: center; display: flex; gap: 8px; justify-content: center; }
.tracking-row-button { align-items: center; border: 1px solid var(--navy); color: var(--navy); display: inline-flex; font-size: .76rem; font-weight: 700; min-height: 34px; padding: 0 10px; text-decoration: none; white-space: nowrap; }
.tracking-row-button:hover { background: var(--navy); color: white; }
.view-row-button, .edit-row-button, .delete-row-button { align-items: center; background: transparent; border: 1px solid transparent; color: var(--navy); cursor: pointer; display: inline-flex; font-size: 1.1rem; height: 34px; justify-content: center; width: 34px; }
.view-row-button:hover, .edit-row-button:hover, .delete-row-button:hover { border-color: var(--line); background: white; }
.delete-row-button { color: var(--red); }
.empty-row { color: var(--ink-soft); padding: 48px 20px; text-align: center; }
.row-highlight { background: rgba(18, 55, 74, 0.14); box-shadow: inset 0 0 0 1px rgba(18, 55, 74, 0.18); transition: background .25s ease; }
.status { display: inline-block; font-size: .78rem; font-weight: 700; padding: 6px 10px; }
.status-received { background: var(--green-soft); color: var(--green); }
.status-pending { background: var(--amber-soft); color: var(--amber); }
.status-other { background: var(--mist); color: var(--ink-soft); }

.form-stack { display: flex; flex-direction: column; gap: 9px; }
.form-stack label { font-size: .83rem; font-weight: 700; margin-top: 8px; }
.form-stack input, .form-stack select { background: white; border: 1px solid #cbd6d9; border-radius: 0; color: var(--ink); min-height: 44px; padding: 0 12px; width: 100%; }
.form-stack #tracking-carrier { margin-top: -2px; }
.form-stack input::placeholder { color: #9aa7ad; }
.form-stack input[type="file"] { padding: 9px 10px; }
.password-field { display: flex; position: relative; }
.password-field input { padding-right: 48px; }
.password-field .icon-button { position: absolute; right: 4px; top: 4px; }
.icon-button { align-items: center; background: transparent; border: 0; color: var(--ink-soft); cursor: pointer; display: inline-flex; font-size: 1.35rem; height: 36px; justify-content: center; width: 36px; }
.modal-close { font-size: 1.8rem; }
.field-note { color: var(--ink-soft); font-size: .75rem; line-height: 1.4; margin-bottom: 2px; }
.required { color: var(--red); }
.form-message { font-size: .84rem; line-height: 1.45; margin: 8px 0 0; }
.form-message.error { color: var(--red); }
.form-message.success { color: var(--green); }
.app-message { border-left: 3px solid var(--navy); background: var(--green-soft); color: var(--navy); margin-bottom: 20px; padding: 12px 15px; }
.photo-preview { align-items: center; background: var(--mist); display: flex; gap: 14px; padding: 10px; }
.photo-preview img { height: 76px; object-fit: cover; width: 94px; }

.modal-backdrop { align-items: center; background: rgba(12, 37, 51, .58); display: flex; inset: 0; justify-content: center; padding: 20px; position: fixed; z-index: 10; }
.modal { background: var(--surface); box-shadow: var(--shadow); max-height: calc(100vh - 40px); max-width: 540px; overflow: auto; padding: clamp(24px, 4vw, 38px); width: 100%; }
.details-modal { max-width: 660px; }
.history-modal { max-width: 900px; }
.modal-header { align-items: start; display: flex; justify-content: space-between; margin-bottom: 22px; }
.modal-header h2 { font-family: "DM Sans", sans-serif; font-size: 1.65rem; margin: 0; }
.modal-actions { border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; margin-top: 25px; padding-top: 18px; }
.details-content { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
.history-content { overflow-x: auto; }
.history-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.history-toolbar select { background: white; border: 1px solid var(--navy); color: var(--ink); min-height: 42px; min-width: 230px; padding: 0 12px; }
.history-table { border-collapse: collapse; min-width: 680px; width: 100%; }
.history-table th, .history-table td { border-bottom: 1px solid var(--navy); padding: 12px 14px; text-align: left; vertical-align: top; }
.history-table th { background: var(--navy); color: white; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
.history-table td { font-size: .84rem; }
.history-table td:last-child { white-space: nowrap; }
.history-empty { color: var(--ink-soft); padding: 36px 12px; text-align: center; }
.detail-item { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.detail-item.full { grid-column: 1 / -1; }
.detail-label { color: var(--ink-soft); display: block; font-size: .74rem; font-weight: 700; margin-bottom: 5px; text-transform: uppercase; }
.detail-value { font-size: .98rem; }
.detail-photo { background: var(--mist); grid-column: 1 / -1; min-height: 160px; padding: 12px; text-align: center; }
.detail-photo img { max-height: 330px; max-width: 100%; object-fit: contain; }
.detail-photo img { cursor: zoom-in; transition: max-height .2s ease; }
.detail-photo img.is-enlarged { max-height: none; width: 100%; }
.detail-photo p { color: var(--ink-soft); margin: 60px 0; }

@media (max-width: 820px) {
  .login-screen { display: block; }
  .login-panel { margin: 0 auto; min-height: 100vh; width: min(100% - 32px, 440px); }
  .login-aside { display: none; }
  .app-header { gap: 10px 18px; grid-template-columns: 1fr auto; padding: 12px 20px; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; height: 42px; justify-content: space-between; }
  .main-nav a { flex: 1; justify-content: center; }
  .header-user { gap: 10px; }
  #current-user { display: none; }
  .page-heading { align-items: start; flex-direction: column; gap: 20px; }
  .page-heading .button { width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-lower { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
.app-screen { font-family: "Inter", sans-serif; }
.app-screen .main-nav a,
.app-screen .header-user,
.app-screen #current-user,
.app-screen .button-quiet { font-family: "Inter", sans-serif; font-size: 16px; font-weight: 600; }
.app-screen .main-nav a.active { font-weight: 700; }
.app-screen .page-heading h1 { font-family: "Manrope", sans-serif; font-size: clamp(48px, 5vw, 52px); font-weight: 700; letter-spacing: -1.2px; line-height: 1.1; }
.app-screen .eyebrow { font-family: "Inter", sans-serif; font-size: 14px; font-weight: 600; letter-spacing: 1px; line-height: 1.2; }
.app-screen .page-heading .muted { font-family: "Inter", sans-serif; font-size: 18px; font-weight: 400; line-height: 1.5; }
.app-screen .stat-label { font-family: "Inter", sans-serif; font-size: 16px; font-weight: 600; line-height: 1.3; }
.app-screen .stat-value { font-family: "Manrope", sans-serif; font-size: 50px; font-weight: 700; line-height: 1; }
.app-screen .section-heading h2,
.app-screen .recent-title { font-family: "Manrope", sans-serif; font-size: 22px; font-weight: 700; line-height: 1.2; }
.app-screen .text-link { font-family: "Manrope", sans-serif; font-size: 20px; font-weight: 700; line-height: 1.2; }
.app-screen .recent-meta,
.app-screen .operations-note p { font-family: "Inter", sans-serif; font-size: 16px; font-weight: 400; line-height: 1.5; }
.app-screen .operations-note strong { font-family: "Manrope", sans-serif; font-size: 22px; font-weight: 700; line-height: 1.25; }
.app-screen th { font-family: "Inter", sans-serif; font-size: 14px; font-weight: 700; letter-spacing: .04em; }
.app-screen td { font-family: "Inter", sans-serif; font-size: 16px; font-weight: 400; line-height: 1.4; }
.app-screen tbody td:first-child { font-weight: 600; }
.app-screen .status { font-family: "Inter", sans-serif; font-size: 15px; font-weight: 600; line-height: 1.2; }
.app-screen #new-shipment-button { font-family: "Inter", sans-serif; font-size: 16px; font-weight: 700; }
  .view { padding: 32px 16px 60px; }
  .stat { min-height: 116px; padding: 16px; }
  .stat-label { margin-bottom: 14px; }
  .stat-value { font-size: 1.8rem; }
  .details-content { grid-template-columns: 1fr; }
  .detail-item.full, .detail-photo { grid-column: auto; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
}
