: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;
  color: var(--text);
  background: radial-gradient(circle at top right, #1e2736 0%, var(--bg) 44%);
}

.container {
  width: min(1400px, 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;
}

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

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

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

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

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

.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;
}

.login-card {
  max-width: 760px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.login-grid,
.filter-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.edit-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

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

.field-wide {
  grid-column: 1 / -1;
}

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="date"],
input[type="time"],
input[type="text"],
input[type="password"],
select {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid #3a4458;
  background: #0f131d;
  color: #fff;
  padding: 10px 12px;
}

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

.actions-row {
  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;
}

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

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

.dashboard {
  margin-top: 6px;
}

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

.dashboard-head h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
}

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

.tabs-wrap {
  margin-top: 14px;
}

.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;
}

.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);
}

.action-inline {
  display: flex;
  gap: 6px;
}

.btn-small-action {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #3b455a;
  background: #121824;
  color: #fff;
  font-size: 12px;
}

.btn-small-action.approve-btn {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.36);
}

.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-requested {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.35);
}

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

.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);
}

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

.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;
  min-height: 70px;
  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;
}

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

.edit-card {
  max-width: 1100px;
}

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

@media (max-width: 760px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .dashboard-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-grid,
  .filter-grid,
  .edit-grid {
    grid-template-columns: 1fr;
  }

  .actions-row .muted {
    width: 100%;
  }
}
