/* Sudantop — rose / purple (matches React `new` project) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #f43f5e;
  --brand-dk: #e11d48;
  --brand-lt: #fff1f2;
  --accent: #9333ea;
  --accent-soft: #f3e8ff;
  --brand-gradient: linear-gradient(135deg, #f43f5e 0%, #9333ea 100%);
  --salon-brand: #f43f5e;
  --salon-accent: #9333ea;
  --muted-bg: #fdf2f8;
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #f0e6ec;
  --text: #18181b;
  --muted: #71717a;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 0.625rem;
  --shadow: 0 1px 3px rgba(24, 24, 27, 0.08);
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.06);
  --shadow-md: 0 4px 14px rgba(24, 24, 27, 0.08);
  --shadow-lg: 0 12px 32px rgba(24, 24, 27, 0.12);
  --surface-elevated: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.88);
  --overlay-bg: rgba(9, 9, 11, 0.5);
  --input-bg: #ffffff;
  --alert-success-bg: #ecfdf5;
  --alert-success-text: #047857;
  --alert-danger-bg: #fef2f2;
  --alert-danger-text: #b91c1c;
  --alert-info-bg: #eff6ff;
  --alert-info-text: #1d4ed8;
  --badge-cash-bg: #ecfdf5;
  --badge-card-bg: #eff6ff;
  --badge-transfer-bg: #fff7ed;
  --table-hover: rgba(244, 63, 94, 0.04);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --lift-y: -4px;
  --shadow-hover: 0 12px 28px rgba(244, 63, 94, 0.12);
}


body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.app-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.app-nav a {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: 0.15s;
}

.app-nav a:hover,
.app-nav a.active {
  background: var(--brand-lt);
  color: var(--brand);
}

.app-nav a.nav-logout {
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}

.app-nav a.nav-logout:hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.app-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.app-main--wide { max-width: 1400px; }

.app-footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.page-title { font-size: 26px; font-weight: 800; margin-bottom: 4px; color: var(--text); }
.page-sub { color: var(--muted); margin-bottom: 24px; font-size: 14px; }

body.lang-en,
body.lang-en .admin-shell {
  font-family: 'Inter', 'Tajawal', system-ui, sans-serif;
}

.admin-page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.admin-page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  background: var(--muted-bg);
  border: 1px solid var(--border);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.admin-page-back:hover {
  color: var(--brand);
  background: var(--brand-lt);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
}

.admin-page-back svg {
  width: 1rem;
  height: 1rem;
}

.admin-page-header__text .page-sub {
  margin-bottom: 0;
}

.admin-subtabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.25rem;
  margin-bottom: 1.25rem;
  background: var(--muted-bg);
  border: 1px solid var(--border);
  border-radius: 0.625rem;
}

.admin-subtab {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.admin-subtab:hover {
  color: var(--text);
  background: var(--surface);
}

.admin-subtab.active {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.catalog-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(340px, 32%);
  gap: 0;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.catalog-split--aside-first {
  grid-template-columns: min(340px, 32%) minmax(0, 1fr);
}

.catalog-split__main {
  min-width: 0;
}

.catalog-split__main > .section {
  margin-bottom: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.catalog-split__main > .section + .section {
  border-top: 1px solid var(--border);
}

.catalog-split__aside {
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  border-inline-start: 1px solid var(--border);
}

.catalog-split--aside-first .catalog-split__aside {
  border-inline-start: none;
  border-inline-end: 1px solid var(--border);
}

.catalog-split__aside.section {
  padding: 1rem 1.125rem;
  margin-bottom: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.catalog-aside-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.catalog-aside-form .field {
  margin-bottom: 0.625rem;
}

.catalog-aside-form .field label {
  font-size: 0.75rem;
}

.catalog-aside-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.catalog-aside-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.catalog-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.catalog-form-actions--footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
  margin-top: 1.25rem;
  padding: 1rem 0 0.25rem;
  border-top: 2px solid color-mix(in srgb, var(--brand) 35%, var(--border));
}

.catalog-form-actions--footer .btn-lg {
  min-width: 7rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 700;
}

.catalog-editor[data-editing="1"] {
  margin-top: 1.5rem;
  scroll-margin-top: 1rem;
  scroll-margin-bottom: 2rem;
}

.catalog-editor[data-editing="1"] > h2 {
  margin-bottom: 0.75rem;
  color: var(--brand);
}

.catalog-main-form {
  display: block;
}

.catalog-panel .table tr.is-editing,
.catalog-aside-item.is-editing {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  outline: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border));
}

.catalog-aside-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  max-height: min(52vh, 440px);
  overflow-y: auto;
}

.catalog-aside-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
}

.catalog-aside-item__main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.catalog-aside-item__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.catalog-aside-item__name {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-aside-item__meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.catalog-aside-item__actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.catalog-aside-item__actions form {
  display: inline;
}

@media (max-width: 1100px) {
  .catalog-split,
  .catalog-split--aside-first {
    grid-template-columns: 1fr;
  }

  .catalog-split__aside,
  .catalog-split--aside-first .catalog-split__aside {
    position: static;
    max-height: none;
    overflow: visible;
    border-inline: none;
    border-top: 1px solid var(--border);
  }

  .catalog-split--aside-first .catalog-split__aside {
    order: -1;
  }
}

.catalog-split__main > .section {
  padding: 1.25rem 1.5rem;
}

.catalog-split__main .appt-tile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 1101px) {
  .catalog-split__main .appt-tile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.catalog-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.catalog-col {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  border-inline-start: 1px solid var(--border);
  max-height: calc(100vh - 11rem);
}

.catalog-col:first-child {
  border-inline-start: none;
}

.catalog-col__head {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--muted-bg);
  flex-shrink: 0;
}

.catalog-col__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
}

.catalog-col__sub {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.catalog-col__body {
  padding: 0.875rem 1rem 1rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.catalog-col__empty {
  padding: 1rem 0;
  font-size: 0.875rem;
}

.catalog-aside-list--tall {
  max-height: none;
  flex: 1;
}

.catalog-aside-item--stack {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.catalog-aside-item--stack .catalog-aside-item__actions {
  justify-content: flex-end;
}

.catalog-single {
  width: 100%;
}

.catalog-single__content {
  min-width: 0;
  width: 100%;
}

.catalog-single__content > .section + .section {
  margin-top: 1.25rem;
}

body.admin-panel .page--catalog .catalog-split {
  margin-top: 0;
}

body.admin-panel .page--catalog .catalog-split__main .section {
  margin-bottom: 0;
}

body.admin-panel .admin-subtabs {
  width: 100%;
  margin-bottom: 1rem;
}

@media (max-width: 1200px) {
  .catalog-row {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .catalog-col {
    max-height: none;
    border-top: 1px solid var(--border);
  }

  .catalog-col:nth-child(-n+2) {
    border-top: none;
  }

  .catalog-col:nth-child(odd) {
    border-inline-start: none;
  }
}

@media (max-width: 640px) {
  .catalog-row {
    grid-template-columns: 1fr;
  }

  .catalog-col {
    border-inline-start: none;
  }
}

.dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.dash-stat-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: none;
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s var(--ease-smooth);
}

.dash-stat-card:hover {
  box-shadow: var(--shadow-lg);
}

.dash-stat-card__label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.375rem;
}

.dash-stat-card__value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}

.dash-stat-card__value--rose {
  color: #f43f5e;
}

.dash-stat-card__sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.375rem;
}

.dash-stat-card__appt-count {
  line-height: 1.3;
  margin: 0;
}

.dash-stat-card__appt-pair {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.dash-stat-card__appt-total {
  margin: 0;
  line-height: 1;
  flex-shrink: 0;
}

.dash-stat-card__appt-total-badge {
  min-width: 3.5rem;
  height: 3.5rem;
  padding: 0 0.65rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
  background: linear-gradient(145deg, #fce7f3 0%, #f5d0fe 48%, #fdf2f8 100%);
  color: #be185d;
  box-shadow: 0 4px 16px rgba(219, 39, 119, 0.16);
  border: 1px solid rgba(244, 114, 182, 0.28);
}

.dash-stat-card__appt-count--confirmed {
  font-size: 0.875rem;
  font-weight: 700;
  color: #059669;
}

.dash-stat-card__appt-count--pending {
  font-size: 0.875rem;
  font-weight: 700;
  color: #d97706;
  margin-top: 0;
}

.dash-stat-card__appt-date {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.dash-stat-card__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.dash-stat-card__icon--rose {
  background: linear-gradient(135deg, #ffe4e6, #f3e8ff);
  color: #f43f5e;
}

.dash-stat-card__icon--purple {
  background: linear-gradient(135deg, #f3e8ff, #ede9fe);
  color: #9333ea;
}

.dash-stat-card__icon--amber {
  background: linear-gradient(135deg, #fef3c7, #ffedd5);
  color: #d97706;
}

.dash-stat-card__icon--emerald {
  background: linear-gradient(135deg, #d1fae5, #ecfdf5);
  color: #059669;
}

.dash-section-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 0.75rem;
  text-align: start;
}

.dash-chart-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.dash-chart-card__period {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
}

.dash-chart-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 768px) {
  .dash-chart-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.dash-chart-canvas-wrap {
  width: min(280px, 100%);
  aspect-ratio: 1;
}

.dash-chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.dash-chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.dash-chart-legend__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.dash-chart-legend__dot {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 9999px;
  flex-shrink: 0;
  margin-top: 0.25rem;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 8%, transparent);
}

.dash-chart-legend__text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.dash-chart-legend__name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text);
}

.dash-chart-legend__meta {
  font-size: 0.8125rem;
  color: var(--muted);
}

.entity-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.entity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.entity-card:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  box-shadow: var(--shadow-md);
}

.entity-card__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.entity-card__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.entity-card__title {
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.3;
}

.entity-card__meta {
  font-size: 0.8125rem;
  color: var(--muted);
}

.entity-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.admin-lang-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-lang-toggle .btn.active {
  border-color: var(--brand);
  background: var(--brand-lt);
  color: var(--brand);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: none;
  border-radius: calc(var(--radius) + 2px);
  padding: 1.125rem 1.25rem;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s var(--ease-smooth);
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
}

.stat-label { font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.375rem; }
.stat-val { font-size: 1.625rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.stat-val.accent { color: #f43f5e; }
.stat-val.green { color: var(--success); }

.card {
  background: var(--surface);
  border: none;
  border-radius: calc(var(--radius) + 2px);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}

.card h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.quick-card {
  display: block;
  text-align: center;
  padding: 1.25rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.quick-card:hover {
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, #f43f5e 25%, var(--border));
}

.quick-card.primary {
  background: var(--brand-gradient);
  border-color: transparent;
  color: #fff;
}

.quick-card.primary .quick-sub { color: rgba(255,255,255,0.85); }

.quick-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.quick-title { font-weight: 700; font-size: 15px; }
.quick-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  background: var(--muted-bg);
  padding: 10px 14px;
  text-align: right;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.table tr:hover td { background: var(--table-hover); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s;
}

.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, #f43f5e 28%, transparent);
}
.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 18px color-mix(in srgb, #9333ea 30%, transparent);
}
.btn-secondary { background: var(--brand-lt); color: #be123c; border: 1px solid #fecdd3; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 5px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  border-right: 4px solid;
}

.alert-success { background: #edf7f0; color: #276234; border-color: var(--success); }
.alert-danger { background: #fdecea; color: #a62b29; border-color: var(--danger); }
.alert-info { background: #eef5ff; color: #2a4f8d; border-color: #5472cc; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-cash { background: #edf7f0; color: var(--success); }
.badge-card { background: #eef3fe; color: #5472cc; }
.badge-transfer { background: #fff8e6; color: var(--accent); }
.badge-active { background: #edf7f0; color: var(--success); }
.badge-inactive { background: #fdecea; color: var(--danger); }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.login-box h1 { font-size: 24px; color: var(--brand); margin-bottom: 8px; }
.login-box p { color: var(--muted); margin-bottom: 24px; font-size: 14px; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tab-btn {
  padding: 10px 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
}
.tab-btn.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── تفاعل عمق مستقر (رفع + ظل — بدون ميلان 3D) ── */
.stat-card,
.quick-card {
  transition:
    transform 0.24s var(--ease-smooth),
    box-shadow 0.24s var(--ease-smooth),
    border-color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .stat-card:hover,
  .quick-card:hover {
    transform: translateY(var(--lift-y));
    box-shadow: var(--shadow-hover);
  }

  .quick-card:hover {
    border-color: var(--brand);
  }
}

