:root {
  --bg-main: #0a121d;
  --bg-panel: rgba(31, 40, 53, 0.92);
  --bg-panel-alt: rgba(36, 48, 64, 0.92);
  --bg-input: rgba(18, 23, 32, 0.9);
  --ink-strong: #edf2fa;
  --ink-soft: #a4afbf;
  --line: rgba(144, 160, 182, 0.23);
  --accent: #3f98de;
  --accent-deep: #2f7fcb;
  --accent-warm: #6ea8df;
  --success-bg: rgba(45, 163, 93, 0.22);
  --success-text: #90efb3;
  --warning-bg: rgba(182, 149, 32, 0.24);
  --warning-text: #ffe08a;
  --danger-bg: rgba(190, 67, 67, 0.22);
  --danger-text: #ffb2b2;
  --shadow-soft: 0 26px 58px rgba(3, 9, 18, 0.6);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
  color: var(--ink-strong);
  background:
    radial-gradient(circle at 12% 2%, rgba(56, 137, 219, 0.2), transparent 22%),
    radial-gradient(
      circle at 94% 96%,
      rgba(73, 92, 126, 0.22),
      transparent 26%
    ),
    linear-gradient(135deg, #050b13 0%, #111927 52%, #090f19 100%);
}

#loader {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(10px);
}

.modern-spinner {
  width: 64px;
  height: 64px;
  border: 6px solid rgba(236, 238, 241, 0.12);
  border-top-color: var(--accent);
  border-right-color: var(--accent-warm);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.18);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.dtr-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.96fr) minmax(420px, 1.04fr);
  gap: 18px;
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100vh - 66px);
  padding: 14px 18px 8px;
}

.left-panel,
.right-panel {
  min-width: 0;
  min-height: 0;
}

.brand-panel,
.attendance-card,
.manual-card {
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.left-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 16px;
  border-radius: var(--radius-xl);
  background: linear-gradient(
    118deg,
    rgba(33, 37, 43, 0.97) 0%,
    rgba(23, 27, 34, 0.97) 56%,
    rgba(16, 30, 49, 0.95) 100%
  );
  color: #e2e8f0;
  position: relative;
  overflow: hidden;
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: auto -58px -112px auto;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(69, 153, 239, 0.42),
    rgba(69, 153, 239, 0.08) 46%,
    transparent 72%
  );
}

.brand-copy {
  position: relative;
  z-index: 1;
  max-width: 100%;
}

.brand-logo img {
  width: min(210px, 100%);
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.16));
}

.eyebrow,
.section-kicker,
.clock-label {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  margin-top: 6px;
  margin-bottom: 2px;
  color: rgba(190, 203, 222, 0.86);
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(1.2rem, 1.9vw, 1.75rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 22ch;
}

.brand-copy-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-right: 0;
  margin-top: 4px;
  min-height: 0;
}

.brand-copy-headline h1 {
  flex: 1 1 auto;
}

.brand-copy-headline .clock {
  flex: 0 0 auto;
  margin-bottom: 0;
  margin-right: 124px;
  transform: scale(0.9);
  transform-origin: center right;
}

.clock-panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(149, 166, 191, 0.18);
}

.clock-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 430px;
}

.clock-date {
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  line-height: 1.06;
  color: rgba(232, 239, 248, 0.96);
  font-weight: 800;
  letter-spacing: -0.028em;
}

.attendance-card,
.manual-card {
  background: var(--bg-panel);
  border-radius: var(--radius-xl);
  padding: 18px;
  border-color: rgba(142, 157, 182, 0.33);
}

