:root {
  --wcb-purple: #4e2c7e;
  --wcb-purple-dark: #2f164f;
  --wcb-pink: #f05585;
  --ink: #202125;
  --muted: #74747a;
  --line: #e5e2eb;
  --page: #fbf9fd;
  --panel: #ffffff;
  --success: #1f9d63;
  --danger: #d83a4b;
  --shadow: 0 18px 50px rgba(32, 33, 37, 0.09);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 10px 12px;
  outline: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #55c6e8;
  box-shadow: 0 0 0 4px rgba(85, 198, 232, 0.18);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--wcb-purple-dark), var(--wcb-purple));
}

.login-shell {
  width: min(430px, 100%);
}

.login-card {
  background: white;
  border-radius: 8px;
  padding: clamp(28px, 6vw, 44px);
  box-shadow: var(--shadow);
}

.login-logo {
  width: 150px;
  display: block;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--wcb-purple);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--wcb-purple);
  line-height: 1.2;
}

.login-card h1 {
  margin-bottom: 24px;
  font-size: clamp(26px, 5vw, 34px);
}

.stack,
.profile-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--wcb-purple);
  font-size: 13px;
  font-weight: 700;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.primary-button,
.ghost-button,
.danger-button,
.small-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 800;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.primary-button {
  background: var(--wcb-purple);
  color: white;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--wcb-pink);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(240, 85, 133, 0.22);
}

.ghost-button,
.small-button {
  background: #eee9f5;
  color: var(--wcb-purple);
}

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

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

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  background: var(--wcb-purple);
  color: white;
  padding: 24px 18px;
}

.side-logo {
  width: 148px;
  display: block;
  margin: 0 0 28px;
}

.user-card {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  margin-bottom: 18px;
}

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

.user-card span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 6px;
  font-weight: 750;
}

.nav a.is-active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.workspace {
  min-width: 0;
  padding: clamp(22px, 4vw, 44px);
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-head h1 {
  font-size: clamp(28px, 4vw, 44px);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.metric-card,
.panel {
  background: var(--panel);
  border: 1px solid rgba(78, 44, 126, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--wcb-purple);
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1;
}

.panel {
  overflow: hidden;
  margin-bottom: 22px;
}

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

.panel-head h2 {
  font-size: 20px;
}

.booking-head {
  align-items: stretch;
}

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

.tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--wcb-purple);
  padding: 8px 12px;
  font-weight: 800;
}

.tab.is-active {
  background: var(--wcb-purple);
  border-color: var(--wcb-purple);
  color: white;
}

.search-input {
  width: min(320px, 100%);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

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

th {
  color: var(--wcb-purple);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

td {
  color: #33343a;
  font-size: 14px;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  background: #f2eef8;
  color: var(--wcb-purple);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.agent-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.agent-form .primary-button {
  grid-column: span 3;
  width: fit-content;
}

.profile-panel {
  padding: 20px;
}

.profile-form {
  max-width: 560px;
}

.detail-dialog {
  width: min(720px, calc(100% - 32px));
  border: 0;
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.detail-dialog::backdrop {
  background: rgba(32, 33, 37, 0.38);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eee9f5;
  color: var(--wcb-purple);
  font-size: 22px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.detail-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-item strong {
  overflow-wrap: anywhere;
}

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

  .sidebar {
    position: static;
    min-height: 0;
  }

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

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

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

  .agent-form .primary-button {
    grid-column: span 2;
  }
}

@media (max-width: 620px) {
  .workspace {
    padding: 18px 14px;
  }

  .page-head,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .metric-grid,
  .agent-form,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .agent-form .primary-button {
    grid-column: auto;
    width: 100%;
  }
}
