:root {
  --ink: #122033;
  --muted: #647386;
  --line: #d9e4ee;
  --surface: #ffffff;
  --band: #f5f8fb;
  --nav: #063b66;
  --nav-2: #09558f;
  --accent: #f39a23;
  --accent-2: #0067b1;
  --accent-soft: #fff3df;
  --blue-soft: #eaf4ff;
  --danger: #b91c1c;
  --ok: #15803d;
  --shadow: 0 1px 0 rgba(8, 42, 68, 0.03);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--band);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.locked .sidebar,
body.locked .app-shell {
  display: none;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: white;
  background:
    radial-gradient(circle at 18% 24%, rgba(243, 154, 35, 0.24), transparent 28%),
    linear-gradient(135deg, #052f52 0%, #074c7f 52%, #0a3354 100%);
}

.boot-screen img {
  width: min(230px, 62vw);
  padding: 14px 18px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(2, 22, 38, 0.24);
}

.boot-screen span {
  color: #d9ecfb;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

body.booting .boot-screen {
  display: grid;
}

body.booting .login-screen,
body.booting .sidebar,
body.booting .app-shell {
  display: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  overflow: auto;
  background:
    radial-gradient(circle at 14% 18%, rgba(243, 154, 35, 0.26), transparent 28%),
    radial-gradient(circle at 82% 78%, rgba(0, 103, 177, 0.36), transparent 32%),
    linear-gradient(135deg, #052f52 0%, #074c7f 46%, #0a3354 100%);
}

body.locked .login-screen {
  display: flex;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(380px, 480px);
  width: min(1120px, 100%);
  min-height: 650px;
}

.login-cover {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 28px;
  overflow: hidden;
  padding: 42px;
  color: white;
  border-radius: 14px 0 0 14px;
  background:
    linear-gradient(135deg, rgba(0, 103, 177, 0.94), rgba(5, 48, 82, 0.96)),
    url("logo-telecenter.jpg") center 22% / 54% auto no-repeat;
  box-shadow: 0 24px 70px rgba(4, 23, 39, 0.24);
}

.login-cover::before,
.login-cover::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.login-cover::before {
  inset: 0;
  background:
    radial-gradient(circle at 24% 28%, rgba(243, 154, 35, 0.34) 0 9px, transparent 10px),
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.24) 0 7px, transparent 8px),
    radial-gradient(circle at 84% 72%, rgba(243, 154, 35, 0.28) 0 12px, transparent 13px),
    linear-gradient(120deg, transparent 0 38%, rgba(255, 255, 255, 0.1) 38% 39%, transparent 39% 100%);
}

.login-cover::after {
  width: 280px;
  height: 280px;
  right: -92px;
  bottom: -82px;
  border: 34px solid rgba(243, 154, 35, 0.2);
  border-radius: 999px;
}

.login-cover-logo {
  position: relative;
  z-index: 1;
  width: min(250px, 62%);
  padding: 14px 18px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(2, 22, 38, 0.24);
}

.login-cover-copy,
.login-cover-metrics {
  position: relative;
  z-index: 1;
}

.login-cover-copy {
  display: grid;
  gap: 12px;
  max-width: 520px;
}

.login-cover-copy span {
  width: max-content;
  padding: 7px 11px;
  color: #5a3707;
  background: #ffc766;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-cover-copy h1 {
  max-width: 520px;
  margin: 0;
  color: white;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: 0;
}

.login-cover-copy p {
  max-width: 460px;
  margin: 0;
  color: #d9ecfb;
  font-size: 16px;
  line-height: 1.55;
}

.login-cover-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.login-cover-metrics article {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.login-cover-metrics strong {
  font-size: 22px;
}

.login-cover-metrics span {
  color: #d9ecfb;
  font-size: 12px;
  font-weight: 800;
}

.login-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 38px;
  background: white;
  border: 1px solid rgba(217, 228, 238, 0.9);
  border-radius: 0 14px 14px 0;
  box-shadow: 0 24px 70px rgba(4, 23, 39, 0.24);
}

.login-card-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 6px;
}

.login-card-heading img {
  width: 178px;
  max-width: 70%;
  object-fit: contain;
}

.login-card-heading span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

.login-card h2 {
  color: var(--ink);
  font-size: 32px;
  letter-spacing: 0;
}

.login-card p {
  color: var(--muted);
  line-height: 1.45;
}

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

input,
select,
textarea,
button {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--ink);
  background: white;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(0, 103, 177, 0.16);
  border-color: var(--accent-2);
}

button {
  min-height: 36px;
  padding: 8px 12px;
  color: white;
  cursor: pointer;
  background: var(--accent-2);
}

button:hover {
  filter: brightness(0.96);
}

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