.manual-card {
  background: linear-gradient(
    140deg,
    rgba(31, 44, 61, 0.95) 0%,
    rgba(23, 35, 51, 0.95) 100%
  );
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.right-panel .attendance-card {
  background: linear-gradient(
    160deg,
    rgba(20, 30, 44, 0.97) 0%,
    rgba(14, 23, 36, 0.97) 100%
  );
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.card-header-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.card-header-block.compact {
  align-items: center;
}

.section-kicker {
  color: #8a9ec0;
  font-weight: 700;
}

.card-header-block h2 {
  margin: 0;
  color: #f7fbff;
  font-size: 2.65rem;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.right-panel .card-header-block {
  background: rgba(16, 24, 36, 0.62);
  border: 1px solid rgba(140, 158, 184, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
}

.manual-card .card-header-block h2 {
  font-size: 2.1rem;
}

.date-chip,
.portal-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(149, 168, 197, 0.34);
  background: rgba(61, 74, 96, 0.52);
  color: #d1ddef;
  font-size: 0.88rem;
  text-decoration: none;
}

.portal-link {
  color: #a2caf0;
  font-weight: 600;
}

.portal-link:hover {
  color: #d6e7ff;
  background: rgba(76, 97, 127, 0.62);
}

.attendance-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(20, 28, 40, 0.92);
}

.attendance-table {
  margin: 0;
  color: #eaf1fc;
}

.attendance-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 12px;
  border: none;
  background: rgba(50, 61, 79, 0.96);
  color: #b8c5d8;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.attendance-table tbody {
  display: block;
  max-height: calc(100vh - 248px);
  overflow-y: auto;
  overflow-x: hidden;
}

.attendance-table thead,
.attendance-table tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.attendance-table th:nth-child(1),
.attendance-table td:nth-child(1) {
  width: 24%;
}

.attendance-table th:nth-child(2),
.attendance-table td:nth-child(2) {
  width: 17%;
}

.attendance-table th:nth-child(3),
.attendance-table td:nth-child(3) {
  width: 13%;
}

.attendance-table th:nth-child(4),
.attendance-table td:nth-child(4) {
  width: 11%;
}

.attendance-table th:nth-child(5),
.attendance-table td:nth-child(5) {
  width: 11%;
}

.attendance-table th:nth-child(6),
.attendance-table td:nth-child(6) {
  width: 11%;
}

.attendance-table th:nth-child(7),
.attendance-table td:nth-child(7) {
  width: 13%;
}

.attendance-table td:nth-child(4),
.attendance-table td:nth-child(5),
.attendance-table td:nth-child(6),
.attendance-table td:nth-child(7) {
  font-size: 0.82rem;
  letter-spacing: 0;
  font-family: Consolas, "Courier New", monospace;
  overflow: visible;
  text-overflow: clip;
}

.attendance-table tbody tr:nth-child(odd) {
  background: rgba(31, 40, 55, 0.9);
}

.attendance-table tbody tr:nth-child(even) {
  background: rgba(24, 33, 48, 0.9);
}

.attendance-table td {
  padding: 11px 12px;
  border: none;
  border-top: 1px solid rgba(122, 141, 168, 0.18);
  vertical-align: middle;
  font-size: 0.95rem;
  color: #f4f7ff;
  white-space: nowrap;
  background: rgba(92, 100, 114, 0.38);
  overflow: hidden;
  text-overflow: ellipsis;
}

.employee-name {
  font-weight: 500;
  letter-spacing: 0;
}

.empty-state {
  text-align: center;
  color: #b2bfd5;
  padding: 56px 24px;
  font-size: 1rem;
}

.manual-form {
  display: grid;
  gap: 12px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.action-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(132, 151, 176, 0.25);
  background: rgba(19, 27, 39, 0.9);
  color: #d7dfec;
  font-weight: 500;
  transition: 0.2s ease;
  cursor: pointer;
}

.btn-check:checked + .action-pill {
  background: linear-gradient(135deg, #3f98de 0%, #2f7fcb 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 22px rgba(47, 127, 203, 0.32);
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #bac7dc;
}

.form-control {
  border: 1px solid rgba(141, 159, 183, 0.26);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  color: #e9f1ff;
}

.form-control::placeholder {
  color: rgba(232, 239, 248, 0.62);
}

.form-control::-webkit-input-placeholder {
  color: rgba(232, 239, 248, 0.62);
}

.form-control::-moz-placeholder {
  color: rgba(232, 239, 248, 0.62);
  opacity: 1;
}

.form-control:focus {
  border-color: rgba(83, 156, 227, 0.8);
  box-shadow: 0 0 0 0.2rem rgba(63, 152, 222, 0.24);
  background: rgba(18, 23, 32, 0.98);
  color: #f7fbff;
}

.submit-btn {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #429edf 0%, #2f80cc 100%);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(49, 129, 204, 0.34);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.alert {
  margin-bottom: 16px;
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 0.92rem;
  border: 1px solid rgba(149, 166, 191, 0.2);
}

.alert.alert-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.alert.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.page-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 16px 12px;
  color: #7d8da8;
  font-size: 0.84rem;
}

.page-footer a {
  color: #66aee9;
  text-decoration: none;
}

.clock {
  width: 12.5rem;
  height: 12.5rem;
  position: relative;
  padding: 1rem;
  border: 5px solid rgba(148, 165, 187, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 40px rgba(0, 0, 0, 0.22);
  border-radius: 50%;
  background: rgba(12, 18, 29, 0.75);
}

.outer-clock-face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.12),
    rgba(15, 23, 42, 0.78)
  );
  overflow: hidden;
}

