:root {
  --bg: #eef3fb;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --ink: #172033;
  --muted: #728094;
  --line: #dce4ef;
  --primary: #1f8f8a;
  --primary-2: #10b8a6;
  --accent: #c79a47;
  --danger: #df4c5d;
  --warn: #e5a91f;
  --shadow: 0 20px 50px rgba(24, 34, 56, 0.12);
  --soft-shadow: 0 12px 32px rgba(24, 34, 56, 0.08);
  --radius: 8px;
  --sidebar: 276px;
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 17% 8%, rgba(31, 143, 138, 0.13), transparent 26%),
    radial-gradient(circle at 85% 12%, rgba(199, 154, 71, 0.15), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(199, 154, 71, 0.46);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: min(520px, 100%);
  padding: 44px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-row,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #0f766e, #22c5b7 54%, #d4a84d);
  box-shadow: 0 14px 26px rgba(15, 118, 110, 0.28);
}

.brand-row h1,
.sidebar-brand h2,
.login-card h2 {
  margin: 0;
}

.brand-row h1,
.sidebar-brand h2 {
  color: var(--primary);
  font-size: 21px;
}

.brand-row p,
.sidebar-brand p,
.muted {
  margin: 4px 0 0;
  color: var(--muted);
}

.login-card h2 {
  margin-top: 30px;
  font-size: 30px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: #556174;
  font-size: 14px;
}

input,
select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(16, 184, 166, 0.12);
}

.primary-btn,
.ghost-btn,
.action-btn {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-btn,
.action-btn.primary {
  color: white;
  background: linear-gradient(135deg, #0f766e, #10b8a6);
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.24);
}

.ghost-btn,
.action-btn {
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--ink);
}

.test-account {
  display: grid;
  gap: 7px;
  margin: 24px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f8fc;
  color: #536074;
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.side-nav {
  display: grid;
  gap: 4px;
  overflow-y: auto;
  padding-right: 3px;
}

.nav-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5e6a7d;
  text-align: left;
  font-weight: 750;
}

.nav-item:hover {
  background: rgba(31, 143, 138, 0.09);
  color: var(--primary);
}

.nav-item.active {
  color: white;
  background: linear-gradient(135deg, #0f766e, #10b8a6);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.24);
}

.nav-icon {
  width: 24px;
  text-align: center;
  font-size: 16px;
}

.admin-card {
  display: grid;
  grid-template-columns: 42px 1fr 32px;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #11837d, #2cbfd1);
}

.admin-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.admin-card button,
.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--ink);
}

.main-panel {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  padding: 16px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.topbar p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.topbar h1 {
  margin: 0;
  font-size: 25px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

#dateLabel {
  color: #556174;
  font-weight: 700;
  white-space: nowrap;
}

.content {
  padding: 26px 34px 56px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card,
.panel,
.employee-card,
.table-wrap,
.calendar-card,
.hero-strip {
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}

.stat-card {
  min-height: 106px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -36px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: rgba(16, 184, 166, 0.12);
}

.stat-card span,
.panel-subtitle,
.small {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.dashboard-grid,
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.panel {
  padding: 22px;
}

.panel h3,
.employee-card h3 {
  margin: 0 0 16px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 12px;
  height: 190px;
  padding: 20px 0 6px;
  border-bottom: 1px solid var(--line);
}

.bar {
  display: grid;
  align-items: end;
  height: 100%;
  color: #607086;
  font-size: 12px;
  text-align: center;
}

.bar i {
  display: block;
  min-height: 12px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #10b8a6, #0f766e);
}

.donut {
  width: 220px;
  height: 220px;
  margin: 10px auto;
  border-radius: 50%;
  background: conic-gradient(#0f766e 0 16%, #2cbfd1 16% 30%, #d4a84d 30% 46%, #ef595f 46% 61%, #7b61d1 61% 78%, #15a79a 78% 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 58px;
  border-radius: 50%;
  background: var(--panel-solid);
}

.notice-list,
.mini-list {
  display: grid;
  gap: 12px;
}

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

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.tool-left,
.tool-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.search-box {
  min-width: 290px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  color: white;
  background: var(--primary);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 20px;
}

.employee-card {
  padding: 20px;
}

.employee-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.employee-head h3 {
  margin: 0 0 4px;
}

.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #0f766e;
  background: rgba(16, 184, 166, 0.12);
  font-size: 12px;
  font-weight: 850;
}

.badge.warn {
  color: #976d00;
  background: rgba(229, 169, 31, 0.16);
}

.badge.danger {
  color: #b11d32;
  background: rgba(223, 76, 93, 0.14);
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.detail-list span:first-child {
  color: var(--muted);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mini-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

.table-wrap {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: #667386;
  background: rgba(247, 249, 252, 0.82);
  font-size: 13px;
}

td strong {
  display: block;
}

.hero-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(16, 184, 166, 0.13), rgba(255, 255, 255, 0.88));
}

.calendar-card {
  padding: 20px;
}

.calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

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

.day-name {
  color: #687589;
  font-weight: 800;
  text-align: center;
  font-size: 13px;
}

.day {
  min-height: 104px;
  border: 1px solid #e6edf6;
  border-radius: 8px;
  padding: 10px;
  background: #f5f8fc;
}

.day.today {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.event-pill {
  display: block;
  margin-top: 8px;
  padding: 5px 7px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(16, 184, 166, 0.12);
  color: var(--primary);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

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

.kanban-col {
  min-height: 420px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.kanban-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

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

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}

.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0f766e, #10b8a6);
}

.dark {
  --bg: #121826;
  --panel: rgba(27, 36, 53, 0.88);
  --panel-solid: #1b2435;
  --ink: #edf3fb;
  --muted: #9eacc0;
  --line: #2c3950;
  color-scheme: dark;
}

.dark body,
body.dark {
  background:
    radial-gradient(circle at 18% 8%, rgba(16, 184, 166, 0.16), transparent 28%),
    radial-gradient(circle at 84% 14%, rgba(199, 154, 71, 0.14), transparent 26%),
    linear-gradient(180deg, #101624 0%, #121826 100%);
}

.dark .sidebar,
.dark .topbar,
body.dark .sidebar,
body.dark .topbar {
  background: rgba(20, 28, 42, 0.88);
}

.dark input,
.dark select,
.dark .test-account,
.dark .notice,
.dark .admin-card,
.dark th,
.dark .day,
body.dark input,
body.dark select,
body.dark .test-account,
body.dark .notice,
body.dark .admin-card,
body.dark th,
body.dark .day {
  background: #202b3e;
}

.mobile-only {
  display: none;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .two-col,
  .kanban {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    width: min(312px, 90vw);
    transform: translateX(-110%);
    transition: transform 0.22s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-only {
    display: inline-grid;
  }

  .topbar {
    align-items: flex-start;
    padding: 14px;
  }

  .top-actions {
    gap: 7px;
  }

  #dateLabel {
    display: none;
  }

  .content {
    padding: 16px;
  }

  .card-grid,
  .stats-grid,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .hero-strip,
  .calendar-head {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    min-width: 0;
  }

  .table-wrap {
    overflow-x: auto;
  }

  table {
    min-width: 720px;
  }

  .calendar-grid {
    min-width: 760px;
  }

  .calendar-card {
    overflow-x: auto;
  }
}
