:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #eef6f5;
  --ink: #17212b;
  --muted: #647181;
  --line: #d8dee6;
  --line-strong: #bcc6d1;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --coral: #c2410c;
  --coral-soft: #fff1eb;
  --green: #15803d;
  --green-soft: #e8f7ed;
  --amber: #a16207;
  --amber-soft: #fff7da;
  --red: #b42318;
  --red-soft: #fff0ee;
  --blue: #245c9e;
  --blue-soft: #ebf3ff;
  --shadow: 0 12px 34px rgba(23, 33, 43, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(238, 246, 245, 0.65), rgba(246, 247, 249, 0) 360px),
    var(--bg);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sprite {
  display: none;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app {
  min-height: 100vh;
}

.loginShell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.loginPanel {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 20px;
  align-items: stretch;
}

.brandPanel,
.loginCard,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brandPanel {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.13), rgba(194, 65, 12, 0.08)),
    var(--panel);
}

.brandMark {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--teal);
  margin-bottom: 20px;
}

.brandPanel h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

.brandPanel p {
  color: var(--muted);
  max-width: 34rem;
  line-height: 1.65;
  margin: 18px 0 0;
}

.brandStats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 30px;
}

.statTile {
  border: 1px solid rgba(15, 118, 110, 0.22);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 12px;
}

.statTile strong {
  display: block;
  font-size: 22px;
}

.statTile span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.loginCard {
  padding: 24px;
}

.loginCard h2,
.panel h2,
.viewTitle h1 {
  margin: 0;
  letter-spacing: 0;
}

.loginCard h2 {
  font-size: 24px;
}

.loginCard .hint {
  margin: 8px 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.accountGrid {
  display: grid;
  gap: 10px;
}

.accountButton {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
}

.accountButton:hover,
.accountButton:focus-visible {
  border-color: var(--teal);
  outline: none;
}

.accountButton.selected {
  border-color: var(--teal);
  background: var(--panel-soft);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
  font-weight: 800;
}

.avatar.manager {
  background: var(--coral);
}

.avatar.admin {
  background: var(--ink);
}

.accountMeta {
  min-width: 0;
}

.accountMeta strong,
.accountMeta span {
  display: block;
}

.accountMeta span {
  color: var(--muted);
  margin-top: 2px;
  font-size: 13px;
}

.pinArea {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 18px;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbarInner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 14px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}

.productName {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  min-width: max-content;
}

.miniMark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: white;
}

.nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.navButton,
.button,
.ghostButton,
.dangerButton,
.smallButton,
.iconOnly {
  border-radius: 8px;
  min-height: 40px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  white-space: nowrap;
}

.navButton {
  background: transparent;
  padding: 8px 10px;
  color: var(--muted);
}

.navButton.active {
  color: var(--teal-dark);
  background: var(--panel-soft);
}

.button {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
  padding: 9px 14px;
  font-weight: 700;
}

.button.secondary {
  background: var(--blue);
  border-color: var(--blue);
}

.ghostButton {
  background: white;
  border-color: var(--line);
  padding: 9px 14px;
}

.dangerButton {
  background: var(--red);
  color: white;
  border-color: var(--red);
  padding: 9px 14px;
}

.smallButton {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  background: #fff;
  border-color: var(--line);
}

.iconOnly {
  width: 40px;
  height: 40px;
  padding: 0;
  background: white;
  border-color: var(--line);
}

.userBox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.userBoxText {
  text-align: right;
}

.userBoxText strong,
.userBoxText span {
  display: block;
}

.userBoxText span {
  color: var(--muted);
  font-size: 13px;
}

.content {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 22px 20px 48px;
}

.viewHeader {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.viewTitle h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
}

.viewTitle p {
  margin: 6px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.panel {
  padding: 18px;
  box-shadow: none;
}

.panel h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

.span4 {
  grid-column: span 4;
}

.span5 {
  grid-column: span 5;
}

.span6 {
  grid-column: span 6;
}

.span7 {
  grid-column: span 7;
}

.span8 {
  grid-column: span 8;
}

.span12 {
  grid-column: span 12;
}

.kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kpi .value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.kpi .label {
  color: var(--muted);
  margin-top: 5px;
}

.metricTile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.statusPill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
  width: fit-content;
}

.status-normal,
.status-approved {
  background: var(--green-soft);
  color: var(--green);
}

.status-late,
.status-early,
.status-mixed,
.status-pending,
.status-in_progress {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-missing,
.status-rejected,
.status-outside {
  background: var(--red-soft);
  color: var(--red);
}

.status-info {
  background: var(--blue-soft);
  color: var(--blue);
}

.heroClock {
  display: grid;
  gap: 16px;
  min-height: 260px;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(36, 92, 158, 0.07)),
    var(--panel);
}

.clockTime {
  font-size: clamp(40px, 8vw, 76px);
  font-weight: 850;
  line-height: 1;
}

.clockDate {
  color: var(--muted);
  font-size: 16px;
}

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

.infoList {
  display: grid;
  gap: 10px;
}

.infoItem {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.infoItem:last-child {
  border-bottom: 0;
}

.infoLabel {
  color: var(--muted);
}

.infoValue {
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.tableWrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  background: white;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  background: #fafbfc;
  font-weight: 750;
}

tr:last-child td {
  border-bottom: 0;
}

.formGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
  min-height: 40px;
}

.segment {
  border: 0;
  background: transparent;
  padding: 9px 12px;
  color: var(--muted);
}

.segment.active {
  background: var(--teal);
  color: white;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.toolbar label {
  min-width: 180px;
}

.locationGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.locationBox {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.locationBox strong,
.locationBox span {
  display: block;
}

.locationBox span {
  color: var(--muted);
  margin-top: 5px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.requestList {
  display: grid;
  gap: 10px;
}

.requestItem {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.requestItem p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  min-width: min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  background: var(--ink);
  color: white;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.textMuted {
  color: var(--muted);
}

.nowrap {
  white-space: nowrap;
}

.stack {
  display: grid;
  gap: 12px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

@media (max-width: 900px) {
  .loginPanel {
    grid-template-columns: 1fr;
  }

  .brandPanel {
    min-height: 300px;
  }

  .topbarInner {
    grid-template-columns: 1fr auto;
  }

  .nav {
    grid-column: 1 / -1;
    order: 3;
  }

  .span4,
  .span5,
  .span6,
  .span7,
  .span8 {
    grid-column: span 12;
  }

  .locationGrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .loginShell,
  .content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brandStats,
  .formGrid {
    grid-template-columns: 1fr;
  }

  .pinArea,
  .requestItem,
  .infoItem {
    grid-template-columns: 1fr;
  }

  .userBoxText {
    display: none;
  }

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

  .clockTime {
    font-size: 48px;
  }
}