.stat-card:active,
.quick-card:active {
  transform: translateY(-1px) scale(0.995);
  transition-duration: 0.1s;
}

@media (prefers-reduced-motion: reduce) {
  .stat-card,
  .quick-card {
    transition: none !important;
  }

  .stat-card:hover,
  .quick-card:hover,
  .stat-card:active,
  .quick-card:active {
    transform: none !important;
    box-shadow: var(--shadow) !important;
  }
}

@media (max-width: 768px) {
  .app-header { flex-wrap: wrap; height: auto; padding: 12px; }
  .app-nav { width: 100%; justify-content: flex-start; }
}

/* ── Admin & products panels (admin.php, products.php) ── */
body.admin-panel { min-height: 100vh; }

body.admin-panel .page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
}

body.admin-shell.admin-panel .page--admin {
  max-width: none;
}

body.admin-shell.admin-panel .page--catalog {
  max-width: none;
  padding: 0;
}

body.admin-panel .panel-header {
  background: var(--surface);
  border-bottom: 2px solid var(--brand);
  padding: 20px 24px;
  margin: -24px -24px 28px;
  border-radius: 0 0 18px 18px;
  box-shadow: var(--shadow);
}

body.admin-panel .panel-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
  color: var(--brand);
}

body.admin-panel .panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

