:root {
  color-scheme: light;
  --primary: #00204a;
  --primary-2: #123a6f;
  --bg: #eef1f6;
  --card: rgba(255, 255, 255, 0.92);
  --ink: #f5f7ff;
  --muted: #cbd6e6;
  --accent: #00204a;
  --danger: #b93a4f;
  --border: rgba(255, 255, 255, 0.35);
}

* {
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  margin: 0;
  background: var(--primary);
  color: var(--ink);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

h1, h2 {
  margin-top: 0;
}

a {
  color: #b7d4ff;
}

.card a {
  color: var(--accent);
}

.card {
  background: var(--card);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
  color: #0c1b2a;
  padding-right: 28px;
  overflow-x: visible;
}

.requests-card {
  padding-right: 40px;
}

.table-wrap {
  padding-right: 24px;
  overflow-x: visible;
}

.requests-card table {
  width: 100%;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #0c1b2a;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 32, 74, 0.25);
  margin-bottom: 16px;
  color: #0c1b2a;
}

.grid input,
.grid select {
  min-height: 42px;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}

button.danger {
  background: var(--danger);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

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

.logo {
  width: 130px;
  height: auto;
}

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

.search-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.search-form input[type="text"] {
  width: 220px;
  margin-bottom: 0;
}

.toggle {
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.full {
  grid-column: 1 / -1;
}

.policy {
  color: #0c1b2a;
  font-size: 14px;
  line-height: 1.5;
  background: rgba(0, 32, 74, 0.05);
  border: 1px solid rgba(0, 32, 74, 0.15);
  border-radius: 10px;
  padding: 12px 14px;
}

.policy p {
  margin: 0 0 10px;
}

.policy p:last-child {
  margin-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: auto;
}

.card table {
  width: 100%;
}

table th, table td {
  border: 1px solid rgba(0, 32, 74, 0.2);
  padding: 8px;
  vertical-align: top;
}

table td:last-child {  
  white-space: normal;
  padding-right: 4px;
}

.stack button {
  padding: 8px 12px;
  font-size: 13px;
}

table th:last-child,
table td:last-child {
  width: 170px;
  max-width: 170px;
}

pre {
  white-space: pre-wrap;
  margin: 0;
  font-family: inherit;
}

.inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline input {
  width: 180px;
  margin-bottom: 0;
}

.inline button {
  white-space: nowrap;
}

.users-table .inline {
  flex-wrap: wrap;
}

.users-table .inline input {
  width: 110px;
}

.users-table th:last-child,
.users-table td:last-child {
  width: 150px;
  max-width: 150px;
}

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

.stack select {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
  font-size: 12px;
}

.stack input[type="text"] {
  width: 100%;
  margin-bottom: 0;
  font-size: 12px;
  padding: 8px 10px;
}

.deny-reason {
  display: none;
}

form[action*="/admin/requests"][method="post"] input[type="text"] {
  margin-top: 6px;
}

table th:nth-child(3),
table td:nth-child(3) {
  width: 140px;
  max-width: 140px;
  word-break: break-word;
}

table th:nth-child(5),
table td:nth-child(5) {
  width: 120px;
  max-width: 120px;
  word-break: break-word;
  white-space: normal;
}

table th:nth-child(6),
table td:nth-child(6) {
  width: 200px;
  max-width: 200px;
}

.stack button {
  align-self: flex-start;
}
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  font-weight: 600;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.5fr) minmax(260px, 1fr);
  gap: 16px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-nav {
  display: flex;
  gap: 12px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays div {
  font-weight: 700;
  text-align: center;
  padding: 6px 0;
  color: #0c1b2a;
}

.calendar-cell {
  min-height: 110px;
  border: 1px solid rgba(0, 32, 74, 0.18);
  background: rgba(255, 255, 255, 0.96);
  padding: 8px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  appearance: none;
}

.calendar-cell.holiday {
  background: #E9FCE9;
}

.calendar-cell.cob {
  background: #FFEAEB;
}

.calendar-legend {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  font-weight: 600;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #f5f7ff;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.legend-item.holiday .legend-swatch {
  background: #E9FCE9;
}

.legend-item.cob .legend-swatch {
  background: #FFEAEB;
}

.email-page {
  background: #00204a;
  color: #f5f7ff;
  min-height: 100vh;
  padding: 32px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.email-card {
  max-width: 640px;
  margin: 0 auto;
  background: #ffffff;
  color: #0c1b2a;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid rgba(0, 32, 74, 0.2);
}

.cob-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.cob-item {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 32, 74, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  color: #0c1b2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-cell.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.calendar-date {
  font-weight: 700;
  color: #0c1b2a;
}

.calendar-names {
  font-size: 12px;
  color: #1b2b3a;
  display: grid;
  gap: 4px;
}

@media (max-width: 900px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .request-page .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 18px 12px 36px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .actions {
    flex-wrap: wrap;
  }

  .logo {
    width: 110px;
  }

  table {
    font-size: 12px;
  }

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

  .requests-card table {
    min-width: 760px;
  }

  .request-page .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .request-page input,
  .request-page select,
  .request-page textarea {
    font-size: 16px;
    padding: 12px 14px;
  }

  .request-page button {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
  }

  .request-page .card {
    padding: 18px;
  }

  .request-page .policy {
    font-size: 15px;
    padding: 12px;
  }
}

.error {
  background: #fde7e7;
  border: 1px solid #f3bcbc;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 16px;
  color: #0c1b2a;
}

.success {
  background: #e6f5ea;
  border: 1px solid #b7e2c0;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 16px;
  color: #0c1b2a;
}
