* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

/* LOGIN */

.login-page {
  background: var(--surface);
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(460px, 0.95fr);
}

.login-showcase {
  position: relative;
  overflow: hidden;
  padding: 48px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(12, 12, 12, 0.96), rgba(31, 28, 23, 0.9)),
    radial-gradient(
      circle at top right,
      rgba(200, 169, 107, 0.35),
      transparent 45%
    );
}

.login-showcase::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -150px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.login-showcase-content {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
}

.login-brand,
.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark,
.mobile-brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #171717;
  background: var(--accent);
  border-radius: 15px;
  font-size: 22px;
  font-weight: 900;
}

.login-brand strong,
.sidebar-brand strong {
  display: block;
  font-size: 18px;
}

.login-brand small,
.sidebar-brand small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.showcase-copy {
  max-width: 650px;
  margin: auto 0;
}

.eyebrow,
.page-kicker,
.login-kicker {
  display: block;
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.showcase-copy h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.showcase-copy p {
  max-width: 610px;
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 18px;
  line-height: 1.75;
}

.showcase-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.showcase-features span {
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 13px;
}

.login-form-section {
  display: grid;
  place-items: center;
  padding: 40px;
}

.login-card {
  width: min(100%, 440px);
}

.mobile-brand-mark {
  display: none;
  margin-bottom: 24px;
}

.login-heading h2 {
  margin: 0;
  font-size: 42px;
  letter-spacing: -0.04em;
}

.login-heading > p:last-child {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 22px;
  margin-top: 38px;
}

.form-group {
  display: grid;
  gap: 9px;
}

.form-group label {
  font-size: 14px;
  font-weight: 750;
}

.form-group input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.form-group input:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(200, 169, 107, 0.14);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 82px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  padding: 9px 11px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transform: translateY(-50%);
}

.login-button {
  position: relative;
  min-height: 56px;
  display: grid;
  place-items: center;
  margin-top: 4px;
  color: #ffffff;
  background: var(--primary);
  border: 0;
  border-radius: 15px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    opacity 160ms ease;
}

.login-button:hover {
  transform: translateY(-1px);
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-loader {
  display: none;
  width: 21px;
  height: 21px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.login-button.is-loading .button-text {
  display: none;
}

.login-button.is-loading .button-loader {
  display: block;
}

.login-alert {
  margin-top: 24px;
  padding: 14px 16px;
  color: var(--danger);
  background: #fff2f0;
  border: 1px solid #ffd5d0;
  border-radius: 13px;
  font-size: 14px;
  line-height: 1.5;
}

.login-alert.success {
  color: var(--success);
  background: #effcf5;
  border-color: #c8eed9;
}

.login-footer {
  margin: 30px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

/* ADMIN PANEL */

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

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  color: #ffffff;
  background: var(--sidebar);
}

.sidebar-brand {
  padding: 0 8px 30px;
}

.sidebar-menu {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.sidebar-link {
  padding: 13px 14px;
  color: rgba(255, 255, 255, 0.62);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: #ffffff;
  background: var(--sidebar-soft);
}

.sidebar-link.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-logout {
  margin-top: auto;
}

.sidebar-logout button {
  width: 100%;
  padding: 13px 15px;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
}

.admin-content {
  min-width: 0;
  padding: 38px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.admin-header h1 {
  margin: 0;
  font-size: 38px;
  letter-spacing: -0.045em;
}

.admin-header > div:first-child > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.admin-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
}

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

.admin-user-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #171717;
  background: var(--accent);
  border-radius: 13px;
  font-weight: 900;
}

.statistics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}

.stat-card {
  min-width: 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 19px;
  box-shadow: 0 15px 40px rgba(23, 23, 23, 0.035);
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
}

.stat-card span {
  font-size: 13px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin: 14px 0 10px;
  font-size: 38px;
  letter-spacing: -0.05em;
}

.stat-card small {
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-panel {
  margin-top: 24px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.panel-heading h2 {
  margin: 0;
  font-size: 23px;
}

.panel-heading button {
  padding: 12px 16px;
  color: #ffffff;
  background: var(--primary);
  border: 0;
  border-radius: 12px;
  font-weight: 750;
  cursor: pointer;
}

.empty-state {
  padding: 70px 20px;
  text-align: center;
}

.empty-state strong {
  font-size: 18px;
}

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

.appointment-list {
  display: grid;
}

.appointment-row {
  display: grid;
  grid-template-columns: 75px 1.4fr 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--border);
}

.appointment-row:last-child {
  border-bottom: 0;
}

.appointment-row time {
  font-size: 18px;
  font-weight: 850;
}

.appointment-row strong,
.appointment-row span {
  display: block;
}

.appointment-row div span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.status-badge {
  padding: 8px 11px;
  color: #6c4c13;
  background: #f8edda;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .statistics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .login-showcase {
    display: none;
  }

  .login-form-section {
    min-height: 100vh;
    padding: 28px 20px;
  }

  .mobile-brand-mark {
    display: grid;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

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

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

  .sidebar-logout {
    margin-top: 22px;
  }

  .admin-content {
    padding: 24px 18px;
  }
}

@media (max-width: 620px) {
  .login-heading h2 {
    font-size: 34px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .appointment-row {
    grid-template-columns: 65px 1fr;
  }

  .status-badge {
    width: max-content;
  }
}