body.admin-panel .panel-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

body.admin-panel .panel-nav a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition: 0.2s;
}

body.admin-panel .panel-nav a:hover {
  border-color: var(--brand);
  background: var(--brand-lt);
  color: var(--brand);
}

body.admin-panel .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

body.admin-panel .stat-card-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand);
}

body.admin-panel .stat-card-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

body.admin-panel .stat-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 8%, transparent), transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

body.admin-panel .section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

body.admin-panel .section h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 10px;
}

body.admin-panel .section h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 24px;
  background: var(--brand);
  border-radius: 2px;
}

body.admin-panel .section-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px;
}

body.admin-panel .category-group {
  background: color-mix(in srgb, var(--brand) 4%, var(--surface));
  border-right: 3px solid var(--brand);
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 8px;
}

body.admin-panel .category-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
}

body.admin-panel .category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

body.admin-panel .category-count {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border));
}

body.admin-panel .field--full {
  grid-column: 1 / -1;
}

body.admin-panel .admin-form-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.5;
}

body.admin-panel .admin-form-block--nested {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

body.admin-panel .admin-form-block__title--sm {
  font-size: 13px;
  margin-bottom: 12px;
}

body.admin-panel .badge-active { background: #edf7f0; color: var(--success); }
body.admin-panel .badge-inactive { background: #fdecea; color: var(--danger); }
body.admin-panel .badge-low { background: #fde8e8; color: var(--danger); font-weight: 800; }

body.admin-panel .form-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

body.admin-panel .section .form-group {
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  padding: 20px 0 0;
  margin: 20px 0 0;
}

body.admin-panel .admin-form-block {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 20px;
}

body.admin-panel .admin-form-block__title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

body.admin-panel .form-group h3 {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--text);
}

body.admin-panel .field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

body.admin-panel .field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body.admin-panel .btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

body.admin-panel .btn-small {
  padding: 6px 11px;
  font-size: 12px;
}

body.admin-panel .empty-state {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
}

body.admin-panel .action-btns {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  body.admin-panel .field-grid { grid-template-columns: 1fr; }
  body.admin-panel .section { padding: 16px; }
}

/* Appointments — compact gradient tiles */
.appt-tile-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.625rem;
  align-items: stretch;
}

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

.settings-flag-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0;
}

html[dir="ltr"] .settings-flag-row {
  justify-content: flex-start;
}

.settings-flag-row__label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  max-width: 100%;
}

