:root {
  color-scheme: light;
  --color-canvas: #f3f0ec;
  --color-surface: #ffffff;
  --color-surface-muted: #f8f7f5;
  --color-border: #e1ddd7;
  --color-border-strong: #cfc8bf;
  --color-text: #3e3d3b;
  --color-text-muted: #8b8781;
  --color-text-soft: #b4aea6;
  --color-brand: #1da7ee;
  --color-brand-hover: #0f93d7;
  --color-brand-soft: #dff4ff;
  --color-success: #22b981;
  --color-success-soft: #dff7ec;
  --color-warning: #f4a62a;
  --color-warning-soft: #fff3d9;
  --color-danger: #df5b57;
  --color-danger-soft: #fde9e8;
  --color-info-soft: #dff4ff;
  --bg: var(--color-canvas);
  --surface: var(--color-surface);
  --surface-2: var(--color-surface-muted);
  --line: var(--color-border);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --brand: var(--color-brand);
  --brand-2: var(--color-brand);
  --accent: #c9712b;
  --danger: var(--color-danger);
  --warning: var(--color-warning);
  --success: var(--color-success);
  --shadow: 0 1px 3px rgba(48, 45, 42, 0.08);
  --shadow-floating: 0 8px 24px rgba(48, 45, 42, 0.16);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 999px;
  --z-sticky: 10;
  --z-dropdown: 30;
  --z-toast: 80;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

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

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 2px rgba(48, 45, 42, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: transparent;
}

.brand h1 {
  margin: 0;
  font-size: 0.95rem;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.role-switcher {
  margin-bottom: 22px;
}

.label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
}

select:focus,
input:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid rgba(29, 167, 238, 0.28);
  outline-offset: 2px;
  border-color: var(--brand);
}

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

.nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 24px;
  height: 64px;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  min-height: 64px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
}

.nav button:hover,
.nav button.active {
  color: var(--text);
}

.nav button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--brand);
}

.nav .icon {
  width: 14px;
  text-align: center;
  color: var(--brand);
}

