:root {
  --bg: #050917;
  --bg-soft: #081022;
  --panel: #0d1528;
  --panel-2: #111b31;
  --border: #23324f;

  --text: #f4f7ff;
  --muted: #8e9ab3;

  --blue: #3b82f6;
  --blue-soft: #1d4ed8;

  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;

  --shadow:
    0 18px 50px rgba(0, 0, 0, 0.28);

  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background:
    radial-gradient(
      circle at 10% 0%,
      rgba(59, 130, 246, 0.11),
      transparent 28%
    ),
    radial-gradient(
      circle at 90% 20%,
      rgba(14, 165, 233, 0.07),
      transparent 28%
    ),
    var(--bg);

  color: var(--text);
}

button,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(1500px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 60px;
}


/* =========================================================
   HEADER
========================================================= */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;

  margin-bottom: 26px;
  padding: 4px 4px 8px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 7px;

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #6f88ae;
}

.app-header h1 {
  margin: 0;

  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.subtitle {
  max-width: 800px;
  margin: 10px 0 0;

  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;

  flex: 0 0 auto;

  padding: 10px 15px;

  border: 1px solid #284163;
  border-radius: 999px;

  background: rgba(12, 25, 46, 0.8);

  color: #a9bad3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.status-dot {
  width: 9px;
  height: 9px;

  border-radius: 50%;
  background: var(--green);

  box-shadow: 0 0 15px rgba(34, 197, 94, 0.65);
}


/* =========================================================
   PANEL
========================================================= */

.panel {
  margin-bottom: 22px;
  padding: 25px;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background:
    linear-gradient(
      180deg,
      rgba(17, 27, 49, 0.96),
      rgba(10, 18, 35, 0.96)
    );

  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;

  font-size: 20px;
  letter-spacing: -0.02em;
}

.step-badge {
  display: grid;
  place-items: center;

  min-width: 42px;
  height: 32px;

  border-radius: 10px;
  border: 1px solid #2a3f60;

  background: #101d33;

  color: #7da7e8;
  font-size: 12px;
  font-weight: 800;
}


/* =========================================================
   TEXTAREA
========================================================= */

#rawDataInput {
  width: 100%;
  min-height: 280px;

  resize: vertical;

  padding: 18px 19px;

  border: 1px solid #243652;
  border-radius: 15px;
  outline: none;

  background: #060d1b;

  color: #dfe8f7;
  line-height: 1.7;
  font-size: 14px;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

#rawDataInput::placeholder {
  color: #56647a;
}

#rawDataInput:focus {
  border-color: #3b82f6;

  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.13);
}


/* =========================================================
   BUTTONS
========================================================= */

.input-actions,
.bottom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  margin-top: 18px;
}

.btn {
  min-height: 43px;

  padding: 0 18px;

  border-radius: 11px;
  cursor: pointer;

  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.03em;

  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background:
    linear-gradient(
      135deg,
      #2563eb,
      #3b82f6
    );

  color: white;

  box-shadow:
    0 8px 24px rgba(37, 99, 235, 0.22);
}

.btn-secondary {
  border: 1px solid #30425f;

  background: #10192c;

  color: #c8d4e7;
}

.btn-danger {
  border: 1px solid rgba(239, 68, 68, 0.34);

  background: rgba(127, 29, 29, 0.2);

  color: #ff9898;
}


/* =========================================================
   KATEGORI IZIN
========================================================= */

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

.category-card {
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-height: 170px;

  padding: 22px;

  overflow: hidden;

  border: 1px solid #273751;
  border-radius: 22px;

  background:
    linear-gradient(
      145deg,
      #10182c,
      #0a1223
    );

  text-align: center;
}

.category-card::before {
  content: "";

  position: absolute;
  inset: auto -30px -55px auto;

  width: 130px;
  height: 130px;

  border-radius: 50%;

  filter: blur(4px);
  opacity: 0.16;
}

.category-card.toilet::before {
  background: #3b82f6;
}

.category-card.bab::before {
  background: #22c55e;
}

.category-card.makan::before {
  background: #f59e0b;
}

.category-icon {
  position: relative;
  z-index: 1;

  margin-bottom: 8px;

  font-size: 34px;
}

.category-limit {
  position: relative;
  z-index: 1;

  margin-bottom: 5px;

  color: #fbbf24;

  font-size: 13px;
  font-weight: 900;
}

.category-name {
  position: relative;
  z-index: 1;

  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
}


/* =========================================================
   FILTER
========================================================= */

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: #93a4bd;
  font-size: 12px;
  font-weight: 700;
}

