/* Tabello-aligned personnel UI (navy / Roboto / Material-ish surfaces) */

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/roboto-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/roboto-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/roboto-latin-ext-500.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/roboto-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/roboto-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/roboto-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #1e2d46;
  --navy-deep: #152033;
  --ink: #1e2d46;
  --muted: #5c6b7a;
  --line: #e0e4ea;
  --bg: #fafafa;
  --panel: #ffffff;
  --accent: #1e2d46;
  --accent-hover: #152033;
  --danger: #b3261e;
  --success-bg: #e8f5e9;
  --success-line: #c8e6c9;
  --error-bg: #fdecea;
  --error-line: #f5c2c0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(30, 45, 70, 0.08), 0 1px 2px rgba(30, 45, 70, 0.06);
  --shadow-lg: 0 8px 24px rgba(30, 45, 70, 0.12);
  --font: Roboto, "Helvetica Neue", sans-serif;
  --header-h: 56px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--navy);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0 1.25rem;
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
}
.brand-logo {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; opacity: 0.92; }
.brand span {
  font-weight: 400;
  opacity: 0.72;
  margin-left: 0.15rem;
  font-size: 0.92rem;
}

nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.92rem;
}
nav a:hover,
nav a:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
  color: #fff;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

h1, h2 {
  font-weight: 500;
  color: var(--navy);
  margin: 0 0 0.5rem;
}
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }

.lede {
  color: var(--muted);
  max-width: 40rem;
  margin: 0 0 1rem;
}

.flash {
  list-style: none;
  padding: 0;
  margin: 0.75rem auto 0;
  max-width: 1100px;
  width: calc(100% - 2rem);
}
.flash li {
  background: var(--success-bg);
  border: 1px solid var(--success-line);
  color: #1b5e20;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
}
.flash .error {
  background: var(--error-bg);
  border-color: var(--error-line);
  color: #8a1c16;
}

.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

.stack { display: grid; gap: 0.85rem; max-width: 28rem; }
.stack label,
.filters label,
.stack p {
  display: grid;
  gap: 0.3rem;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
  margin: 0;
}
.stack p label { display: contents; }

input,
select,
textarea,
button,
.button {
  font: inherit;
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(30, 45, 70, 0.25);
  outline-offset: 1px;
  border-color: var(--navy);
}

button,
.button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
button:hover,
.button:hover {
  background: var(--accent-hover);
  text-decoration: none;
  color: #fff;
}
.button.secondary,
button.secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}
.button.secondary:hover,
button.secondary:hover {
  background: #eef1f5;
  color: var(--navy);
}
button.danger,
.danger button {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
button.linkish {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.88);
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.92rem;
}
button.linkish:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.totals div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}
.totals span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.totals strong {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--navy);
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
th, td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.9rem;
  white-space: nowrap;
}
th {
  background: #f0f2f5;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f7f8fa; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem;
  background:
    linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 42%, #2a4060 100%);
}
.login {
  width: 100%;
  max-width: 24rem;
  padding: 2rem 1.75rem;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.login h1 {
  margin-bottom: 0.25rem;
}
.login .brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.login .brand-mark img {
  width: 18px;
  height: 18px;
  display: block;
}
.login button { width: 100%; margin-top: 0.35rem; }
button.pwa-install[hidden],
.ios-hint[hidden] { display: none !important; }
.top button.pwa-install {
  background: rgba(255, 255, 255, 0.12);
  border-color: transparent;
  color: #fff;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}
.login button.pwa-install {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}
.ios-hint {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.customer {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.customer h2 { margin-bottom: 0.5rem; }
.customer ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink);
}
.customer li { margin: 0.35rem 0; }
.customer .linkish {
  color: var(--danger);
  padding: 0 0.25rem;
}
.customer .linkish:hover {
  background: transparent;
  text-decoration: underline;
}

.inline { display: inline; }
.inline-form { margin-bottom: 1.5rem; }
.form.danger,
form.danger { margin-top: 2rem; }

@media (max-width: 640px) {
  .top {
    padding: 0.55rem 0.85rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }
  nav {
    width: 100%;
    gap: 0.15rem;
  }
  nav a,
  button.linkish {
    padding: 0.45rem 0.55rem;
  }
  main { padding: 1rem 0.85rem 2rem; }
  .row.between {
    flex-direction: column;
    align-items: stretch;
  }
  .row.between .button { text-align: center; }
  .filters {
    padding: 0.85rem;
  }
  .filters label { width: 100%; }
  .filters select,
  .filters button,
  .filters .button {
    width: 100%;
  }
  .login { padding: 1.5rem 1.25rem; }
}