.account-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.company-name {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.account-area select {
  width: auto;
  min-width: 132px;
  padding: 7px 28px 7px 9px;
  font-size: 0.78rem;
}

.logout-button {
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.main {
  width: min(1120px, calc(100vw - 48px));
  min-width: 0;
  margin: 0 auto;
  padding: 28px 0 48px;
}

.page-header,
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.page-header h2,
.topbar h2 {
  margin: 0;
  color: #4a4946;
  font-size: 1.55rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.page-header p,
.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius-circle);
  background: #cfedfb;
  color: #43829e;
  font-size: 0.72rem;
  font-weight: 800;
}

.user-pill strong,
.user-pill span {
  display: block;
}

.user-pill span {
  color: var(--muted);
  font-size: 0.84rem;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.panel,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.panel h3 {
  margin: 0 0 14px;
  color: #4a4946;
  font-size: 1rem;
  font-weight: 700;
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.metric strong {
  font-size: 2rem;
}

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

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.dashboard-leave-card {
  min-height: 430px;
}

.dashboard-section-label {
  display: inline-flex;
  margin: 26px 0 14px;
  padding: 2px 4px;
  background: #fff2c8;
  color: #5b5141;
  font-weight: 800;
}

.balance-highlight {
  display: flex;
  align-items: stretch;
  gap: 14px;
}

.balance-accent {
  width: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-success);
}

.balance-highlight span,
.balance-highlight small {
  display: inline-block;
  color: var(--muted);
}

.balance-highlight strong {
  display: inline-block;
  margin: 0 4px 0 0;
  color: #4a4946;
  font-size: 2.15rem;
  line-height: 1;
}

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  width: auto;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.compact-list {
  display: grid;
  gap: 8px;
  max-width: 620px;
}

.compact-list-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.compact-list-item span {
  color: var(--muted);
}

.mutation-list {
  display: grid;
  gap: 8px;
}

.mutation-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.mutation-list-item:last-child {
  border-bottom: 0;
}

.mutation-list-item strong,
.mutation-list-item span {
  display: block;
}

.mutation-list-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.mutation-list-item .btn {
  white-space: nowrap;
}

.upcoming-card {
  min-height: 430px;
  max-height: 520px;
  overflow: auto;
}

.upcoming-list {
  display: grid;
}

.upcoming-day {
  display: grid;
  gap: 14px;
  min-height: 92px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.upcoming-day strong {
  color: #4a4946;
  font-weight: 700;
  text-transform: capitalize;
}

.upcoming-day span,
.upcoming-day small {
  color: var(--color-text-soft);
}

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

.avatar.chip {
  width: 38px;
  height: 38px;
  background: #d8f3a4;
  color: #6d9944;
  font-size: 0.86rem;
}

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

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.search-field input {
  min-height: 44px;
}

.table-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.table-meta strong {
  color: var(--text);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
  box-shadow: 0 2px 6px rgba(29, 167, 238, 0.28);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.btn:hover {
  background: var(--color-brand-hover);
  transform: translateY(-1px);
}

.btn.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: none;
}

.btn.danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 6px rgba(223, 91, 87, 0.22);
}

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

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #fff;
}

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

th {
  background: #fff;
  color: #56534f;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-info-soft);
  color: #2d7e9f;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.status.approved,
.status.connected,
.status.completed {
  background: var(--color-success-soft);
  color: var(--success);
}

.status.submitted,
.status.running {
  background: var(--color-warning-soft);
  color: #9c6c05;
}

.status.rejected,
.status.failed {
  background: var(--color-danger-soft);
  color: var(--danger);
}

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

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

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.notice {
  padding: 12px;
  border: 1px solid #e7d9b5;
  border-radius: var(--radius-lg);
  background: #fff8e8;
  color: #4d3c13;
}

.privacy-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid #c9e7f6;
  border-radius: var(--radius-lg);
  background: var(--color-brand-soft);
}

.privacy-strip strong {
  display: block;
  margin-bottom: 4px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 1px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.day {
  min-height: 132px;
  padding: 10px;
  background: #fff;
}

.day strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.event {
  margin-top: 6px;
  padding: 7px;
  border-radius: 7px;
  background: #eaf2f7;
  color: #153b4c;
  font-size: 0.8rem;
}

.event.private {
  background: #f0eee9;
  color: #4b3e2b;
}

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

.request-calendar.compact {
  grid-template-columns: repeat(7, minmax(48px, 1fr));
  gap: 5px;
}

.request-calendar-head {
  padding: 8px 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.request-calendar-empty {
  min-height: 78px;
}

.request-day {
  min-height: 78px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.request-calendar.compact .request-calendar-empty,
.request-calendar.compact .request-day {
  min-height: 50px;
}

.request-calendar.compact .request-day {
  gap: 4px;
  padding: 6px;
}

.request-day:hover {
  border-color: #1d4ed8;
  background: #f3f7ff;
}

.request-day.selected {
  border-color: #000;
  background: #000;
  color: #fff;
}

.request-day.weekend {
  background: #f3f4f6;
  color: var(--muted);
}

.request-day.weekend.selected {
  background: #000;
  color: #fff;
}

.request-day span {
  font-weight: 900;
}

.request-day small {
  font-size: 0.76rem;
}

.selection-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf3fb;
}

.selection-summary span {
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tabs button {
  min-height: 26px;
  padding: 3px 7px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.84rem;
  line-height: 1.1;
}

.tabs button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

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

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 15px;
  border-radius: var(--radius-lg);
  background: #4a4946;
  color: #fff;
  box-shadow: var(--shadow-floating);
}

.quick-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.fab {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-circle);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: var(--shadow-floating);
}

.fab:hover {
  background: var(--color-brand-hover);
}

.quick-action-menu {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: var(--z-dropdown);
  display: grid;
  gap: 6px;
  min-width: 170px;
  padding: 0;
}

.quick-action-menu button {
  min-height: 38px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.quick-action-menu button:hover {
  background: var(--color-brand-hover);
}

.app-footer {
  margin: auto auto 22px;
  color: #c1bcb4;
  font-weight: 800;
}

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

.auth-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(243, 240, 236, 0.96)),
    var(--canvas);
}

.login-shell {
  width: min(100% - 32px, 440px);
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 32px 0;
}

.login-card {
  width: 100%;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.login-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand span {
  color: var(--muted);
  font-size: 0.82rem;
}

.login-card h1 {
  margin: 0 0 8px;
  color: #4a4946;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.login-intro,
.login-support {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.google-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  border: 1px solid #dadce0;
  border-radius: var(--radius-pill);
  background: #fff;
  color: #3c4043;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.google-g {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #4285f4;
  font-weight: 800;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.login-submit {
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.auth-message.error {
  color: var(--danger);
}

.auth-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--brand);
  font-weight: 700;
}

.login-support {
  margin: 22px 0 0;
  font-size: 0.82rem;
}

@media (max-width: 960px) {
  .top-nav {
    position: static;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 18px;
  }

  .nav {
    justify-content: flex-start;
    height: auto;
    gap: 16px;
    overflow-x: auto;
  }

  .nav button {
    min-height: 38px;
    white-space: nowrap;
  }

  .account-area {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .main {
    width: min(100vw - 28px, 1120px);
    padding: 22px 0 36px;
  }

  .page-header,
  .topbar {
    display: grid;
  }

  .user-pill {
    min-width: 0;
  }

  .grid.cols-2,
  .grid.cols-3,
  .form-grid,
  .filter-bar,
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .calendar {
    grid-template-columns: repeat(7, 180px);
  }

  .request-calendar {
    grid-template-columns: repeat(7, minmax(72px, 1fr));
  }
}

@media (max-width: 560px) {
  .brand p,
  .company-name {
    display: none;
  }

  .button-row {
    width: 100%;
  }

  .btn {
    flex: 0 0 auto;
  }

  .request-calendar {
    grid-template-columns: repeat(7, 72px);
    overflow-x: auto;
  }
}
