:root {
  color-scheme: light;
  --bg: #fdf6ee;
  --bg-alt: #f8ede2;
  --surface: #ffffff;
  --surface-alt: #fcebd9;
  --primary: #c58c4a;
  --primary-soft: rgba(197, 140, 74, 0.08);
  --success: #40a372;
  --warning: #ffc857;
  --danger: #d95f5f;
  --text: #3f3a36;
  --text-muted: #7c7268;
  --radius-lg: 26px;
  --radius-sm: 16px;
  --shadow-sm: 0 12px 32px rgba(197, 140, 74, 0.08);
  --shadow-lg: 0 24px 48px rgba(173, 132, 92, 0.12);
  font-family: 'Cairo', 'Tajawal', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: inherit;
  color: var(--text);
  min-height: 100vh;
}

body[data-page='login'] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

body[data-page='login'] .login-card {
  background: var(--surface);
  padding: 48px 56px;
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

body[data-page='login'] .login-card h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 800;
}

body[data-page='login'] .login-card .lead-line {
  margin: 0 0 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

body[data-page='login'] .login-card p {
  margin: 0 0 32px;
  color: var(--text-muted);
  font-size: 15px;
}

body[data-page='login'] .login-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

body[data-page='login'] .login-card input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--bg-alt);
  font-size: 15px;
  direction: rtl;
}

body[data-page='login'] .login-card button {
  width: 100%;
  padding: 16px;
  margin-top: 24px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #d3a063, #bb7a31);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body[data-page='login'] .login-card button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.04);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

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

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-link {
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-align: right;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link.active,
.nav-link:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.sidebar .section-title {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.sidebar .bottom-card {
  margin-top: auto;
  padding: 18px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.8;
}

.content {
  padding: 40px 48px;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.header-bar .page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}

.header-bar .user-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: var(--surface);
  padding: 12px 18px;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.header-bar .user-chip strong {
  font-size: 15px;
}

.header-bar .user-chip span {
  font-size: 13px;
  color: var(--text-muted);
}

.section {
  margin-bottom: 32px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}

.metric-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.metric-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--text-muted);
}

.metric-card .value {
  font-size: 28px;
  font-weight: 800;
}

.metric-card .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

.panel-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.table-wrapper {
  overflow-x: auto;
}

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

thead th {
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 12px 16px;
}

tbody tr {
  background: var(--surface);
}

tbody td {
  padding: 14px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 14px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
}

.status-chip.pending {
  background: rgba(255, 200, 87, 0.18);
  color: #d1961c;
}

.status-chip.confirmed {
  background: rgba(64, 163, 114, 0.18);
  color: #2f7a56;
}

.status-chip.in_review {
  background: rgba(197, 140, 74, 0.18);
  color: var(--primary);
}

.status-chip.completed {
  background: rgba(91, 155, 213, 0.18);
  color: #2f6ea9;
}

.status-chip.cancelled {
  background: rgba(217, 95, 95, 0.18);
  color: #b43d3d;
}

.status-chip.account-active {
  background: rgba(64, 163, 114, 0.18);
  color: #2f7a56;
}

.status-chip.account-temporary {
  background: rgba(255, 200, 87, 0.22);
  color: #d1961c;
}

.status-chip.account-suspended {
  background: rgba(217, 95, 95, 0.2);
  color: #b43d3d;
}

.status-chip.account-pending {
  background: rgba(91, 155, 213, 0.18);
  color: #2f6ea9;
}

.badge-soft {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.notifications-list,
.reports-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notification-card,
.report-card {
  background: var(--surface-alt);
  padding: 16px 18px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-card h4,
.report-card h4 {
  margin: 0;
  font-size: 16px;
}

.notification-card span,
.report-card span {
  color: var(--text-muted);
  font-size: 13px;
}

.integration-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.integration-card {
  background: var(--surface-alt);
  padding: 16px 18px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(197, 140, 74, 0.12);
}

.integration-card--online {
  border-color: rgba(64, 163, 114, 0.35);
}

.integration-card--offline {
  border-color: rgba(217, 95, 95, 0.45);
  background: rgba(217, 95, 95, 0.08);
}

.integration-card .integration-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.integration-card .integration-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.integration-card .integration-meta span {
  background: rgba(0, 0, 0, 0.05);
  padding: 4px 10px;
  border-radius: 999px;
}

.integration-card a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.integration-card a:hover {
  text-decoration: underline;
}

.status-chip.integration-online {
  background: rgba(64, 163, 114, 0.18);
  color: #2f7a56;
}

.status-chip.integration-offline {
  background: rgba(217, 95, 95, 0.2);
  color: #b43d3d;
}

.integration-recent {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.integration-recent li span {
  color: var(--text-muted);
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
}

.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-weight: 600;
  font-size: 14px;
}

.input-group input,
.input-group select,
.input-group textarea {
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: var(--surface-alt);
  padding: 12px 14px;
  font-size: 14px;
  resize: vertical;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #d3a063, #bb7a31);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.button.secondary {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.table-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
}

.accounts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.accounts-metrics .badge-soft strong {
  margin-inline-start: 6px;
}

.accounts-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.accounts-group {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.accounts-group h4 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
}

.accounts-group .table-wrapper {
  margin-bottom: 20px;
}

.accounts-group form {
  margin-top: 8px;
}

.button.danger {
  background: rgba(217, 95, 95, 0.18);
  color: #b43d3d;
}

.button.danger:hover {
  box-shadow: none;
}

.service-card[data-active="0"] {
  opacity: 0.85;
  border: 1px dashed rgba(217, 95, 95, 0.4);
}

.status-chip.slot-available {
  background: rgba(64, 163, 114, 0.18);
  color: #2f7a56;
}

.status-chip.slot-blocked {
  background: rgba(217, 95, 95, 0.18);
  color: #b43d3d;
}

.status-chip.slot-maintenance {
  background: rgba(197, 140, 74, 0.2);
  color: var(--primary);
}

.appointment-status,
.slot-status {
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--surface-alt);
  padding: 8px 12px;
  font-size: 13px;
}

.faq-card p {
  margin: 0;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

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

  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    align-items: center;
    padding: 24px;
    gap: 16px;
  }

  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-link {
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  .content {
    padding: 24px;
  }

  .header-bar {
    flex-direction: column;
    gap: 18px;
    align-items: flex-start;
  }

  body[data-page='login'] .login-card {
    padding: 32px 28px;
  }
}