.form-group select {
  width: 100%;
  min-height: 43px;

  padding: 0 13px;

  border: 1px solid #263854;
  border-radius: 11px;
  outline: none;

  background: #091222;

  color: #e5edf9;

  cursor: pointer;
}

.form-group select:focus {
  border-color: #3b82f6;

  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.1);
}


/* =========================================================
   SUMMARY
========================================================= */

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

.summary-card {
  min-height: 125px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 20px;

  border: 1px solid #243754;
  border-radius: 15px;

  background:
    linear-gradient(
      145deg,
      #0b1528,
      #101c31
    );
}

.summary-label {
  margin-bottom: 8px;

  color: #8292a9;

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.summary-card strong {
  font-size: clamp(21px, 3vw, 29px);
  line-height: 1.2;
}


/* =========================================================
   REKAP PER KARYAWAN
========================================================= */

.employee-summary-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.employee-card {
  padding: 20px;

  border: 1px solid #283b5b;
  border-radius: 16px;

  background:
    linear-gradient(
      145deg,
      #0b1528,
      #101a2e
    );
}

.employee-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;

  margin-bottom: 16px;
}

.employee-name {
  margin: 0;

  font-size: 18px;
  font-weight: 900;
}

.employee-date {
  margin-top: 5px;

  color: #8494ac;
  font-size: 12px;
}

.employee-total-duration {
  padding: 8px 10px;

  border-radius: 10px;

  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.22);

  color: #87b5ff;

  font-size: 12px;
  font-weight: 900;

  white-space: nowrap;
}

.employee-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;

  margin-bottom: 14px;
}

.mini-stat {
  padding: 11px;

  border: 1px solid #22324c;
  border-radius: 10px;

  background: #091222;
}

.mini-stat span {
  display: block;

  margin-bottom: 4px;

  color: #6f819d;
  font-size: 10px;
  font-weight: 800;
}

.mini-stat strong {
  font-size: 14px;
}

.employee-category-list {
  display: grid;
  gap: 7px;
}

.employee-category-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  padding: 9px 11px;

  border-radius: 9px;

  background: rgba(255, 255, 255, 0.025);

  color: #b8c6da;

  font-size: 12px;
}

.employee-category-row strong {
  color: #edf3fc;
}


/* =========================================================
   TABLE
========================================================= */

.table-wrapper {
  width: 100%;

  overflow-x: auto;

  border: 1px solid #263752;
  border-radius: 14px;
}

.data-table {
  width: 100%;
  min-width: 980px;

  border-collapse: collapse;

  background: #081121;
}

.data-table th {
  padding: 13px 14px;

  border-bottom: 1px solid #293b58;

  background: #101a2e;

  color: #91a2bd;

  font-size: 11px;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 14px;

  border-bottom: 1px solid #18263b;

  color: #cfdaea;

  font-size: 12px;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.035);
}

.empty-table,
.empty-state {
  padding: 35px !important;

  color: #63728b !important;

  text-align: center !important;
}

.empty-state {
  grid-column: 1 / -1;

  border: 1px dashed #2b3c58;
  border-radius: 14px;

  background: rgba(3, 9, 20, 0.25);
}


/* =========================================================
   STATUS BADGE
========================================================= */

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 5px 8px;

  border-radius: 999px;

  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.status-normal {
  color: #74eba2;

  border: 1px solid rgba(34, 197, 94, 0.32);

  background: rgba(34, 197, 94, 0.09);
}

.status-late {
  color: #ff9b9b;

  border: 1px solid rgba(239, 68, 68, 0.34);

  background: rgba(239, 68, 68, 0.09);
}


/* =========================================================
   TYPE BADGE
========================================================= */

.type-badge {
  display: inline-flex;

  padding: 5px 8px;

  border-radius: 8px;

  font-size: 10px;
  font-weight: 900;
}

.type-toilet {
  color: #8fbcff;

  background: rgba(59, 130, 246, 0.11);
}

.type-bab {
  color: #7ce6a1;

  background: rgba(34, 197, 94, 0.1);
}

.type-makan {
  color: #ffc869;

  background: rgba(245, 158, 11, 0.1);
}


/* =========================================================
   FOOTER
========================================================= */

footer {
  padding-top: 12px;

  color: #53627a;

  text-align: center;

  font-size: 11px;
  line-height: 1.6;
}


