:root {
  --bg: #fbf7ef;
  --surface: #fffefb;
  --surface-soft: #f3eee4;
  --text: #17384a;
  --muted: #6f766e;
  --line: #e7dcc7;
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #e0f2fe;
  --accent: #c8a45d;
  --accent-light: #f7ecd1;
  --blue: #0ea5e9;
  --blue-light: #e0f2fe;
  --green: #0284c7;
  --green-light: #e0f2fe;
  --danger: #a63f35;
  --danger-light: #f9e8e4;
  --warning: #8a6222;
  --warning-light: #f8ecd2;
  --shadow-sm: 0 10px 30px rgba(23,56,74,.07);
  --shadow-md: 0 26px 80px rgba(2,84,126,.14);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --sidebar: 260px;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Tahoma, Arial, sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; background: radial-gradient(circle at 20% 20%, #e0f2fe 0, transparent 32%), radial-gradient(circle at 80% 80%, #fff0dc 0, transparent 30%), #f8fbfa; }
.login-decoration span { position: absolute; border-radius: 50%; opacity: .45; }
.login-decoration span:nth-child(1) { width: 340px; height: 340px; background: #bae6fd; top: -150px; right: -120px; }
.login-decoration span:nth-child(2) { width: 260px; height: 260px; background: #f5dfc3; bottom: -120px; left: -80px; }
.login-decoration span:nth-child(3) { width: 40px; height: 40px; background: var(--accent); left: 20%; top: 20%; opacity: .15; }
.login-card { width: min(100%, 430px); position: relative; z-index: 1; background: var(--surface); padding: 38px; border-radius: 30px; border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.admin-brand { display: inline-flex; align-items: center; gap: 11px; }
.admin-brand--center { display: flex; justify-content: center; }
.admin-brand__mark { width: 48px; height: 48px; border-radius: 16px 16px 8px 16px; display: grid; place-items: center; color: #fff; font-size: 1.5rem; font-weight: 900; background: linear-gradient(145deg, var(--primary), var(--primary-dark)); box-shadow: 0 10px 24px rgba(14,165,233,.22); }
.admin-brand > span:last-child { display: grid; line-height: 1.3; }
.admin-brand strong { font-size: 1rem; }
.admin-brand small { color: var(--muted); font-size: .72rem; }
.login-copy { text-align: center; margin: 27px 0 25px; }
.login-copy h1 { margin: 0 0 6px; font-size: 1.55rem; }
.login-copy p { margin: 0; color: var(--muted); font-size: .83rem; }
.login-security { text-align: center; color: var(--muted); font-size: .7rem; margin: 18px 0 0; }
.password-wrap { display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--surface); }
.password-wrap input { border: 0 !important; border-radius: 0 !important; }
.password-wrap button { border: 0; border-inline-start: 1px solid var(--line); color: var(--primary); background: var(--surface-soft); padding: 0 13px; font-size: .75rem; font-weight: 800; }

.admin-app { min-height: 100vh; }
.sidebar { position: fixed; z-index: 100; inset: 0 0 0 auto; width: var(--sidebar); background: #082f49; color: #fff; display: flex; flex-direction: column; padding: 23px 16px 18px; }
.sidebar__head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 24px; border-bottom: 1px solid rgba(255,255,255,.11); }
.sidebar .admin-brand small { color: rgba(255,255,255,.55); }
.sidebar-close { display: none !important; color: #fff !important; border-color: rgba(255,255,255,.18) !important; background: rgba(255,255,255,.08) !important; }
.sidebar-nav { display: grid; gap: 6px; margin-top: 25px; }
.sidebar-nav button { width: 100%; min-height: 48px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; text-align: right; border: 0; border-radius: 13px; padding: 0 13px; color: rgba(255,255,255,.68); background: transparent; font-weight: 800; font-size: .82rem; transition: .2s; }
.sidebar-nav button:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar-nav button.is-active { color: #fff; background: linear-gradient(135deg, rgba(56,189,248,.25), rgba(255,255,255,.08)); box-shadow: inset 3px 0 0 #efb76f; }
.nav-icon { width: 30px; font-size: 1.05rem; }
.nav-count { min-width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; background: rgba(255,255,255,.13); font-size: .66rem; }
.sidebar__footer { margin-top: auto; padding: 18px 7px 0; border-top: 1px solid rgba(255,255,255,.11); display: grid; gap: 11px; }
.sidebar__footer a, .sidebar__footer button { border: 0; background: transparent; color: rgba(255,255,255,.62); text-align: right; padding: 0; font-size: .76rem; }
.sidebar__footer a:hover, .sidebar__footer button:hover { color: #fff; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 90; background: rgba(3,24,38,.58); backdrop-filter: blur(3px); }

.admin-main { margin-right: var(--sidebar); min-height: 100vh; }
.admin-header { min-height: 84px; position: sticky; top: 0; z-index: 50; padding: 0 28px; display: flex; align-items: center; gap: 17px; background: rgba(244,247,246,.9); backdrop-filter: blur(15px); border-bottom: 1px solid var(--line); }
.admin-header > div:nth-child(2) { flex: 1; }
.admin-header h1 { margin: 0; font-size: 1.35rem; }
.admin-header p { margin: 2px 0 0; color: var(--muted); font-size: .76rem; }
.admin-header__actions { display: flex; align-items: center; gap: 10px; }
.connection-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .7rem; }
.connection-status i { width: 8px; height: 8px; border-radius: 50%; background: #0ea5e9; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; font-size: 1.05rem; }
.mobile-menu { display: none; }
.admin-content { padding: 28px; }
.admin-view { display: none; }
.admin-view.is-active { display: block; }
.global-alert, .alert { display: none; border-radius: 12px; padding: 12px 14px; font-size: .78rem; margin-bottom: 16px; }
.global-alert.is-error, .alert.is-error { display: block; color: var(--danger); background: var(--danger-light); border: 1px solid #f3c7c7; }
.global-alert.is-success, .alert.is-success { display: block; color: var(--green); background: var(--green-light); border: 1px solid #bae6fd; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.metric-card { min-width: 0; padding: 21px; display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.metric-card__icon { width: 54px; height: 54px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 17px; background: var(--primary-light); color: var(--primary); font-size: 1.25rem; }
.metric-card__icon--warm { background: var(--warning-light); color: var(--warning); }
.metric-card__icon--blue { background: var(--blue-light); color: var(--blue); }
.metric-card__icon--green { background: var(--green-light); color: var(--green); }
.metric-card > div { min-width: 0; display: grid; line-height: 1.25; }
.metric-card small { color: var(--muted); font-size: .72rem; }
.metric-card strong { font-size: 1.75rem; margin: 3px 0; }
.metric-card span:last-child { color: var(--muted); font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-grid { display: grid; grid-template-columns: 1.7fr .8fr; gap: 18px; margin-top: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-head--wrap { flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1rem; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: .71rem; }
.panel-actions { display: flex; align-items: center; gap: 10px; }
.text-btn { border: 0; background: transparent; color: var(--primary); font-weight: 800; font-size: .74rem; }
.quick-actions { display: grid; gap: 10px; }
.quick-actions button { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 10px; text-align: right; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); color: var(--text); }
.quick-actions button > span { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); color: var(--primary); font-size: 1.15rem; }
.quick-actions div { display: grid; line-height: 1.25; }
.quick-actions strong { font-size: .78rem; }
.quick-actions small { color: var(--muted); margin-top: 3px; font-size: .64rem; }

.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { text-align: right; color: var(--muted); font-size: .68rem; font-weight: 800; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-size: .74rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-soft); }
.table-primary { display: grid; line-height: 1.25; }
.table-primary strong { font-size: .77rem; }
.table-primary small { color: var(--muted); margin-top: 3px; }
.status-badge { display: inline-flex; align-items: center; min-height: 27px; padding: 0 9px; border-radius: 999px; font-size: .63rem; font-weight: 900; white-space: nowrap; }
.status-badge--neutral { background: var(--surface-soft); color: var(--muted); }
.status-badge--warning { background: var(--warning-light); color: var(--warning); }
.status-badge--success { background: var(--green-light); color: var(--green); }
.status-badge--blue { background: var(--blue-light); color: var(--blue); }
.status-badge--danger { background: var(--danger-light); color: var(--danger); }
.row-action { min-height: 32px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--primary); font-size: .68rem; font-weight: 800; }
.filters-row { display: grid; grid-template-columns: minmax(280px, 1fr) 210px 210px; gap: 12px; margin-bottom: 18px; }
.filters-row select, .search-box { min-height: 43px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
.filters-row select { padding: 0 12px; }
.search-box { display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.search-box span { color: var(--muted); font-size: 1.1rem; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.empty-table { padding: 35px; text-align: center; color: var(--muted); font-size: .8rem; }

.admin-btn { min-height: 42px; border-radius: 12px; padding: 0 17px; border: 0; font-weight: 900; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .2s; }
.admin-btn:hover { transform: translateY(-1px); }
.admin-btn--primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 10px 24px rgba(14,165,233,.18); }
.admin-btn--ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.admin-btn--danger { background: var(--danger-light); color: var(--danger); border: 1px solid #f3c7c7; }
.admin-btn--block { width: 100%; }
.loader { display: none; width: 19px; height: 19px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .loader { display: block; }
.is-loading > span { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.save-state { color: var(--muted); font-size: .67rem; }

.admin-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.admin-package-card { padding: 19px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); position: relative; }
.admin-package-card.is-inactive { opacity: .58; }
.admin-package-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.admin-package-card__icon { width: 45px; height: 45px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-light); color: var(--primary); }
.admin-package-card__flags { display: flex; gap: 5px; }
.mini-badge { padding: 4px 7px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: .57rem; font-weight: 900; }
.mini-badge--featured { color: var(--warning); background: var(--warning-light); }
.admin-package-card h3 { margin: 15px 0 4px; font-size: .92rem; }
.admin-package-card > p { color: var(--muted); margin: 0; min-height: 46px; font-size: .7rem; }
.admin-package-card__price { font-size: 1.35rem; font-weight: 900; margin: 12px 0 7px; }
.admin-package-card__meta { color: var(--muted); font-size: .65rem; }
.admin-package-card__actions { display: flex; gap: 7px; margin-top: 15px; }
.admin-package-card__actions button { flex: 1; }

.content-stack { display: grid; gap: 18px; }
.settings-grid, .modal-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.admin-field { display: grid; gap: 6px; }
.admin-field--full { grid-column: 1 / -1; }
.admin-field > span { font-size: .69rem; font-weight: 900; }
.admin-field input, .admin-field select, .admin-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; color: var(--text); background: var(--surface); outline: none; }
.admin-field input, .admin-field select { min-height: 43px; }
.admin-field textarea { resize: vertical; }
.admin-field input:focus, .admin-field select:focus, .admin-field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,165,233,.09); }
.admin-field small { color: var(--muted); font-size: .62rem; }
.check-field { display: flex; align-items: center; gap: 8px; min-height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; font-size: .72rem; }
.check-field input { accent-color: var(--primary); }
.entity-list { display: grid; gap: 10px; }
.entity-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.entity-row.is-inactive { opacity: .55; }
.entity-row__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--primary); font-weight: 900; }
.entity-row__copy { display: grid; line-height: 1.25; min-width: 0; }
.entity-row__copy strong { font-size: .76rem; }
.entity-row__copy small { color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity-row__actions { display: flex; gap: 7px; }
.entity-row__actions button { min-height: 34px; padding-inline: 10px; }

.admin-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 18px; opacity: 0; visibility: hidden; transition: .2s; }
.admin-modal.is-open { opacity: 1; visibility: visible; }
.admin-modal__backdrop { position: absolute; inset: 0; background: rgba(4,30,45,.66); backdrop-filter: blur(4px); }
.admin-modal__card { position: relative; z-index: 1; width: min(100%, 520px); max-height: calc(100vh - 36px); overflow: auto; padding: 23px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-md); transform: translateY(13px); transition: .2s; }
.admin-modal.is-open .admin-modal__card { transform: translateY(0); }
.admin-modal__card--large { width: min(100%, 760px); }
.admin-modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.admin-modal__head h2 { margin: 0; font-size: 1.08rem; }
.admin-modal__head p { margin: 3px 0 0; color: var(--muted); font-size: .68rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.booking-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.detail-box { padding: 11px; border-radius: 12px; background: var(--surface-soft); }
.detail-box--full { grid-column: 1 / -1; }
.detail-box small { display: block; color: var(--muted); font-size: .61rem; }
.detail-box strong { display: block; margin-top: 3px; font-size: .74rem; word-break: break-word; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  :root { --sidebar: 270px; }
  .sidebar { transform: translateX(105%); transition: .25s; box-shadow: var(--shadow-md); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: grid !important; }
  .sidebar-backdrop.is-open { display: block; }
  .admin-main { margin-right: 0; }
  .mobile-menu { display: grid; }
  .filters-row { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  .login-card { padding: 28px 20px; }
  .admin-header { min-height: 76px; padding: 0 14px; }
  .admin-header p, .connection-status { display: none; }
  .admin-content { padding: 14px; }
  .metric-grid, .admin-cards-grid, .settings-grid, .modal-form-grid, .booking-details { grid-template-columns: 1fr; }
  .admin-field--full, .detail-box--full { grid-column: auto; }
  .panel { padding: 16px; }
  .filters-row { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .panel-actions { width: 100%; justify-content: space-between; }
  .entity-row { grid-template-columns: 42px 1fr; }
  .entity-row__actions { grid-column: 1 / -1; }
  .entity-row__actions button { flex: 1; }
  .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .admin-modal__card { padding: 18px; }
}

/* Products and image management */
.admin-card-image { height: 150px; margin: -4px -4px 16px; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-soft); display: grid; place-items: center; color: var(--muted); font-size: .68rem; }
.admin-card-image img { width: 100%; height: 100%; object-fit: cover; }
.admin-card-image--empty { border-style: dashed; }
.image-editor { padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.image-editor__row { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: center; }
.image-editor__preview { height: 145px; overflow: hidden; display: grid; place-items: center; border-radius: 12px; border: 1px dashed var(--line); background: var(--surface); color: var(--muted); font-size: .7rem; }
.image-editor__preview img { width: 100%; height: 100%; object-fit: cover; }
.image-editor__actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; }
.image-editor__actions small { width: 100%; line-height: 1.6; }
.image-upload-button { cursor: pointer; }

@media (max-width: 650px) {
  .image-editor__row { grid-template-columns: 1fr; }
  .image-editor__preview { height: 180px; }
}


/* Premium Minimal Saudi admin visual refresh — CSS-only, keeps every existing admin selector and JS hook intact. */
body {
  font-family: "IBM Plex Sans Arabic", "Noto Kufi Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at 8% 6%, rgba(200,164,93,.12), transparent 24rem),
    radial-gradient(circle at 92% 0%, rgba(2,84,126,.10), transparent 24rem),
    linear-gradient(180deg, var(--bg), #f7efe3 100%);
  letter-spacing: -.01em;
}
.login-screen {
  background:
    radial-gradient(circle at 18% 22%, rgba(200,164,93,.18), transparent 25rem),
    radial-gradient(circle at 86% 72%, rgba(2,84,126,.13), transparent 27rem),
    linear-gradient(145deg, #fbf7ef, #f6efe3);
}
.login-decoration span:nth-child(1) { background: #e0f2fe; opacity: .62; }
.login-decoration span:nth-child(2) { background: #ead7ad; opacity: .50; }
.login-decoration span:nth-child(3) { background: var(--accent); opacity: .24; }
.login-card {
  width: min(100%, 460px);
  padding: 42px;
  border-radius: 34px;
  border-color: rgba(255,255,255,.75);
  box-shadow: 0 34px 100px rgba(2,84,126,.16);
  background: linear-gradient(180deg, rgba(255,254,251,.86), rgba(255,254,251,.98));
  backdrop-filter: blur(18px);
}
.admin-brand__mark {
  border-radius: 18px 18px 8px 18px;
  background: linear-gradient(145deg, #0284c7, #0891b2 62%, #0369a1);
  box-shadow: 0 16px 38px rgba(2,84,126,.22);
}
.admin-brand__mark::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(200,164,93,.24);
  inset: -4px auto auto -4px;
}
.admin-brand__mark { position: relative; overflow: hidden; }
.admin-brand strong { letter-spacing: -.02em; }
.login-copy h1 { font-size: 1.7rem; letter-spacing: -.035em; }
.password-wrap,
.admin-field input,
.admin-field select,
.admin-field textarea,
.filters-row select,
.search-box,
.check-field {
  border-radius: 15px;
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}
.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus,
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.sidebar {
  width: 284px;
  background:
    radial-gradient(circle at 30% 0%, rgba(200,164,93,.18), transparent 14rem),
    linear-gradient(180deg, #061e2d, #071927 100%);
  padding: 25px 18px 20px;
  box-shadow: -22px 0 70px rgba(2,84,126,.16);
}
:root { --sidebar: 284px; }
.sidebar__head,
.sidebar__footer { border-color: rgba(255,255,255,.10); }
.sidebar-nav { gap: 8px; }
.sidebar-nav button {
  min-height: 50px;
  border-radius: 16px;
  color: rgba(255,255,255,.68);
}
.sidebar-nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav button.is-active {
  background: linear-gradient(135deg, rgba(255,255,255,.13), rgba(200,164,93,.15));
  box-shadow: inset 3px 0 0 var(--accent), 0 14px 34px rgba(0,0,0,.16);
}
.nav-count { background: rgba(200,164,93,.18); color: #f1d99c; }
.admin-header {
  min-height: 90px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px);
  border-bottom-color: color-mix(in srgb, var(--line) 74%, transparent);
}
.admin-header h1 { font-size: 1.5rem; letter-spacing: -.04em; }
.connection-status {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}
.icon-btn,
.row-action,
.admin-btn--ghost {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  box-shadow: 0 9px 24px rgba(23,56,74,.045);
}
.admin-btn { border-radius: 999px; font-weight: 900; }
.admin-btn--primary {
  background: linear-gradient(135deg, #0284c7, #0891b2 62%, #0369a1);
  box-shadow: 0 18px 38px rgba(2,84,126,.22);
}
.admin-btn--ghost:hover,
.icon-btn:hover,
.row-action:hover { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); color: var(--primary); transform: translateY(-1px); }
.admin-content { padding: 32px; }
.metric-grid { gap: 20px; }
.metric-card,
.panel,
.admin-package-card,
.admin-modal__card {
  border-color: rgba(255,255,255,.68);
  background: linear-gradient(180deg, rgba(255,254,251,.88), rgba(255,254,251,.99));
  box-shadow: 0 18px 52px rgba(23,56,74,.07);
}
.metric-card,
.panel { border-radius: 28px; }
.metric-card { padding: 24px; }
.metric-card__icon,
.admin-package-card__icon,
.entity-row__icon,
.quick-actions button > span {
  color: #fff;
  background: linear-gradient(145deg, #0284c7, #0891b2 62%, #0369a1);
  box-shadow: 0 15px 34px rgba(2,84,126,.17);
}
.metric-card__icon--warm { background: linear-gradient(145deg, #c8a45d, #9c762b); }
.metric-card__icon--blue { background: linear-gradient(145deg, #0ea5e9, #0284c7); }
.metric-card__icon--green { background: linear-gradient(145deg, #0284c7, #0284c7); }
.metric-card strong { letter-spacing: -.04em; }
.dashboard-grid { gap: 20px; margin-top: 20px; }
.panel { padding: 25px; }
.panel-head h2 { font-size: 1.08rem; letter-spacing: -.025em; }
.quick-actions button,
.entity-row,
.detail-box,
.image-editor {
  background: color-mix(in srgb, var(--surface-soft) 80%, var(--surface));
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
}
.quick-actions button { border-radius: 18px; padding: 14px; }
.quick-actions button:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(2,84,126,.08); }
table { border-spacing: 0; }
th { color: color-mix(in srgb, var(--muted) 90%, var(--primary)); background: color-mix(in srgb, var(--surface-soft) 46%, transparent); }
td { font-size: .76rem; }
tbody tr:hover { background: rgba(224,242,254,.50); }
.status-badge { border: 1px solid transparent; }
.status-badge--warning { background: var(--warning-light); color: var(--warning); border-color: rgba(200,164,93,.24); }
.status-badge--success,
.status-badge--blue { background: var(--green-light); color: var(--green); border-color: rgba(2,132,199,.18); }
.status-badge--neutral { background: color-mix(in srgb, var(--surface-soft) 80%, var(--surface)); color: var(--muted); border-color: var(--line); }
.admin-cards-grid { gap: 18px; }
.admin-package-card {
  padding: 20px;
  border-radius: 24px;
  overflow: hidden;
}
.admin-package-card:hover { transform: translateY(-4px); box-shadow: 0 24px 65px rgba(2,84,126,.10); }
.admin-card-image {
  height: 185px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(145deg, #efe2cc, #fffdf8 50%, #e0f2fe);
}
.admin-package-card__price { color: var(--primary); letter-spacing: -.04em; }
.mini-badge--featured {
  color: #7b581d;
  background: color-mix(in srgb, var(--accent-light) 80%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}
.entity-row { border-radius: 18px; }
.admin-modal__backdrop { background: rgba(4,30,45,.70); backdrop-filter: blur(8px); }
.admin-modal__card { border-radius: 30px; }
.image-editor__preview { height: 175px; border-radius: 18px; background: var(--surface); }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #06131f;
    --surface: #0b2233;
    --surface-soft: #0b2a3d;
    --text: #f4f0e7;
    --muted: #b6b3a7;
    --line: #27465a;
    --primary: #7dd3fc;
    --primary-dark: #bae6fd;
    --primary-light: #10364d;
    --accent: #d9b76f;
    --accent-light: #352914;
    --blue: #38bdf8;
    --blue-light: #10364d;
    --green: #38bdf8;
    --green-light: #10364d;
    --danger: #f28b80;
    --danger-light: #331916;
    --warning: #d9b76f;
    --warning-light: #352914;
    color-scheme: dark;
  }
  body { background: radial-gradient(circle at 10% 0%, rgba(217,183,111,.09), transparent 24rem), linear-gradient(180deg, #06131f, #081b2a); }
  .login-screen { background: radial-gradient(circle at 20% 18%, rgba(217,183,111,.12), transparent 24rem), radial-gradient(circle at 82% 70%, rgba(56,189,248,.10), transparent 24rem), #06131f; }
  .login-card,
  .metric-card,
  .panel,
  .admin-package-card,
  .admin-modal__card { background: linear-gradient(180deg, rgba(7,25,39,.90), rgba(7,25,39,.98)); border-color: rgba(255,255,255,.08); box-shadow: 0 26px 80px rgba(0,0,0,.32); }
  .admin-header { background: rgba(6,19,31,.76); }
  .password-wrap,
  .admin-field input,
  .admin-field select,
  .admin-field textarea,
  .filters-row select,
  .search-box,
  .check-field,
  .icon-btn,
  .row-action,
  .admin-btn--ghost { background: rgba(7,25,39,.85); border-color: rgba(255,255,255,.09); }
  tbody tr:hover { background: rgba(56,189,248,.08); }
}
@media (max-width: 880px) {
  :root { --sidebar: 284px; }
  .admin-content { padding: 20px; }
}
@media (max-width: 650px) {
  .login-card { padding: 30px 22px; border-radius: 28px; }
  .admin-header { min-height: 78px; }
  .admin-content { padding: 16px; }
  .metric-card, .panel { border-radius: 22px; }
  .admin-card-image { height: 165px; }
}

/* ========================================================================== 
   Mobile production layout — 2026-08-05
   Responsive-only adjustments. All admin IDs, actions and API behavior remain intact.
   ========================================================================== */

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.admin-app,
.admin-main,
.admin-content,
.admin-view,
.panel,
.panel-head,
.table-wrap,
.admin-cards-grid,
.content-stack,
.settings-grid,
.modal-form-grid {
  min-width: 0;
  max-width: 100%;
}

@media (hover: none) {
  .admin-btn:hover,
  .admin-package-card:hover,
  .quick-actions button:hover,
  .icon-btn:hover,
  .row-action:hover {
    transform: none;
  }
}

@media (max-width: 880px) {
  :root {
    --sidebar: min(86vw, 320px);
  }

  .sidebar {
    width: var(--sidebar);
    max-width: 100%;
    height: 100dvh;
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-nav {
    padding-bottom: 16px;
  }

  .sidebar-nav button {
    min-height: 48px;
  }

  .sidebar-backdrop {
    touch-action: none;
  }

  .admin-header {
    min-height: 72px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 16px;
  }

  .admin-header > div:nth-child(2) {
    min-width: 0;
  }

  .admin-header h1,
  .admin-header p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-header__actions {
    min-width: 0;
  }

  .mobile-menu {
    display: grid;
  }

  .admin-main {
    margin-right: 0;
  }

  .admin-content {
    padding: 20px;
  }

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

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

  .filters-row {
    grid-template-columns: 1fr 1fr;
  }

  .search-box {
    grid-column: 1 / -1;
  }
}

@media (max-width: 650px) {
  body {
    font-size: 15px;
  }

  .login-screen {
    min-height: 100svh;
    place-items: center;
    padding: calc(14px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
  }

  .login-decoration span:nth-child(1) {
    width: 210px;
    height: 210px;
    top: -92px;
    right: -78px;
  }

  .login-decoration span:nth-child(2) {
    width: 175px;
    height: 175px;
    bottom: -76px;
    left: -62px;
  }

  .login-card {
    width: 100%;
    max-width: 430px;
    padding: 25px 17px;
    border-radius: 24px;
  }

  .admin-brand--center {
    justify-content: center;
  }

  .admin-brand__mark {
    width: 44px;
    height: 44px;
    border-radius: 15px 15px 8px 15px;
    font-size: 1.35rem;
  }

  .login-copy {
    margin: 21px 0 20px;
  }

  .login-copy h1 {
    font-size: 1.45rem;
    line-height: 1.35;
  }

  .login-copy p {
    font-size: .78rem;
    line-height: 1.75;
  }

  .admin-field input,
  .admin-field select,
  .admin-field textarea,
  .filters-row select,
  .search-box input,
  .password-wrap input {
    font-size: 16px;
  }

  .admin-field input,
  .admin-field select,
  .password-wrap {
    min-height: 48px;
  }

  .password-wrap button {
    min-width: 66px;
    padding-inline: 11px;
  }

  .login-security {
    margin-top: 14px;
    line-height: 1.6;
  }

  .admin-header {
    min-height: 66px;
    padding: 0 11px;
    gap: 8px;
  }

  .admin-header h1 {
    font-size: 1.06rem;
  }

  .admin-header p,
  .connection-status {
    display: none;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
  }

  .admin-content {
    padding: 12px;
  }

  .global-alert,
  .alert {
    padding: 11px 12px;
    font-size: .74rem;
  }

  .metric-grid,
  .admin-cards-grid,
  .settings-grid,
  .modal-form-grid,
  .booking-details,
  .filters-row {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    gap: 10px;
  }

  .metric-card {
    min-height: 94px;
    padding: 16px;
    gap: 12px;
    border-radius: 20px;
  }

  .metric-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  .metric-card strong {
    font-size: 1.45rem;
  }

  .metric-card span:last-child {
    white-space: normal;
    line-height: 1.45;
  }

  .dashboard-grid,
  .content-stack {
    gap: 12px;
    margin-top: 12px;
  }

  .panel {
    padding: 15px 12px;
    border-radius: 20px;
  }

  .panel-head,
  .panel-head--wrap {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
  }

  .panel-head h2 {
    font-size: .98rem;
    line-height: 1.45;
  }

  .panel-head p {
    font-size: .68rem;
    line-height: 1.65;
  }

  .panel-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .panel-head > .admin-btn,
  .panel-actions .admin-btn {
    width: 100%;
  }

  .save-state {
    text-align: center;
  }

  .filters-row {
    gap: 9px;
  }

  .search-box {
    grid-column: auto;
    min-height: 48px;
  }

  .filters-row select {
    min-height: 48px;
    width: 100%;
  }

  .quick-actions {
    gap: 9px;
  }

  .quick-actions button {
    min-height: 68px;
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 11px;
    border-radius: 15px;
  }

  .quick-actions button > span {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  /* Tables become readable card rows on phones instead of forcing a desktop-width page. */
  .table-wrap {
    overflow: visible;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody {
    display: grid;
    gap: 10px;
  }

  .table-wrap tbody tr {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface-soft) 55%, var(--surface));
    box-shadow: 0 8px 22px rgba(23,56,74,.04);
  }

  .table-wrap tbody td {
    min-height: 35px;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
    font-size: .73rem;
    text-align: start;
    overflow-wrap: anywhere;
  }

  .table-wrap tbody td:last-child {
    border-bottom: 0;
  }

  .table-wrap tbody td::before {
    color: var(--muted);
    font-size: .63rem;
    font-weight: 900;
    line-height: 1.55;
  }

  .dashboard-grid .panel--wide .table-wrap td:nth-child(1)::before { content: "رقم الحجز"; }
  .dashboard-grid .panel--wide .table-wrap td:nth-child(2)::before { content: "العميل"; }
  .dashboard-grid .panel--wide .table-wrap td:nth-child(3)::before { content: "الباقة"; }
  .dashboard-grid .panel--wide .table-wrap td:nth-child(4)::before { content: "الموعد"; }
  .dashboard-grid .panel--wide .table-wrap td:nth-child(5)::before { content: "الحالة"; }

  .bookings-table td:nth-child(1)::before { content: "رقم الحجز"; }
  .bookings-table td:nth-child(2)::before { content: "العميل"; }
  .bookings-table td:nth-child(3)::before { content: "الباقة"; }
  .bookings-table td:nth-child(4)::before { content: "الموعد"; }
  .bookings-table td:nth-child(5)::before { content: "الدفع"; }
  .bookings-table td:nth-child(6)::before { content: "حالة الحجز"; }

  .table-wrap tbody td[colspan] {
    display: block;
    min-height: auto;
    padding: 18px 6px;
    text-align: center;
  }

  .table-wrap tbody td[colspan]::before {
    content: none !important;
  }

  .bookings-table td:nth-child(7) {
    display: block;
    padding-top: 10px;
  }

  .bookings-table td:nth-child(7)::before {
    content: none;
  }

  .bookings-table .row-action {
    width: 100%;
    min-height: 42px;
  }

  .table-primary small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .admin-package-card {
    padding: 15px;
    border-radius: 20px;
  }

  .admin-card-image {
    height: 188px;
    margin-bottom: 13px;
    border-radius: 17px;
  }

  .admin-package-card__top {
    gap: 8px;
  }

  .admin-package-card__flags {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .admin-package-card > p {
    min-height: auto;
  }

  .admin-package-card__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .admin-package-card__actions button {
    width: 100%;
  }

  .entity-row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 9px;
    padding: 11px;
    border-radius: 15px;
  }

  .entity-row__copy small {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.55;
  }

  .entity-row__actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .entity-row__actions button {
    width: 100%;
    min-height: 40px;
  }

  .check-field {
    min-height: 48px;
    padding: 10px 12px;
    align-items: flex-start;
    line-height: 1.55;
  }

  .image-editor {
    padding: 11px;
  }

  .image-editor__row {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .image-editor__preview {
    height: 190px;
  }

  .image-editor__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .image-editor__actions .admin-btn {
    width: 100%;
  }

  .image-editor__actions small {
    grid-column: 1 / -1;
  }

  .admin-modal {
    place-items: end center;
    padding: 0;
  }

  .admin-modal__card,
  .admin-modal__card--large {
    width: 100%;
    max-height: 92svh;
    padding: 18px 13px calc(16px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    transform: translateY(26px);
    -webkit-overflow-scrolling: touch;
  }

  .admin-modal__head {
    position: sticky;
    top: -18px;
    z-index: 4;
    align-items: center;
    padding: 15px 0 13px;
    margin-bottom: 14px;
    background: var(--surface);
  }

  .admin-modal__head > div {
    min-width: 0;
  }

  .admin-modal__head h2,
  .admin-modal__head p {
    overflow-wrap: anywhere;
  }

  .modal-actions {
    position: sticky;
    bottom: calc(-16px - env(safe-area-inset-bottom));
    z-index: 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 18px;
    padding: 13px 0 calc(16px + env(safe-area-inset-bottom));
    background: var(--surface);
  }

  .modal-actions .admin-btn {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
  }

  .booking-details {
    gap: 8px;
  }

  .detail-box,
  .detail-box--full {
    grid-column: auto;
  }
}

@media (max-width: 390px) {
  .login-card {
    padding-inline: 14px;
  }

  .admin-content {
    padding-inline: 9px;
  }

  .admin-header {
    padding-inline: 8px;
  }

  .admin-header h1 {
    font-size: .96rem;
  }

  .panel {
    padding-inline: 10px;
  }

  .table-wrap tbody td {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .image-editor__actions,
  .admin-package-card__actions,
  .entity-row__actions,
  .modal-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .login-screen {
    place-items: start center;
    overflow-y: auto;
  }

  .login-card {
    margin-block: 8px;
  }

  .sidebar-nav {
    margin-top: 14px;
  }

  .sidebar-nav button {
    min-height: 42px;
  }
}