.outer-clock-face::after,
.outer-clock-face::before,
.outer-clock-face .marking {
  content: "";
  position: absolute;
  width: 4px;
  height: 100%;
  left: 49%;
  background: rgba(170, 187, 212, 0.22);
}

.outer-clock-face::after {
  transform: rotate(90deg);
}

.outer-clock-face::before {
  background: rgba(77, 160, 242, 0.88);
}

.outer-clock-face .marking {
  width: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.outer-clock-face .marking.marking-one {
  transform: rotate(30deg);
}

.outer-clock-face .marking.marking-two {
  transform: rotate(60deg);
}

.outer-clock-face .marking.marking-three {
  transform: rotate(120deg);
}

.outer-clock-face .marking.marking-four {
  transform: rotate(150deg);
}

.inner-clock-face {
  position: absolute;
  top: 10%;
  left: 10%;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: rgba(9, 14, 23, 0.95);
  z-index: 1;
}

.inner-clock-face::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  margin-left: -6px;
  border-radius: 50%;
  background: #eceef1;
  z-index: 11;
}

.hand {
  position: absolute;
  top: 50%;
  right: 50%;
  height: 4px;
  width: 50%;
  border-radius: 999px;
  transform-origin: 100%;
  transform: rotate(90deg);
  transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1);
  background: #8cd8ef;
}

.hand.hour-hand {
  width: 28%;
  z-index: 3;
}

.hand.min-hand {
  width: 40%;
  height: 3px;
  z-index: 10;
}

.hand.second-hand {
  width: 44%;
  height: 1.8px;
  background: #7d8aa0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 92px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-present {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-break {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.status-left {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.status-pending {
  background: rgba(107, 114, 128, 0.24);
  color: #d1d5df;
}

.marquee {
  position: relative;
  animation: marquee 140s linear infinite;
}

.marquee:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% {
    transform: translateY(18%);
  }
  100% {
    transform: translateY(-78%);
  }
}

@media (max-width: 1199.98px) {
  body {
    overflow: auto;
  }

  .dtr-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 62px);
  }

  .left-panel {
    grid-template-rows: auto auto;
  }

  .brand-panel {
    padding: 32px;
  }

  .attendance-table tbody {
    max-height: 460px;
  }
}