.settings-flag-row__label span {
  line-height: 1.4;
}

.appt-tile {
  padding: 0.625rem 0.75rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s var(--ease-smooth);
}

.appt-tile:hover {
  box-shadow: var(--shadow-lg);
}

.appt-tile--rose {
  background: linear-gradient(135deg, color-mix(in srgb, #f43f5e 10%, var(--surface)), color-mix(in srgb, #f43f5e 3%, var(--surface)));
  border-color: color-mix(in srgb, #f43f5e 18%, var(--border));
}

.appt-tile--purple {
  background: linear-gradient(135deg, color-mix(in srgb, #9333ea 10%, var(--surface)), color-mix(in srgb, #6366f1 4%, var(--surface)));
  border-color: color-mix(in srgb, #9333ea 18%, var(--border));
}

.appt-tile--amber {
  background: linear-gradient(135deg, color-mix(in srgb, #f59e0b 10%, var(--surface)), color-mix(in srgb, #f43f5e 3%, var(--surface)));
  border-color: color-mix(in srgb, #f59e0b 20%, var(--border));
}

.appt-tile--emerald {
  background: linear-gradient(135deg, color-mix(in srgb, #14b8a6 8%, var(--surface)), color-mix(in srgb, #9333ea 3%, var(--surface)));
  border-color: color-mix(in srgb, #14b8a6 18%, var(--border));
}

.appt-tile--time .field {
  gap: 0.2rem;
}

.appt-time-split {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
}

.appt-time-part {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.appt-time-part__label {
  font-size: 0.625rem;
  font-weight: 800;
  color: #9333ea;
  letter-spacing: 0.02em;
}

.appt-time-part select {
  padding: 0.4375rem 0.375rem;
  text-align: center;
  font-weight: 700;
}

.appt-time-sep {
  flex-shrink: 0;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1;
  color: #9333ea;
  padding-bottom: 0.4375rem;
}

.appt-time-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.35;
  color: color-mix(in srgb, #9333ea 78%, var(--muted));
}

.appt-tile .field {
  margin: 0;
  gap: 0.25rem;
}

.appt-tile label {
  font-size: 0.6875rem;
  margin-bottom: 0;
}

.appt-tile input,
.appt-tile select {
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.appt-tile-hint {
  display: block;
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.appt-service-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.appt-service-line {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: end;
  padding: 0.625rem 0.75rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, #9333ea 16%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, #9333ea 8%, var(--surface)), color-mix(in srgb, #f43f5e 4%, var(--surface)));
}

.appt-service-line .field {
  margin: 0;
  gap: 0.25rem;
}

.appt-service-line label {
  font-size: 0.6875rem;
  margin-bottom: 0;
}

.appt-service-line input,
.appt-service-line select {
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.appt-duration-hint {
  font-size: 0.75rem;
  color: #9333ea;
  font-weight: 600;
  margin: 0.5rem 0 0;
}

.appt-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.875rem;
}

.appt-table .table th,
.appt-table .table td {
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
}

.appt-status-form {
  display: inline-flex;
  margin: 0;
}

.appt-status-select {
  font-size: 0.75rem;
  padding: 0.3125rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  min-width: 5.75rem;
  cursor: pointer;
}

.appt-status-select--scheduled {
  border-color: color-mix(in srgb, #f59e0b 42%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, #f59e0b 12%, var(--surface)), color-mix(in srgb, #f43f5e 4%, var(--surface)));
  color: #b45309;
}

.appt-status-select--confirmed {
  border-color: color-mix(in srgb, #059669 42%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, #059669 12%, var(--surface)), color-mix(in srgb, #14b8a6 4%, var(--surface)));
  color: #047857;
}

.appt-status-select--completed {
  border-color: color-mix(in srgb, #9333ea 38%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, #9333ea 10%, var(--surface)), color-mix(in srgb, #6366f1 4%, var(--surface)));
  color: #7e22ce;
}

.dash-stat-card__appt-count--completed {
  font-size: 0.875rem;
  font-weight: 700;
  color: #7e22ce;
  margin-top: 0;
}

.appt-status-select--cancelled {
  border-color: color-mix(in srgb, #ef4444 38%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, #ef4444 10%, var(--surface)), color-mix(in srgb, #f43f5e 3%, var(--surface)));
  color: #b91c1c;
}

.appt-status-select--no_show {
  border-color: color-mix(in srgb, #9333ea 38%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, #9333ea 10%, var(--surface)), color-mix(in srgb, #6366f1 4%, var(--surface)));
  color: #7e22ce;
}

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

@media (max-width: 540px) {
  .appt-tile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .appt-service-line {
    grid-template-columns: 1fr;
  }
  .appt-service-line .btn {
    justify-self: start;
  }
}

.appt-tile-grid--search {
  grid-template-columns: 1fr;
}

.client-search-wrap {
  position: relative;
}

.client-search-wrap input {
  width: 100%;
}

.client-search-drop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 200;
  display: none;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.client-search-drop.open {
  display: block;
}

.client-search-drop__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.client-search-drop__item:last-child {
  border-bottom: none;
}

.client-search-drop__item:hover,
.client-search-drop__item:focus {
  background: var(--muted-bg);
  outline: none;
}

.client-search-drop__name {
  font-weight: 600;
}

.client-search-drop__phone {
  font-size: 0.8125rem;
  color: var(--muted);
  direction: ltr;
  unicode-bidi: plaintext;
}

.client-search-drop__empty {
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.appt-tile textarea {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  background: var(--input-bg, var(--surface));
  padding: 0.5rem 0.625rem;
  font: inherit;
}

.pkg-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.pkg-tile {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-height: 100%;
}

.pkg-tile__icon {
  font-size: 1.75rem;
  line-height: 1;
}

.pkg-tile__type {
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pkg-tile__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.pkg-tile__price {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 900;
  color: var(--brand-dk, #e11d48);
}

.pkg-tile__desc {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.pkg-tile__btn {
  margin-top: auto;
  align-self: flex-start;
}

.pkg-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.purchase-line.appt-service-line {
  margin-bottom: 0.625rem;
}

.withdraw-line.appt-service-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

.withdraw-line.appt-service-line .appt-tile {
  flex: 1 1 160px;
  margin: 0;
}

.withdraw-line.appt-service-line .btn {
  align-self: flex-end;
  margin-bottom: 0.125rem;
}

/* Panel sections — gradient accent borders */
.panel-section {
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, #f43f5e, #9333ea, #14b8a6) 1;
}

.panel-section--rose {
  border-image: linear-gradient(90deg, #f43f5e, #fb7185) 1;
}

.panel-section--purple {
  border-image: linear-gradient(90deg, #9333ea, #6366f1) 1;
}

.panel-section--amber {
  border-image: linear-gradient(90deg, #f59e0b, #f43f5e) 1;
}

.panel-section--emerald {
  border-image: linear-gradient(90deg, #14b8a6, #9333ea) 1;
}

.reports-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

/* Inventory item cards */
.inv-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.875rem;
}

.inv-card {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--inv-accent, #6b9e9b) 25%, var(--border));
  background: linear-gradient(145deg, color-mix(in srgb, var(--inv-accent, #6b9e9b) 8%, var(--surface)), var(--surface));
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.inv-card__head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.inv-card__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: color-mix(in srgb, var(--inv-accent, #6b9e9b) 18%, transparent);
}

.inv-card__title {
  font-weight: 800;
  font-size: 1rem;
}

.inv-card__meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.inv-card__barcode {
  font-size: 0.6875rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  margin-top: 2px;
}

.inv-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
}

.inv-card__stats span {
  display: block;
  color: var(--muted);
  margin-bottom: 2px;
}

.inv-card__low {
  color: #c0392b;
}

/* Login — tile form */
.login-page {
  background: linear-gradient(160deg, color-mix(in srgb, #f43f5e 6%, var(--bg)), color-mix(in srgb, #9333ea 8%, var(--bg)));
}

.login-box--tiles {
  max-width: 480px;
  border-radius: 18px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  text-align: center;
  margin-bottom: 1.25rem;
}

.login-brand__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, #f43f5e, #9333ea, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 8px 24px color-mix(in srgb, #9333ea 35%, transparent);
}

.login-brand__title {
  font-size: 1.5rem;
  background: linear-gradient(135deg, #f43f5e, #9333ea, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
}

.login-box__heading {
  font-size: 1.125rem;
  margin: 0 0 0.25rem;
  text-align: center;
}

.login-box__sub {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

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

.login-tile-grid .appt-tile--full {
  grid-column: 1 / -1;
}

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

.dash-stat-card__value--emerald {
  color: #0d9488;
}

/* Platform admin */
.platform-page {
  min-height: 100vh;
  background: linear-gradient(180deg, color-mix(in srgb, #1a1512 4%, var(--bg)), var(--bg));
}

.platform-header {
  background: linear-gradient(135deg, #1a1512 0%, #2d2420 50%, #1a1512 100%);
  color: #f5ecd4;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.875rem;
  border-bottom: 1px solid color-mix(in srgb, #f5ecd4 12%, transparent);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.platform-header__brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.platform-header__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #f59e0b, #f43f5e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.35);
}

.platform-header__title {
  font-size: 1.125rem;
  margin: 0;
  font-weight: 800;
}

.platform-header__sub {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  color: color-mix(in srgb, #f5ecd4 65%, transparent);
}

.platform-header__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.platform-header__badge {
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.platform-header__badge--critical {
  background: #c84b50;
  color: #fff;
}

.platform-header__btn {
  color: #f5ecd4 !important;
  border-color: color-mix(in srgb, #f5ecd4 25%, transparent) !important;
}

.platform-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.platform-nav {
  display: flex;
  gap: 0.5rem;
  margin: 0 auto 1.25rem;
  max-width: 1200px;
  padding: 0.75rem 1rem 0;
  flex-wrap: wrap;
}

.platform-nav__link {
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.platform-nav__link:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.platform-alert-center {
  background: linear-gradient(145deg, color-mix(in srgb, #f59e0b 6%, var(--surface)), var(--surface));
}

.platform-alert-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.platform-alert-pills a {
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
}

.platform-alert-pills a.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.platform-alert-pills .cnt-critical {
  color: var(--danger);
}

.platform-alert-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 420px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.platform-alert-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.875rem;
  border-bottom: 1px solid var(--border);
  border-right: 4px solid var(--border);
}

.platform-alert-item:last-child {
  border-bottom: none;
}

.platform-alert-item.level-critical {
  border-right-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}

.platform-alert-item.level-warning {
  border-right-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
}

.platform-alert-item.level-info {
  border-right-color: #5472cc;
  background: color-mix(in srgb, #5472cc 6%, var(--surface));
}

.platform-alert-item__body {
  flex: 1;
  min-width: 0;
}

.platform-alert-item__title {
  font-weight: 800;
  font-size: 0.9375rem;
  margin-bottom: 0.125rem;
}

.platform-alert-item__meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.platform-alert-item__msg {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.platform-badge-expired {
  background: #fdecea;
  color: #c84b50;
}

.platform-badge-ok {
  background: #edf7f0;
  color: #3d8f65;
}

.platform-badge-warn {
  background: #fff8e6;
  color: #c9873d;
}

.platform-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}

.platform-row-actions form {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}

.platform-row-actions input[type='number'] {
  width: 3.25rem;
  padding: 0.25rem 0.375rem;
  font-size: 0.75rem;
}

.platform-login-page {
  background: linear-gradient(160deg, #1a1512 0%, color-mix(in srgb, #9333ea 12%, #2d2420) 50%, #1a1512 100%);
}

.platform-login-box {
  max-width: 440px;
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, #f5ecd4 8%, var(--border));
}

.platform-login-brand__icon {
  background: linear-gradient(135deg, #f59e0b, #f43f5e, #9333ea);
}

.platform-login-brand__title {
  background: linear-gradient(135deg, #f59e0b, #f43f5e, #9333ea);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.platform-plans-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.625rem;
}

.platform-plans-list li {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, #14b8a6 6%, var(--surface));
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .platform-header__title {
    font-size: 1rem;
  }

  .platform-row-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .platform-pw-form {
    flex-direction: column;
    align-items: stretch;
  }

  .platform-pw-form input[type='password'] {
    width: 100%;
  }
}

.platform-tenant-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 1.25rem;
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, #9333ea 8%, var(--surface)), var(--surface));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.platform-tenant-hero__title {
  margin: 0;
  font-size: 1.375rem;
}

.platform-tenant-hero__sub {
  margin: 0.375rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.platform-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.875rem;
}

.platform-detail-item {
  padding: 0.75rem 0.875rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--brand) 4%, var(--surface));
}

.platform-detail-item--full {
  grid-column: 1 / -1;
}

.platform-detail-item__label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.platform-detail-item__value {
  font-size: 0.875rem;
  font-weight: 700;
  word-break: break-word;
}

.platform-pw-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}

.emp-hr-card-grid {
  margin-top: 0.5rem;
}

.emp-hr-card--inactive {
  opacity: 0.65;
}

.emp-hr-card__cats,
.emp-hr-card__doc {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
}

.emp-hr-card__money {
  font-size: 0.8125rem;
  font-weight: 700;
}

.emp-hr-chip {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 800;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-inline-end: 0.25rem;
}

.emp-hr-chip--ok {
  border-color: color-mix(in srgb, #059669 40%, var(--border));
  color: #059669;
}

.emp-hr-chip--warn {
  border-color: color-mix(in srgb, #f59e0b 45%, var(--border));
  color: #b45309;
}

.emp-hr-chip--critical,
.emp-hr-chip--expired {
  border-color: color-mix(in srgb, #ef4444 45%, var(--border));
  color: #c84b50;
}

.emp-hr-chip--info {
  border-color: color-mix(in srgb, #5472cc 40%, var(--border));
  color: #5472cc;
}

.emp-hr-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.emp-hr-filter-pill {
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
}

.emp-hr-filter-pill.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.emp-hr-alert-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.emp-hr-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.875rem;
}

.emp-hr-alert--critical {
  border-right: 4px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}

.emp-hr-alert--warning {
  border-right: 4px solid var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
}

.emp-hr-alert--info {
  border-right: 4px solid #5472cc;
}

.emp-hr-alert span {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
}

.emp-hr-profile-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.125rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, color-mix(in srgb, #9333ea 6%, var(--surface)), var(--surface));
}

.emp-hr-profile-hero__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.emp-hr-profile-hero__cats {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
}

.emp-hr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.emp-hr-tab {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
}

.emp-hr-tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.emp-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.emp-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border-radius: 9999px;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.emp-cat-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.emp-cat-pill__icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: color-mix(in srgb, var(--cat-color, var(--brand)) 14%, var(--surface));
  color: var(--cat-color, var(--brand));
}

.emp-cat-pill__label {
  font-size: 0.875rem;
  font-weight: 600;
}

.emp-cat-pill:hover {
  border-color: color-mix(in srgb, var(--cat-color, var(--brand)) 40%, var(--border));
}

.emp-cat-pill.is-active {
  border-color: var(--cat-color, var(--brand));
  background: color-mix(in srgb, var(--cat-color, var(--brand)) 10%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cat-color, var(--brand)) 25%, transparent);
}