/* =========================================================
   TOAST
========================================================= */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;

  max-width: min(360px, calc(100% - 48px));

  padding: 13px 16px;

  border: 1px solid #2e466b;
  border-radius: 11px;

  background: #101a2c;

  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.35);

  color: #dce8f8;

  font-size: 12px;
  font-weight: 700;

  opacity: 0;
  visibility: hidden;

  transform: translateY(12px);

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  visibility: visible;

  transform: translateY(0);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

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

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

  .employee-summary-container {
    grid-template-columns: 1fr;
  }

}


@media (max-width: 760px) {

  .app-shell {
    width: min(100% - 22px, 1500px);
    padding-top: 20px;
  }

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

  .panel {
    padding: 18px;
    border-radius: 15px;
  }

  .category-grid,
  .filter-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 140px;
  }

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

  .employee-card-header {
    flex-direction: column;
  }

  .input-actions,
  .bottom-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

}

/* =========================================================
   LOGIN SCREEN
========================================================= */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background:
    radial-gradient(
      circle at 20% 10%,
      rgba(59, 130, 246, 0.18),
      transparent 30%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(168, 85, 247, 0.15),
      transparent 32%
    ),
    #050917;
}

.login-card {
  width: min(100%, 430px);

  padding: 34px 30px;

  border: 1px solid #273b5b;
  border-radius: 24px;

  background:
    linear-gradient(
      180deg,
      rgba(16, 27, 49, 0.98),
      rgba(8, 16, 31, 0.98)
    );

  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45);
}

.login-logo-wrap {
  display: flex;
  justify-content: center;

  margin-bottom: 20px;
}

.login-logo {
  width: 92px;
  height: 92px;

  object-fit: cover;

  border-radius: 24px;

  box-shadow:
    0 12px 34px rgba(59, 130, 246, 0.22);
}

.login-brand {
  text-align: center;
}

.login-kicker {
  display: inline-block;

  margin-bottom: 9px;

  color: #6f8fbf;

  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.login-brand h1 {
  margin: 0;

  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.login-brand p {
  margin: 12px auto 0;

  max-width: 340px;

  color: #8f9db4;

  font-size: 13px;
  line-height: 1.7;
}

.login-form {
  margin-top: 26px;
}

.login-form label {
  display: block;

  margin-bottom: 8px;

  color: #9eabc0;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  min-height: 50px;

  padding: 0 52px 0 15px;

  border: 1px solid #2a3d5e;
  border-radius: 12px;
  outline: none;

  background: #07101f;

  color: #edf4ff;

  font-size: 14px;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.password-field input::placeholder {
  color: #52627b;
}

.password-field input:focus {
  border-color: #3b82f6;

  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.12);
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 10px;

  transform: translateY(-50%);

  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 8px;

  background: transparent;

  color: #8ea2c2;

  cursor: pointer;
}

.login-message {
  min-height: 20px;

  margin-top: 9px;

  color: #ff8e8e;

  font-size: 12px;
  font-weight: 700;
}

.login-message.success {
  color: #6ee7a2;
}

.login-button {
  width: 100%;
  min-height: 48px;

  margin-top: 4px;

  border: 0;
  border-radius: 12px;

  background:
    linear-gradient(
      135deg,
      #2563eb,
      #3b82f6
    );

  color: white;

  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;

  cursor: pointer;

  box-shadow:
    0 10px 28px rgba(37, 99, 235, 0.25);

  transition:
    transform 0.18s ease,
    opacity 0.18s ease;
}

.login-button:hover {
  transform: translateY(-1px);
}

.login-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  margin-top: 22px;

  color: #687b99;

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.login-status-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: #22c55e;

  box-shadow:
    0 0 12px rgba(34, 197, 94, 0.65);
}


/* =========================================================
   DASHBOARD AUTH STATE
========================================================= */

.app-dashboard[hidden] {
  display: none !important;
}

.login-screen[hidden] {
  display: none !important;
}


/* =========================================================
   LOGIN RESPONSIVE
========================================================= */

@media (max-width: 520px) {

  .login-screen {
    padding: 16px;
  }

  .login-card {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .login-logo {
    width: 78px;
    height: 78px;
    border-radius: 20px;
  }

  .login-brand h1 {
    font-size: 23px;
  }

}
/* =========================================================
   HEADER ACTIONS + LOGOUT
========================================================= */

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

.logout-btn {
  min-height: 38px;
  padding: 0 15px;

  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 999px;

  background: rgba(127, 29, 29, 0.18);

  color: #ff9b9b;

  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;

  cursor: pointer;

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.55);

  transform: translateY(-1px);
}

.logout-btn:active {
  transform: translateY(0);
}

@media (max-width: 760px) {

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

}