@media (max-width: 767.98px) {
  .dtr-shell {
    gap: 18px;
    padding: 16px 16px 8px;
    height: auto;
    min-height: calc(100vh - 62px);
  }

  .brand-panel,
  .attendance-card,
  .manual-card {
    padding: 20px;
    border-radius: 24px;
  }

  .brand-copy h1 {
    max-width: none;
    font-size: 1.84rem;
    line-height: 1.04;
  }

  .brand-logo img {
    width: min(190px, 72vw);
  }

  .card-header-block h2 {
    font-size: 2rem;
  }

  .manual-card .card-header-block h2 {
    font-size: 1.6rem;
  }

  .date-chip,
  .portal-link {
    width: 100%;
    justify-content: center;
  }

  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-header-block,
  .card-header-block.compact {
    flex-direction: column;
    align-items: flex-start;
  }

  .attendance-table-wrap {
    overflow: visible;
    border: none;
    background: transparent;
  }

  .attendance-table {
    min-width: 0;
  }

  .attendance-table thead {
    display: none;
  }

  .attendance-table tbody {
    display: grid;
    max-height: none;
    overflow: visible;
    gap: 12px;
  }

  .attendance-table tbody tr {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(22, 31, 46, 0.9) !important;
    box-shadow: 0 12px 24px rgba(4, 10, 20, 0.45);
  }

  .attendance-table th:nth-child(1),
  .attendance-table td:nth-child(1),
  .attendance-table th:nth-child(2),
  .attendance-table td:nth-child(2),
  .attendance-table th:nth-child(3),
  .attendance-table td:nth-child(3),
  .attendance-table th:nth-child(4),
  .attendance-table td:nth-child(4),
  .attendance-table th:nth-child(5),
  .attendance-table td:nth-child(5),
  .attendance-table th:nth-child(6),
  .attendance-table td:nth-child(6),
  .attendance-table th:nth-child(7),
  .attendance-table td:nth-child(7) {
    width: 100% !important;
  }

  .attendance-table td {
    display: grid;
    grid-template-columns: minmax(96px, 42%) 1fr;
    align-items: start;
    column-gap: 12px;
    width: 100%;
    padding: 12px 14px;
    font-size: 0.92rem;
    border-top: 1px solid rgba(108, 122, 141, 0.22);
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .attendance-table td::before {
    content: attr(data-label);
    color: #9eb0cb;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    line-height: 1.25;
    white-space: normal;
  }

  .attendance-table td.employee-name {
    display: block;
    width: 100% !important;
    padding: 14px;
    background: #dde3ec;
    color: #0f172a;
    text-align: left;
    border-top: none;
    font-size: 0.98rem;
  }

  .attendance-table td.employee-name::before {
    display: block;
    margin-bottom: 4px;
  }

  .empty-state {
    display: block !important;
    text-align: center !important;
    padding: 32px 20px !important;
  }

  .empty-state::before {
    display: none !important;
  }

  .marquee {
    animation: none;
  }
}

@media (max-height: 860px) and (min-width: 1200px) {
  .brand-copy h1 {
    font-size: clamp(1.2rem, 1.8vw, 1.7rem);
    max-width: 20ch;
  }

  .brand-copy-headline .clock {
    display: none !important;
  }

  .clock-date {
    font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  }

  .card-header-block h2 {
    font-size: 2.2rem;
  }

  .manual-card .card-header-block h2 {
    font-size: 1.55rem;
  }

  .manual-card {
    padding: 14px;
  }

  .manual-card .card-header-block {
    margin-bottom: 12px;
    gap: 10px;
  }

  .manual-form {
    gap: 10px;
  }

  .field-group {
    gap: 6px;
  }

  .form-control {
    padding: 0.72rem 0.9rem;
  }

  .action-pill {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.88rem;
  }

  .submit-btn {
    min-height: 40px;
  }

  .attendance-table tbody {
    max-height: calc(100vh - 220px);
  }
}

@media (max-width: 479.98px) {
  .dtr-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand-panel,
  .attendance-card,
  .manual-card {
    padding: 16px;
    border-radius: 20px;
  }

  .brand-copy h1 {
    font-size: 1.62rem;
  }

  .eyebrow,
  .section-kicker,
  .clock-label {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
  }

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

  .action-pill,
  .submit-btn {
    min-height: 50px;
  }

  .field-group label {
    font-size: 0.82rem;
  }

  .form-control {
    padding: 0.85rem 0.9rem;
    font-size: 0.95rem;
  }

  .clock-date {
    font-size: 1.52rem;
  }

  .page-footer {
    gap: 8px;
    padding: 10px 14px 18px;
    font-size: 0.76rem;
  }
}
