/* NMT Customer Portal - dark theme matching the NMG internal portal */
:root {
  --bg: #2b2b2b;
  --bg-2: #232323;
  --card: #262626;
  --card-2: #2f2f2f;
  --line: #3a3a3a;
  --line-2: #474747;
  --input: #1d1d1d;
  --text: #ececec;
  --muted: #a4a4a4;
  --accent: #f07c3c;
  --accent-2: #e8603c;
  --accent-soft: rgba(240, 124, 60, .14);
  --red: #e0483a;
  --green: #3fb27f;
  --blue: #4c8ff0;
  --purple: #a678e6;
  --yellow: #e9b949;
  --radius: 18px;
  --radius-sm: 12px;
  --grad: linear-gradient(90deg, #f0883e, #e8603c);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 50% -10%, #353535, var(--bg) 60%) fixed, var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; margin: 0 0 12px; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---------- layout ---------- */
.wrap { max-width: 1360px; margin: 0 auto; padding: 24px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 26px; margin-bottom: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.card.accent { border-color: var(--accent); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; color: var(--text); }
.card-head .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
#search-form { flex-wrap: nowrap; }
#search-form input { flex: 1; min-width: 0; }

/* ---------- header ---------- */
.topbar { display: flex; align-items: center; gap: 18px; padding: 18px 28px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none !important; }
.brand img.logo { height: 46px; width: auto; }
.brand .mark { width: 30px; height: 40px; }
.brand .title { font-size: 30px; font-weight: 300; letter-spacing: .2px; color: #d9d9d9; }
.brand .title b { font-weight: 600; color: var(--accent); }
.topbar .spacer { flex: 1; }
.welcome { color: var(--accent); font-weight: 600; }
.badge-role {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 12px; border-radius: 999px; background: var(--red); color: #ffd7c9;
}
.company { color: var(--muted); font-size: 13px; }
nav.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
nav.tabs a {
  padding: 9px 16px; border-radius: 12px; border: 1px solid var(--line-2); color: var(--text);
  background: var(--card); font-size: 14px; text-decoration: none;
}
nav.tabs a.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--card-2); color: var(--text);
  padding: 9px 16px; border-radius: 12px; font: inherit; font-size: 14px; text-decoration: none !important;
}
.btn:hover { border-color: #5a5a5a; background: #353535; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.red { background: var(--red); border-color: transparent; color: #fff; font-weight: 600; }
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

/* ---------- forms ---------- */
label.f { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; color: #dcdcdc; }
label.f .req { color: var(--accent); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=time], input[type=search],
select, textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--input); color: var(--text); font: inherit; font-size: 14px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.field { margin-bottom: 14px; }
.field .err, .err-msg { color: #ff8a7a; font-size: 12.5px; margin-top: 4px; }
.field.bad input, .field.bad select, .field.bad textarea { border-color: #ff6b5a; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px 6px; margin: 0 0 18px; }
legend { padding: 0 8px; font-weight: 600; color: var(--accent); }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: 6px 0 12px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #2d2d2d; font-weight: 600; color: #d6d6d6; white-space: nowrap; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: #2e2e2e; }
td.num, th.num { text-align: right; }
.lines-table input, .lines-table select { padding: 8px 10px; font-size: 13.5px; }
.lines-table td { padding: 8px; }
.lines-table .dims { display: flex; gap: 6px; align-items: center; }
.lines-table .dims input { width: 72px; }

/* ---------- status ---------- */
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid; }
.status.s-submitted { color: #cfcfcf; border-color: #6a6a6a; background: #333; }
.status.s-booked { color: #9cc2ff; border-color: #3b6db8; background: rgba(76, 143, 240, .12); }
.status.s-transit { color: #ffb489; border-color: var(--accent); background: var(--accent-soft); }
.status.s-delivered { color: #8ee0b9; border-color: #2f8b62; background: rgba(63, 178, 127, .12); }
.status.s-invoiced { color: #d2b8ff; border-color: #7b55b5; background: rgba(166, 120, 230, .12); }
.status.s-cancelled { color: #ffa597; border-color: #a8392d; background: rgba(224, 72, 58, .12); }
.last-action { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---------- notices ---------- */
.notice { border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 16px; border: 1px solid; font-size: 14px; }
.notice.warn { border-color: #b8862a; background: rgba(233, 185, 73, .1); color: #f3d793; }
.notice.error { border-color: #a8392d; background: rgba(224, 72, 58, .12); color: #ffb3a8; }
.notice.ok { border-color: #2f8b62; background: rgba(63, 178, 127, .12); color: #a6ecc9; }
.notice.info { border-color: var(--line-2); background: #2c2c2c; color: #d8d8d8; }
.notice h3 { margin: 0 0 6px; color: inherit; }

/* ---------- key/value ---------- */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.panel { background: #2a2a2a; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.panel h3 { color: var(--accent); }
.big-id { font-size: 26px; font-weight: 600; letter-spacing: .5px; }

/* ---------- dropzone ---------- */
.dropzone {
  border: 2px dashed var(--line-2); border-radius: var(--radius-sm); padding: 22px; text-align: center; color: var(--muted);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.file-list { list-style: none; margin: 12px 0 0; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; font-size: 14px; }
.file-list li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 450px; background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 40px 48px 36px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); text-align: center;
}
.login-card .heading { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 8px; }
.login-card .heading .mark { width: 30px; height: 40px; }
.login-card .heading h1 { font-size: 36px; font-weight: 300; color: var(--accent); margin: 0; }
.login-card .sub { color: #cfcfcf; margin: 0 0 26px; }
.login-card form { text-align: left; }
.login-card .field input { padding: 14px 16px; }
.login-card .foot { margin-top: 18px; font-size: 14px; }
.login-logo { height: 34px; margin-bottom: 6px; }

/* ---------- toast ---------- */
#toast { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
#toast .t { background: #333; border: 1px solid var(--line-2); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 10px; min-width: 240px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
#toast .t.err { border-left-color: var(--red); }

.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.spinner { width: 18px; height: 18px; border: 2px solid #555; border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.history li { margin-bottom: 8px; }
.history pre { margin: 2px 0 0; font: inherit; white-space: pre-wrap; color: #d8d8d8; }
.admin-dev { font-size: 12px; color: var(--muted); }

@media (max-width: 720px) {
  .wrap { padding: 12px; }
  .card { padding: 16px; }
  .brand .title { font-size: 22px; }
  .login-card { padding: 28px 22px; }
  .hide-sm { display: none; }
}