.login-card button[type="submit"] {
  min-height: 44px;
  margin-top: 4px;
  background: linear-gradient(90deg, var(--accent-2), #0b7fc8 62%, var(--accent));
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.secondary-action {
  color: var(--accent-2);
  background: white;
  border-color: var(--accent-2);
}

.login-error {
  min-height: 20px;
  color: var(--danger) !important;
  font-weight: 700;
}

.demo-access {
  display: grid;
  gap: 4px;
  padding: 12px;
  color: #5a3707;
  background: var(--accent-soft);
  border: 1px solid #ffd699;
  border-radius: 8px;
  font-size: 13px;
}

.demo-access span {
  color: #7a4b09;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  padding: 20px 14px;
  color: white;
  background:
    linear-gradient(180deg, rgba(0, 103, 177, 0.18), transparent 220px),
    var(--nav);
}

.brand {
  display: grid;
  gap: 5px;
  padding: 8px 10px 22px;
}

.brand img {
  width: 138px;
  max-width: 100%;
  margin-bottom: 6px;
  padding: 8px;
  object-fit: contain;
  background: white;
  border-radius: 8px;
}

.brand strong {
  font-size: 24px;
}

.brand span {
  color: #c5d8dd;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  justify-content: flex-start;
  width: 100%;
  color: #dbe8eb;
  background: transparent;
  border-color: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(90deg, var(--nav-2), #0a6ead);
  border-color: rgba(255, 255, 255, 0.12);
}

.app-shell {
  min-height: 100vh;
  margin-left: 230px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  color: white;
  background: linear-gradient(90deg, #053657 0%, #0067b1 58%, #f39a23 140%);
}

.topbar h1 {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: 0;
}

.topbar p {
  margin-top: 4px;
  color: #c8d8dd;
}

.userbox {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3px 12px;
  min-width: min(100%, 280px);
  color: #d8e5e9;
  text-align: right;
}

.userbox span,
.userbox small {
  grid-column: 1;
}

.userbox small {
  color: #c8d8dd;
}

.userbox button {
  grid-column: 2;
  grid-row: 1 / span 2;
  background: #074b79;
  border-color: rgba(255, 255, 255, 0.36);
}

.view {
  display: none;
  width: min(1500px, calc(100vw - 262px));
  margin: 16px auto 0;
  padding-bottom: 40px;
}

.view.active {
  display: block;
}

.admin-only {
  display: none;
}

body.admin-mode .admin-only {
  display: block;
}

body.admin-mode button.admin-only {
  display: inline-block;
}

.panel {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.panel-title h2 {
  font-size: 16px;
}

.panel-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.today-layout,
.users-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.55fr) minmax(0, 1fr);
  gap: 14px;
}

.today-panel {
  border-left: 4px solid var(--accent);
}

.shift-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.shift-pill.full-time {
  color: #064e3b;
  background: #ccfbf1;
}

.shift-pill.part-time {
  color: #075985;
  background: #dbeafe;
}

.clock-card {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 18px;
  color: white;
  background: linear-gradient(135deg, var(--accent-2), #084f84);
  border-radius: 8px;
}

.clock-card span {
  color: #cfe7f6;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.clock-card strong {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1;
}

.network-notice,
.office-status-card {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}

.network-notice strong,
.office-status-card strong {
  font-size: 13px;
}

.network-notice span,
.office-status-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.network-notice.allowed,
.office-status-card.allowed {
  color: #064e3b;
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.network-notice.denied,
.office-status-card.denied {
  color: #7f1d1d;
  background: #fef2f2;
  border-color: #fecaca;
}

.network-notice.checking,
.office-status-card.checking {
  color: #075985;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.mark-actions {
  display: grid;
  gap: 10px;
}

.mark-button {
  display: grid;
  gap: 3px;
  min-height: 66px;
  padding: 12px 14px;
  text-align: left;
  border-radius: 8px;
}

.mark-button strong {
  font-size: 17px;
}

.mark-button span {
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 700;
}

.mark-button.next {
  background: linear-gradient(90deg, var(--accent-2), #0b7fc8 62%, var(--accent));
  border: 0;
}

.mark-button.done {
  color: #0f5132;
  background: #dcfce7;
  border-color: #86efac;
}

.mark-button.done span,
.mark-button.blocked span {
  color: inherit;
}

.mark-button.blocked {
  color: #647386;
  background: #eef4f5;
  border-color: var(--line);
}

.attendance-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.attendance-step {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 12px;
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.attendance-step.done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.attendance-step strong {
  font-size: 13px;
}

.attendance-step span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.attendance-step time {
  font-size: 20px;
  font-weight: 850;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-filters {
  grid-template-columns: repeat(2, minmax(170px, 220px));
  justify-content: start;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}

.kpis article {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.kpis span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpis strong {
  display: block;
  margin-top: 7px;
  font-size: 25px;
}

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

.wide-field,
.form-actions {
  grid-column: 1 / -1;
}

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

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 320px);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.users-table {
  max-height: calc(100vh - 230px);
}

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

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #33444d;
  background: #eef4f5;
  font-size: 12px;
}

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

.empty-row {
  color: var(--muted);
  text-align: center;
}

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

.mini-action {
  min-height: 30px;
  padding: 6px 10px;
  color: var(--accent-2);
  background: white;
  border-color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.complete {
  color: #166534;
  background: #dcfce7;
}

.status-pill.pending {
  color: #92400e;
  background: #fef3c7;
}

.status-pill.open {
  color: #075985;
  background: #e0f2fe;
}

@media (max-width: 1080px) {
  .login-screen {
    align-items: flex-start;
    padding: 18px;
  }

  .login-panel {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-cover {
    min-height: 360px;
    border-radius: 14px 14px 0 0;
  }

  .login-cover-copy h1 {
    font-size: 32px;
  }

  .login-card {
    border-radius: 0 0 14px 14px;
  }

  .sidebar {
    position: static;
    width: auto;
  }

  .brand {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .brand img {
    width: 92px;
    margin: 0;
  }

  .brand span {
    grid-column: 2;
  }

  .app-shell {
    margin-left: 0;
  }

  .topbar,
  .today-layout,
  .users-grid,
  .form-grid,
  .kpis,
  .compact-filters {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .userbox {
    width: 100%;
    text-align: left;
  }

  .view {
    width: min(100vw - 20px, 1500px);
  }

  .login-cover-metrics {
    grid-template-columns: 1fr;
  }
}
