:root {
  --bg: #0f1117;
  --card: #181c27;
  --line: #2c3342;
  --text: #f4f7ff;
  --muted: #9ca8bf;
  --accent: #ff3b3b;
  --accent-2: #1f8dff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: radial-gradient(circle at top right, #1e2736 0%, var(--bg) 44%);
  color: var(--text);
}

.container {
  width: min(1380px, 95%);
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.brand {
  font-size: 22px;
  font-weight: 700;
}

.brand span {
  color: var(--accent);
}

.home-link {
  text-decoration: none;
  color: #fff;
  border: 1px solid #414b60;
  border-radius: 10px;
  font-size: 14px;
  padding: 8px 14px;
}

.page-content {
  padding: 24px 0 38px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 38px);
}

.hero p {
  margin: 10px 0 0;
  color: var(--muted);
}

.hero-actions {
  margin-top: 14px;
}

.btn-link-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 10px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.card {
  background: linear-gradient(180deg, #1a1f2c, var(--card));
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.card-body {
  padding: 16px;
}

.filter-card {
  margin-top: 16px;
}

.request-card {
  margin-top: 14px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
}

.request-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.42px;
}

input,
select,
button {
  font-family: inherit;
}

input[type="month"],
input[type="text"],
select {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid #3a4458;
  background: #0f131d;
  color: #fff;
  padding: 10px 12px;
}

select option {
  background: #0f131d;
  color: #fff;
}

.month-wrap {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  gap: 6px;
  align-items: center;
}

.filter-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.request-notes {
  margin-top: 12px;
}

.request-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  padding: 0 14px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: var(--accent-2);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: #3f4a61;
  color: #d8deea;
}

.btn-small {
  padding: 0;
  min-height: 34px;
  font-size: 17px;
}

.result-info {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.tabs-section {
  margin-top: 16px;
}

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

.tab-btn {
  background: #141a25;
  border: 1px solid #384358;
  color: #d6dcee;
  min-height: 38px;
  padding: 0 16px;
}

.tab-btn.active {
  background: linear-gradient(180deg, #ff5454, #e13232);
  border-color: #e13232;
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.matrix-wrap {
  overflow: auto;
  max-height: 72vh;
}

.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1000px;
}

.matrix-table th,
.matrix-table td {
  border-right: 1px solid #30384a;
  border-bottom: 1px solid #30384a;
  vertical-align: top;
}

.matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #1d2432;
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #19202d;
}

.matrix-time-head {
  width: 78px;
  min-width: 78px;
  text-align: center;
  font-size: 12px;
  color: #c8d1e5;
  padding: 10px 6px;
}

.matrix-day-head {
  min-width: 112px;
  text-align: center;
  padding: 8px 4px;
}

.day-num {
  font-weight: 700;
  font-size: 15px;
}

.day-name {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.matrix-cell {
  min-width: 112px;
  height: 76px;
  padding: 4px;
}

.matrix-empty {
  background: rgba(255, 255, 255, 0.01);
}

.slot-item {
  border-radius: 8px;
  padding: 4px 5px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  font-size: 11px;
  line-height: 1.23;
}

.slot-continuation {
  min-height: 56px;
}

.slot-blocked {
  background: rgba(239, 68, 68, 0.24);
  border-color: rgba(239, 68, 68, 0.44);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.2);
}

.slot-client {
  font-weight: 600;
  color: #fff;
}

.slot-meta {
  color: #d2daea;
  font-size: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid transparent;
  font-size: 11px;
  text-transform: uppercase;
}

.status-scheduled {
  background: rgba(31, 141, 255, 0.17);
  border-color: rgba(31, 141, 255, 0.34);
}

.status-requested {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.35);
}

.status-completed {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.35);
}

.status-cancelled {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.35);
}

.status-rescheduled {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.35);
}

.table-wrap {
  overflow: auto;
}

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

table th,
table td {
  border-bottom: 1px solid #30384a;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}

table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: var(--muted);
}

.summary-card {
  max-width: 860px;
}

.summary-form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.summary-field input {
  width: 100%;
}

.summary-button-wrap {
  display: flex;
  align-items: end;
}

.summary-box {
  margin-top: 14px;
  background: #10141d;
  border: 1px solid #313c50;
  border-radius: 10px;
  padding: 12px;
  color: #dbe2f0;
  min-height: 100px;
}

.summary-row {
  margin-top: 6px;
  font-size: 14px;
}

.summary-highlight {
  color: #ff9a9a;
  font-weight: 700;
}

.info {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 18px 10px;
}

@media (max-width: 1180px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .request-grid {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
}

@media (max-width: 760px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }

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

  .result-info {
    margin-left: 0;
    width: 100%;
  }

  .summary-form-row {
    grid-template-columns: 1fr;
  }

  .summary-button-wrap button {
    width: 100%;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
