/* 3eyadaty UI System v2
   A cohesive, RTL-first UI layer. Legacy module styles remain in app.css
   for backward compatibility; new shared components are defined here. */
:root {
  --ui-ink: #12253e;
  --ui-muted: #667891;
  --ui-brand: #2458cf;
  --ui-brand-hover: #1745ae;
  --ui-accent: #008f9d;
  --ui-bg: #f5f8fc;
  --ui-card: #fff;
  --ui-tint: #edf4ff;
  --ui-border: #e1e8f2;
  --ui-border-strong: #ced9e8;
  --ui-shadow: 0 8px 28px rgba(32, 61, 98, .055);
  --ui-shadow-hover: 0 15px 40px rgba(32, 61, 98, .10);
  --ui-radius: 17px;
  --ink: var(--ui-ink);
  --muted: var(--ui-muted);
  --teal: var(--ui-brand);
  --teal-dark: var(--ui-brand-hover);
  --blue: var(--ui-accent);
  --line: var(--ui-border);
  --radius: var(--ui-radius);
  --shadow-soft: var(--ui-shadow);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, body.loopai-app, body.loopai-public, body.ui-auth-body {
  background: var(--ui-bg) !important;
  color: var(--ui-ink);
  font-family: 'Cairo', Tahoma, sans-serif;
  line-height: 1.65;
}
body::before { content: none !important; }
.ui-icon { flex: none; display: inline-block; width: 20px; height: 20px; vertical-align: middle; }
.ui-skip-link { position: fixed; top: -60px; right: 10px; background: #fff; color: #0f2d62; padding: 10px 18px; z-index: 200; border-radius: 10px; }
.ui-skip-link:focus { top: 10px; }
:focus-visible { outline: 3px solid #83b8ff !important; outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { text-decoration: none; }
a:hover, button:hover { text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.ui-eyebrow { display: inline-block; color: #1874b5; font-size: .79rem; font-weight: 900; letter-spacing: .015em; margin-bottom: .35rem; }
.card, .rated-card, .specialty-band, .offer-card, .daily-schedule-day, .doctor-client-card {
  background: var(--ui-card);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  color: var(--ui-ink);
}
.card:hover, .rated-card:hover, .specialty-band:hover, .doctor-card:hover, .specialty-doctor:hover { transform: none; box-shadow: var(--ui-shadow); }
.label { display: block; margin-bottom: .5rem; color: #40556f !important; font-weight: 800; font-size: .83rem; }
.input, .smart-select-toggle, select.input, textarea.input {
  min-height: 46px; border: 1px solid var(--ui-border-strong); border-radius: 11px;
  background: #fff; color: var(--ui-ink); padding: .66rem .9rem;
  box-shadow: none; font-size: .9rem; transition: border-color .16s, box-shadow .16s;
}
.input::placeholder, input::placeholder, textarea::placeholder { color: #8b9aaf; opacity: 1; }
.input:hover, .smart-select-toggle:hover { border-color: #aabbd1; }
.input:focus, .smart-select-toggle:focus, select:focus-visible, textarea:focus-visible {
  border-color: #467bdf !important; box-shadow: 0 0 0 4px rgba(38, 100, 205, .1) !important;
  background: #fff; outline: none;
}
.btn, .btn-primary {
  border-radius: 11px; padding: .67rem 1rem; min-height: 43px;
  box-shadow: none; font-size: .88rem; font-weight: 800; border: 1px solid var(--ui-border-strong);
  line-height: 1.4; transition: background .18s, border-color .18s, box-shadow .18s;
}
.btn { background: #fff; color: #334967; }
.btn:hover { color: var(--ui-brand); border-color: #9eb9eb; background: #f7faff; box-shadow: none; transform: none; }
.btn-primary, html.dark-mode .btn-primary {
  background: var(--ui-brand) !important; border-color: var(--ui-brand) !important;
  color: #fff !important; box-shadow: none !important;
}
.btn-primary:hover, html.dark-mode .btn-primary:hover {
  background: var(--ui-brand-hover) !important; border-color: var(--ui-brand-hover) !important;
  transform: none; box-shadow: 0 6px 17px rgba(36,88,207,.17) !important;
}
.btn-primary:disabled, .btn:disabled { opacity: .54; cursor: not-allowed; transform: none; }
.ui-icon-button {
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  flex: none; width: 42px; height: 42px; border: 1px solid var(--ui-border);
  border-radius: 12px; background: #fff; color: #395372; transition: background .15s, border-color .15s;
}
.ui-icon-button:hover { color: var(--ui-brand); background: #f2f7ff; border-color: #bad0f2; }
.ui-icon-button .ui-icon { width: 19px; height: 19px; }
.ui-alert { display: flex; align-items: center; gap: .7rem; border-radius: 12px; border: 1px solid; padding: .9rem 1rem; margin-bottom: 1.2rem; font-size: .9rem; font-weight: 700; }
.ui-alert-success { background: #edfcf4; color: #116044; border-color: #b8ead2; }
.ui-alert-error { background: #fff1f2; color: #9d233a; border-color: #ffccd3; }
/* Admin shell and navigation */
body.ui-admin-body { min-height: 100vh; }
.ui-shell { display: flex; align-items: stretch; min-height: 100vh; background: transparent !important; }
.ui-sidebar.app-sidebar.loopai-sidebar {
  width: 283px; flex: 0 0 283px; min-height: 100vh; height: 100vh;
  position: sticky; top: 0; display: flex; flex-direction: column; z-index: 50;
  background: #fff !important; border-left: 1px solid var(--ui-border) !important;
  border-right: 0; box-shadow: 0 0 24px rgba(26, 53, 93, .035) !important;
  padding: 0; overflow: hidden; isolation: auto;
}
.ui-sidebar.app-sidebar::before, .ui-sidebar.app-sidebar::after { display: none !important; }
.ui-sidebar-top { display: flex; align-items: center; gap: .7rem; padding: 20px 18px 16px; }
.ui-sidebar-brand { display: flex; align-items: center; gap: .8rem; flex: 1; min-width: 0; color: var(--ui-ink); }
.ui-sidebar-brand-image { display: flex; align-items: center; justify-content: center; overflow: hidden; width: 54px; height: 54px; border-radius: 14px; border: 1px solid var(--ui-border); background: #f9fcff; }
.ui-sidebar-brand-image img { width: 100%; height: 100%; object-fit: contain; }
.ui-sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.38; }
.ui-sidebar-brand-text strong { font-size: 1.22rem; font-weight: 900; }
.ui-sidebar-brand-text small { font-size: .70rem; color: var(--ui-muted); font-weight: 700; white-space: nowrap; }
.ui-close-drawer { display: none; }
.ui-sidebar-search { position: relative; display: flex; align-items: center; gap: .5rem; margin: 0 16px 15px; height: 43px; padding: 0 .65rem; background: #f5f8fc; color: #91a0b5; border: 1px solid var(--ui-border); border-radius: 11px; }
.ui-sidebar-search:focus-within { border-color: #82a7e7; box-shadow: 0 0 0 3px rgba(36,88,207,.08); }
.ui-sidebar-search .ui-icon { width: 17px; height: 17px; }
.ui-sidebar-search input { min-width: 0; flex: 1; background: transparent; border: 0; outline: none; color: var(--ui-ink); font-size: .80rem; padding: .4rem 0; }
.ui-sidebar-search input:focus { outline: none !important; }
.ui-sidebar-search kbd { font-family: inherit; font-size: .8rem; width: 21px; height: 22px; border: 1px solid var(--ui-border); text-align: center; border-radius: 5px; color: #96a6ba; }
.ui-sidebar-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 20px; scrollbar-width: thin; scrollbar-color: #d8e2ee transparent; }
.ui-navigation { display: grid; gap: .25rem; }
.ui-nav-group.nav-group, .ui-nav-group.nav-group[open] { background: transparent; padding: 0; border: 0; border-radius: 10px; }
.ui-nav-group > summary, .ui-nav-group[open] > summary {
  display: flex; align-items: center; justify-content: space-between;
  color: #8290a4; padding: .72rem .75rem .45rem; font-size: .73rem;
  font-weight: 900; text-transform: none; min-height: 37px; outline-offset: 1px;
}
.ui-nav-group > summary::after { content: none !important; }
.ui-nav-group > summary:hover { color: var(--ui-brand); }
.ui-nav-group-count { font-size: .68rem; line-height: 1; min-width: 20px; background: #eef2f8; color: #8b9ab0; border-radius: 6px; text-align: center; padding: .3rem; }
.ui-nav-links { display: grid; gap: 3px; padding: 2px 0 8px; }
.ui-nav-link.nav-link { min-height: 40px; padding: .56rem .7rem; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: .83rem; color: #53667e; background: transparent; box-shadow: none; transform: none; overflow: visible; }
.ui-nav-link.nav-link::before { display: none; }
.ui-nav-link.nav-link .ui-nav-icon { width: 18px; height: 18px; color: #8a9ab1; }
.ui-nav-link.nav-link:hover { background: #f3f7ff; color: #1854b8; border-color: transparent; transform: none; }
.ui-nav-link.nav-link.active, html.dark-mode .ui-nav-link.nav-link.active {
  background: #eaf2ff !important; color: #194fb8 !important; border: 1px solid #d7e6fd !important; box-shadow: none !important;
}
.ui-nav-link.nav-link.active .ui-nav-icon { color: #2458cf; }
.ui-nav-link[hidden], .ui-nav-group[hidden] { display: none !important; }
.ui-nav-empty { padding: 1rem; color: var(--ui-muted); font-size: .83rem; }
.ui-sidebar-account { margin-top: auto; padding: 12px 15px 18px; border-top: 1px solid var(--ui-border); background: #fff; }
.ui-account-link { display: flex; align-items: center; gap: .6rem; padding: .55rem; border-radius: 12px; color: var(--ui-ink); }
.ui-account-link:hover { background: #f5f8fc; }
.ui-avatar { display: flex; align-items: center; justify-content: center; width: 43px; height: 43px; border-radius: 12px; flex: none; background: linear-gradient(140deg, #1e64bd, #00959c); color: #fff; font-size: 1rem; font-weight: 900; }
.ui-avatar-small { width: 32px; height: 32px; border-radius: 9px; font-size: .8rem; }
.ui-account-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ui-account-text strong { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-account-text small { font-size: .73rem; color: var(--ui-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-account-link > .ui-icon { width: 17px; height: 17px; color: #a4b3c2; }
.ui-main-column { flex: 1; min-width: 0; }
.ui-topbar.app-topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 17px clamp(18px, 3vw, 42px); margin: 0;
  background: rgba(255,255,255,.96) !important; border: 0 !important;
  border-bottom: 1px solid var(--ui-border) !important; border-radius: 0;
  box-shadow: none !important; backdrop-filter: blur(15px);
}
.ui-topbar-heading { min-width: 0; display: flex; align-items: center; gap: 12px; }
.ui-breadcrumb { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .72rem; color: #8a99ad; margin-bottom: .16rem; }
.ui-breadcrumb a { color: #6a7c96; }
.ui-breadcrumb a:hover { color: var(--ui-brand); }
.ui-title-stack h1 { margin: 0; font-size: clamp(1.1rem, 1.6vw, 1.45rem); color: var(--ui-ink); line-height: 1.38; font-weight: 900; }
.ui-topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: .52rem; flex-shrink: 0; }
.ui-topbar-profile { display: flex; align-items: center; gap: .55rem; padding: .32rem .5rem; margin-inline-start: .35rem; border-right: 1px solid var(--ui-border); color: #39506a; font-size: .8rem; font-weight: 800; }
.ui-topbar-profile:hover { color: var(--ui-brand); }
.ui-topbar-profile span:last-child { max-width: 140px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ui-logout { color: #a24b56; }
.ui-logout:hover { color: #a72237; background: #fff4f5; }
.ui-menu-toggle { display: none; }
.ui-workspace { max-width: 1540px; width: 100%; margin: auto; padding: clamp(18px, 2.5vw, 36px); min-height: calc(100vh - 82px); }
.ui-workspace > .public-footer { margin-top: 44px; }
.ui-drawer-backdrop { display: none; }
/* Dashboard, tables and records */
.ui-dashboard-welcome.dashboard-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 152px; background: #fff; border: 1px solid var(--ui-border); }
.ui-dashboard-welcome.dashboard-hero::after { display: none; }
.ui-dashboard-welcome .dashboard-hero-copy { min-width: 220px; }
.ui-dashboard-welcome .dashboard-hero-copy h2 { color: var(--ui-ink); font-size: 1.35rem; }
.ui-dashboard-welcome .dashboard-hero-copy p { color: var(--ui-muted); font-size: .88rem; margin-top: .4rem; }
.ui-dashboard-welcome .dashboard-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-start; }
.ui-stat-card.metric-card { display: flex; flex-direction: column; justify-content: space-between; min-height: 130px; border-radius: 15px; position: relative; overflow: hidden; }
.ui-stat-card.metric-card::after { content: ''; position: absolute; inset-inline-end: -25px; bottom: -38px; width: 105px; height: 105px; border: 21px solid rgba(36,88,207,.035); border-radius: 50%; pointer-events: none; }
.ui-stat-top { display: flex; align-items: center; gap: .5rem; justify-content: space-between; }
.ui-stat-card .metric-kicker { font-size: .82rem; color: #6d7c90 !important; font-weight: 800; }
.ui-stat-card .metric-value { font-size: clamp(1.7rem, 2.2vw, 2.3rem); line-height: 1.2; font-weight: 900; color: #162b47; margin-top: 12px; }
.ui-stat-deco { display: grid; place-items: center; flex: none; width: 37px; height: 37px; border-radius: 11px; background: #ecf3ff; color: #2761cb; }
.ui-stat-deco .ui-icon { width: 18px; }
.ui-stat-card[data-tone="teal"] .ui-stat-deco { background: #e6f8f6; color: #008a7e; }
.ui-stat-card[data-tone="amber"] .ui-stat-deco { background: #fff6df; color: #ab7418; }
.ui-stat-card[data-tone="indigo"] .ui-stat-deco { background: #f1edff; color: #6a51c5; }
.ui-stat-card[data-tone="slate"] .ui-stat-deco { background: #eef2f6; color: #526780; }
.dashboard-tables .table-card { min-width: 0; }
.ui-resource-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin: 0 0 18px; }
.ui-resource-heading h2 { font-size: 1.4rem; font-weight: 900; color: var(--ui-ink); margin: 0; }
.ui-resource-heading p { color: var(--ui-muted); font-size: .83rem; margin-top: .35rem; }
.ui-resource-total { display: inline-flex; flex: none; background: #eaf2ff; color: #2458cf; font-size: .78rem; font-weight: 800; padding: .45rem .8rem; border-radius: 8px; }
.ui-resource-filters { border-radius: 15px; }
.ui-resource-filter-form { align-items: end; }
.ui-resource-filter-form > .flex-1 { min-width: 205px; }
.ui-data-card { border-radius: 15px; }
.table { font-size: .85rem; border-spacing: 0; }
.table th, html.dark-mode .table th { color: #647994 !important; font-size: .77rem; font-weight: 900; background: #f7f9fc; padding: .94rem 1rem; border-bottom: 1px solid var(--ui-border); }
.table td { padding: .94rem 1rem; border-bottom: 1px solid #eff2f6; color: #344963; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcff; }
.table .table-actions { display: flex; align-items: center; gap: .35rem; }
.table .action-icon { background: #f7f9fc; color: #426083; border: 1px solid #e3ebf5; border-radius: 9px; width: 34px; height: 34px; }
.table .action-icon:hover { color: #164abb; background: #eaf2ff; }
.table .action-icon-danger:hover { color: #ab2038; background: #fff0f3; }
.table-card-count, .permission-count { font-weight: 800; background: #ecf4ff; color: #2155bb; border-radius: 8px; }
/* Search results and marketplace cards */
.ui-public-body { background: #f8faff !important; }
.ui-public-container { max-width: 1280px; margin-inline: auto; padding-inline: 18px; }
.ui-public-header { position: sticky; top: 0; z-index: 75; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--ui-border); backdrop-filter: blur(18px); }
.ui-public-nav { min-height: 78px; display: flex; align-items: center; gap: clamp(20px,3vw,48px); }
.ui-public-brand { display: flex; align-items: center; flex: none; }
.ui-public-brand img { width: 155px; height: 57px; object-fit: contain; }
.ui-public-links { display: flex; flex-wrap: wrap; gap: .35rem; }
.ui-public-links a { display: inline-flex; align-items: center; gap: .4rem; font-size: .83rem; font-weight: 800; color: #516680; padding: .65rem .75rem; border-radius: 10px; }
.ui-public-links a:hover { color: var(--ui-brand); background: #eef4ff; }
.ui-public-links .ui-icon { width: 17px; height: 17px; }
.ui-public-actions { margin-inline-start: auto; display: flex; gap: .65rem; align-items: center; }
.ui-link-login { color: #334967; font-weight: 800; font-size: .85rem; padding: .6rem; white-space: nowrap; }
.ui-link-login:hover { color: var(--ui-brand); }
.ui-public-actions .btn-primary { font-size: .82rem; min-height: 41px; }
.ui-public-actions .btn-primary .ui-icon { width: 16px; height: 16px; }
.ui-public-menu-button { display: none; }
.ui-public-mobile-links { display: none; }
.ui-public-main { min-height: 50vh; }
.ui-public-main > section { position: relative; }
.ui-home-hero { padding-top: clamp(35px,5vw,68px); padding-bottom: clamp(35px,5vw,55px); }
.ui-hero-content { display: grid; grid-template-columns: minmax(0,1.06fr) minmax(380px,.94fr); align-items: center; gap: clamp(32px,4vw,70px); min-height: 450px; }
.ui-hero-copy { padding-bottom: 14px; }
.ui-hero-overline { display: inline-flex; align-items: center; gap: .55rem; border: 1px solid #cbe1f3; background: #edf8fc; color: #086d88; padding: .45rem .85rem; border-radius: 999px; font-size: .82rem; font-weight: 900; margin-bottom: 1.4rem; }
.ui-hero-overline .ui-icon { width: 17px; height: 17px; }
.ui-hero-copy h1 { font-size: clamp(2.65rem,4.4vw,4.8rem); font-weight: 900; line-height: 1.27; letter-spacing: -.04em; color: #122c4b; }
.ui-hero-copy h1 span { color: #2373be; }
.ui-hero-copy > p { max-width: 580px; margin-top: 1.2rem; line-height: 2; font-size: 1rem; color: #5a718c; }
.ui-hero-quicklinks { display: flex; gap: .65rem; flex-wrap: wrap; margin-top: 1.75rem; }
.ui-hero-quicklinks a { display: inline-flex; align-items: center; gap: .45rem; background: #fff; border: 1px solid #dbe8f4; border-radius: 11px; padding: .7rem .82rem; color: #425d7d; font-size: .82rem; font-weight: 800; }
.ui-hero-quicklinks a:hover { background: #ecf4ff; border-color: #adc9f2; color: var(--ui-brand); }
.ui-hero-quicklinks .ui-icon { width: 17px; height: 17px; }
.ui-hero-search.card { position: relative; padding: clamp(22px,3vw,32px); background: #fff; box-shadow: 0 20px 60px rgba(31,66,115,.09); border-radius: 22px; }
.ui-hero-search::before { content: ''; position: absolute; width: 60%; height: 70%; top: -38px; left: -25px; z-index: -1; background: #dbeeff; filter: blur(44px); border-radius: 70%; opacity: .7; }
.ui-hero-search-head { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.3rem; }
.ui-hero-search-head > div { display: flex; flex-direction: column; }
.ui-hero-search-head b { font-size: 1.11rem; color: #19314c; }
.ui-hero-search-head small { color: #8798ac; font-size: .78rem; font-weight: 700; }
.ui-search-icon { display: grid; place-items: center; width: 45px; height: 45px; background: #edf4ff; color: #2458cf; border-radius: 12px; }
.ui-hero-submit { width: 100%; min-height: 49px; }
.ui-hero-submit .ui-icon { width: 19px; height: 19px; }
.ui-search-footnote { display: flex; gap: .45rem; align-items: flex-start; color: #8291a6; font-size: .72rem; margin-top: 1.15rem; line-height: 1.9; }
.ui-search-footnote .ui-icon { width: 16px; height: 16px; margin-top: 3px; }
.ui-services-intro { padding-top: 2.2rem; padding-bottom: 3.5rem; }
.ui-section-heading { margin-bottom: 1.4rem; }
.ui-section-heading h2 { font-size: clamp(1.3rem,2.1vw,2rem); font-weight: 900; color: var(--ui-ink); }
.ui-section-heading p { color: var(--ui-muted); font-size: .85rem; margin-top: .3rem; }
.ui-services-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.ui-service-tile { position: relative; display: flex; flex-direction: column; gap: .4rem; min-height: 185px; background: #fff; border: 1px solid var(--ui-border); border-radius: 17px; padding: 1.35rem; box-shadow: var(--ui-shadow); color: #263e5a; transition: border-color .2s, box-shadow .2s; }
.ui-service-tile:hover { border-color: #b8d0ef; box-shadow: var(--ui-shadow-hover); }
.ui-service-tile strong { font-size: .98rem; font-weight: 900; }
.ui-service-tile small { font-size: .75rem; color: #71829a; font-weight: 700; }
.ui-service-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 12px; margin-bottom: .45rem; }
.ui-service-blue { background: #eaf2ff; color: #2458cf; }
.ui-service-teal { background: #e5f7f5; color: #068e82; }
.ui-service-violet { background: #f3efff; color: #6d55bb; }
.ui-service-orange { background: #fff3e7; color: #b66c23; }
.ui-service-arrow { position: absolute; left: 17px; top: 22px; color: #9fafc4; }
.ui-service-arrow .ui-icon { width: 17px; height: 17px; }
.ui-results-search { padding-bottom: 10px; }
.ui-search-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.3rem; }
.ui-search-panel-heading h1 { font-size: 1.5rem; font-weight: 900; color: var(--ui-ink); }
.ui-search-primary { display: grid; grid-template-columns: minmax(180px,1.7fr) minmax(160px,1fr) minmax(130px,1fr) auto; gap: 12px; align-items: end; }
.ui-search-primary .btn-primary { min-height: 46px; }
.ui-advanced-filters { border-top: 1px solid var(--ui-border); margin-top: 19px; padding-top: 12px; }
.ui-advanced-filters summary { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; color: #2354a1; cursor: pointer; font-weight: 900; font-size: .83rem; }
.ui-advanced-filters summary span { color: var(--ui-muted); font-size: .75rem; font-weight: 700; }
.ui-search-advanced-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; padding-top: 1rem; }
.ui-public-main .max-w-7xl { max-width: 1280px; }
.ui-public-main .doctor-client-card { border-radius: 16px; }
.ui-public-main .doctor-client-card:hover { border-color: #b8d0f1; box-shadow: var(--ui-shadow-hover); transform: none; }
.ui-public-main .doctor-client-meta span { font-weight: 800; }
.ui-public-main .doctor-client-actions a:last-child { background: #2458cf; color: #fff; border-color: #2458cf; }
.ui-public-main .doctor-client-actions a:last-child:hover { background: #1745ae; }
.ui-public-main .rated-card, .ui-public-main .specialty-band { border-radius: 16px; }
.public-footer { background: #fff; border-top: 1px solid var(--ui-border); color: var(--ui-muted); }
.public-footer .footer-links a:hover { color: var(--ui-brand); }
/* Login / registration */
.ui-auth-body { min-height: 100vh; }
.ui-auth-layout { display: grid; grid-template-columns: minmax(360px,.95fr) minmax(320px,1.05fr); min-height: 100vh; }
.ui-auth-panel { padding: 28px clamp(22px,5vw,75px) 20px; display: flex; flex-direction: column; background: #fff; }
.ui-auth-brand img { width: 156px; height: 64px; object-fit: contain; }
.ui-auth-content { width: 100%; max-width: 460px; margin: auto; padding: 35px 0; }
.ui-auth-content > h1 { font-size: clamp(1.6rem,2.6vw,2.3rem); font-weight: 900; line-height: 1.45; }
.ui-auth-subtitle { color: #6c7f96; font-size: .9rem; margin-top: .3rem; margin-bottom: 1.8rem; }
.ui-auth-card.card { border: 0; padding: 0 !important; border-radius: 0; box-shadow: none; background: transparent; }
.ui-auth-card.card:hover { box-shadow: none; }
.ui-auth-card form .btn-primary { min-height: 49px; }
.ui-auth-card .input { min-height: 48px; }
.ui-auth-back { font-size: .83rem; margin-top: 15px; color: #647a95; }
.ui-auth-back a { display: inline-flex; gap: .45rem; align-items: center; }
.ui-auth-back .ui-icon { width: 16px; height: 16px; }
.ui-auth-aside { display: flex; align-items: center; padding: clamp(40px,8vw,100px); position: relative; overflow: hidden; background: linear-gradient(140deg,#113b7c,#176aaa 68%,#048c9d); color: #fff; }
.ui-auth-aside::before { content: ''; position: absolute; width: 490px; height: 490px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; top: -200px; left: -100px; box-shadow: 0 0 0 65px rgba(255,255,255,.025), 0 0 0 135px rgba(255,255,255,.018); }
.ui-auth-aside-copy { position: relative; max-width: 530px; z-index: 1; }
.ui-auth-aside-icon { display: grid; place-items: center; height: 68px; width: 68px; border-radius: 20px; background: rgba(255,255,255,.16); margin-bottom: 2rem; }
.ui-auth-aside-icon .ui-icon { height: 32px; width: 32px; }
.ui-auth-aside .ui-eyebrow { color: #bcecf5; font-size: .89rem; }
.ui-auth-aside h2 { font-size: clamp(2.3rem,4vw,3.8rem); line-height: 1.35; font-weight: 900; margin-bottom: 1.1rem; }
.ui-auth-aside p { font-size: .96rem; line-height: 2.1; color: #deebfc; max-width: 420px; }
.ui-auth-benefits { display: grid; gap: 1rem; margin-top: 2.8rem; }
.ui-auth-benefits span { display: flex; gap: .7rem; align-items: center; color: #e7f3ff; font-size: .9rem; font-weight: 800; }
.ui-auth-benefits .ui-icon { color: #aaf4e8; width: 18px; height: 18px; }
/* Improved empty states, status, controls and overlays */
.ui-workspace .table td.text-center, .ui-public-main .card .text-center.text-slate-500 { color: #71849c !important; }
.price-preview, .info-tile, .detail-summary-item { border-radius: 12px; }
.live-dropdown { border-radius: 14px; border: 1px solid var(--ui-border); box-shadow: 0 18px 40px rgba(28,52,86,.14); }
.live-menu-wrap { position: relative; }
.live-menu-wrap .live-count { position: absolute; top: -6px; left: -5px; font-size: .62rem; border: 2px solid #fff; border-radius: 99px; min-width: 21px; height: 21px; line-height: 17px; }
/* Dark palette is available in the admin layout only. */
html.dark-mode { color-scheme: dark; --ui-ink: #edf4ff; --ui-muted: #acbcd2; --ui-brand: #80adff; --ui-brand-hover: #619af8; --ui-accent: #52bbcc; --ui-bg: #101b2a; --ui-card: #1b2b40; --ui-tint: #1c3957; --ui-border: #31465e; --ui-border-strong: #43566d; }
html.dark-mode body.ui-admin-body, html.dark-mode body.loopai-app { background: var(--ui-bg) !important; color: var(--ui-ink); }
html.dark-mode .ui-sidebar.app-sidebar.loopai-sidebar, html.dark-mode .ui-sidebar-account, html.dark-mode .ui-topbar.app-topbar { background: #172639 !important; border-color: var(--ui-border) !important; }
html.dark-mode .ui-topbar-profile, html.dark-mode .ui-title-stack h1, html.dark-mode .ui-nav-link.nav-link, html.dark-mode .ui-account-link, html.dark-mode .ui-sidebar-brand, html.dark-mode .ui-resource-heading h2 { color: #e9f2ff; }
html.dark-mode .ui-sidebar-search, html.dark-mode .ui-icon-button, html.dark-mode .ui-stat-deco, html.dark-mode .ui-nav-group-count { background: #23354c; border-color: #354b65; color: #b8cbe6; }
html.dark-mode .ui-sidebar-search input, html.dark-mode .ui-stat-card .metric-value { color: #eef4ff; }
html.dark-mode .ui-nav-link.nav-link:hover { background: #263e59; color: #bbd3ff; }
html.dark-mode .ui-nav-link.nav-link.active, html.dark-mode .ui-nav-link.nav-link.active { background: #24426b !important; color: #d7e8ff !important; border-color: #3a5b8b !important; }
html.dark-mode .ui-nav-link.nav-link.active .ui-icon { color: #a3c7ff; }
html.dark-mode .ui-dashboard-welcome.dashboard-hero, html.dark-mode .card, html.dark-mode .rated-card, html.dark-mode .specialty-band, html.dark-mode .doctor-client-card { background: #1b2b40 !important; color: #edf4ff; border-color: #31465e !important; }
html.dark-mode .ui-dashboard-welcome h2, html.dark-mode .ui-dashboard-welcome p, html.dark-mode .ui-stat-card .metric-kicker { color: #bfcee0 !important; }
html.dark-mode .input, html.dark-mode .smart-select-toggle, html.dark-mode .btn { background: #203249; border-color: #3b5069; color: #e8f2ff; }
html.dark-mode .table td { border-color: #33475e; color: #e4efff; }
html.dark-mode .table th { background: #22374d; border-color: #33475e; color: #c0d0e4 !important; }
html.dark-mode .table tbody tr:hover td { background: #233b55; }
html.dark-mode .ui-breadcrumb a, html.dark-mode .ui-breadcrumb { color: #a9bad0; }
html.dark-mode .ui-account-link:hover, html.dark-mode .ui-icon-button:hover { background: #284462; }
/* Responsive navigation and fluid page layouts */
@media (max-width: 1199px) {
  .ui-sidebar.app-sidebar.loopai-sidebar { width: 253px; flex-basis: 253px; }
  .ui-topbar-profile span:last-child { display: none; }
  .ui-public-nav { gap: 15px; }
  .ui-public-links a { padding: .6rem .45rem; }
  .ui-search-advanced-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 1023px) {
  .ui-sidebar.app-sidebar.loopai-sidebar { position: fixed; width: min(320px,88vw); height: 100dvh; min-height: 0; right: 0; top: 0; transform: translateX(110%); transition: transform .25s ease; box-shadow: none !important; }
  body.ui-drawer-open .ui-sidebar.app-sidebar.loopai-sidebar { transform: translateX(0); box-shadow: -20px 0 60px rgba(10,20,40,.23) !important; }
  .ui-close-drawer { display: inline-flex; }
  .ui-menu-toggle { display: inline-flex; }
  .ui-drawer-backdrop:not([hidden]) { position: fixed; display: block; inset: 0; z-index: 49; background: rgba(10,24,47,.52); backdrop-filter: blur(2px); }
  body.ui-drawer-open { overflow: hidden; }
  .ui-hero-content { grid-template-columns: 1fr; max-width: 760px; margin-inline: auto; }
  .ui-hero-copy h1 { font-size: clamp(2.7rem,7vw,4.4rem); }
  .ui-services-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ui-auth-aside { padding: 40px; }
  .ui-auth-aside h2 { font-size: 2.3rem; }
  .ui-dashboard-welcome.dashboard-hero { flex-direction: column; align-items: flex-start; }
  .ui-search-primary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 767px) {
  .ui-public-links { display: none; }
  .ui-public-menu-button { display: inline-flex; }
  .ui-public-mobile-links:not([hidden]) { display: grid; padding: 6px 20px 16px; gap: 4px; border-top: 1px solid #edf1f7; }
  .ui-public-mobile-links a { padding: .7rem 1rem; color: #426080; font-weight: 800; border-radius: 9px; }
  .ui-public-mobile-links a:hover { background: #eff5fd; }
  .ui-public-nav { min-height: 66px; }
  .ui-public-brand img { height: 50px; width: 130px; }
  .ui-auth-layout { display: flex; min-height: 100dvh; }
  .ui-auth-panel { flex: 1; padding: 22px; }
  .ui-auth-aside { display: none; }
  .ui-auth-content { max-width: 510px; padding: 60px 0; }
  .ui-search-advanced-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ui-topbar { flex-wrap: wrap; }
  .ui-resource-heading { align-items: flex-start; }
}
@media (max-width: 639px) {
  .ui-topbar.app-topbar { padding: 12px 15px; flex-wrap: nowrap; }
  .ui-topbar-actions { gap: .3rem; }
  .ui-topbar-actions .ui-icon-button { width: 37px; height: 37px; border-radius: 10px; }
  .ui-header-search, .ui-topbar-profile, .ui-logout { display: none !important; }
  .ui-title-stack h1 { font-size: 1rem; line-height: 1.4; max-width: 200px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
  .ui-breadcrumb { font-size: .65rem; }
  .ui-workspace { padding: 16px 12px; }
  .ui-dashboard-welcome.dashboard-hero { padding: 1.15rem !important; }
  .ui-stat-card.metric-card { min-height: 118px; }
  .ui-resource-heading { display: block; }
  .ui-resource-total { margin-top: 10px; }
  .ui-resource-filter-form .btn, .ui-resource-filter-form .btn-primary { flex: 1 1 auto; }
  .ui-public-actions { gap: .2rem; }
  .ui-link-login { display: none; }
  .ui-public-actions .btn-primary { padding: .6rem .72rem; min-width: 0; font-size: .77rem; }
  .ui-home-hero { padding-top: 25px; }
  .ui-hero-copy h1 { font-size: 2.35rem; }
  .ui-hero-copy > p { font-size: .88rem; }
  .ui-hero-quicklinks { gap: .45rem; }
  .ui-hero-quicklinks a { font-size: .74rem; padding: .6rem .65rem; }
  .ui-hero-search.card { padding: 18px; }
  .ui-services-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .ui-service-tile { min-height: 159px; padding: .85rem; }
  .ui-service-tile strong { font-size: .83rem; }
  .ui-service-tile small { font-size: .69rem; }
  .ui-service-icon { width: 38px; height: 38px; }
  .ui-search-panel-heading { align-items: flex-start; }
  .ui-search-panel-heading h1 { font-size: 1.15rem; }
  .ui-search-panel-heading > .btn { font-size: .74rem; padding: .55rem; }
  .ui-search-primary, .ui-search-advanced-grid { grid-template-columns: 1fr; }
  .ui-search-primary .btn-primary { width: 100%; }
  .ui-search-panel.card { padding: 1rem !important; }
  .ui-public-main section .flex.items-center.justify-between { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}
@media print {
  .ui-sidebar, .ui-topbar, .ui-drawer-backdrop, .ui-public-header, .ui-public-actions, .ui-resource-filters, .ui-icon-button, .ui-dashboard-welcome .dashboard-actions, .public-footer { display: none !important; }
  .ui-shell, .ui-main-column, .ui-workspace { display: block; width: 100%; max-width: none; margin: 0; padding: 0; }
  body, body.loopai-app { background: white !important; }
  .card { border-color: #ddd; box-shadow: none; break-inside: avoid; }
  .table { font-size: 10px; }
}

/* Remove illustrative progress decoration inherited from the old dashboard: it implied a metric that did not exist. */
.ui-stat-card.metric-card::after, .ui-stat-card.metric-card::before { display: none !important; }

.ui-resource-filter-form { flex-wrap: wrap; }
.ui-data-card .action-icon .ui-icon { width: 16px; height: 16px; }

/* Independent footer grid: resilient when Tailwind CDN is unavailable. */
.ui-footer { margin-top: 3rem; background: #fff; color: #697d95; border-top: 1px solid #e4ebf3; }
.ui-footer-container { max-width: 1280px; margin: 0 auto; padding-inline: 24px; }
.ui-footer-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,.8fr) minmax(0,.8fr); gap: clamp(22px,5vw,72px); padding-top: 48px; padding-bottom: 40px; }
.ui-footer-brand { display: block; width: 165px; margin-bottom: 12px; }
.ui-footer-brand img { width: 100%; height: auto; object-fit: contain; }
.ui-footer-about p { max-width: 350px; line-height: 2; font-size: .84rem; }
.ui-footer h3 { color: #314661; font-size: .9rem; font-weight: 900; margin-bottom: 17px; }
.ui-footer-links { display: grid; gap: 12px; justify-items: start; }
.ui-footer-links a { font-size: .8rem; font-weight: 700; color: #6d8097; }
.ui-footer-links a:hover { color: #2458cf; }
.ui-footer-bottom, .ui-footer-compact-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .73rem; border-top: 1px solid #e8edf3; padding-top: 19px; padding-bottom: 21px; }
.ui-footer-compact { margin-top: 3rem; border-top: 0; background: transparent; }
.ui-footer-compact-inner { border-color: #e2e9f3; }
html.dark-mode .ui-footer-compact { background: transparent; color: #b4c3d6; }
html.dark-mode .ui-footer-compact-inner { border-color: #31465e; }
@media (max-width: 767px) { .ui-footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 25px; padding-top: 32px; } .ui-footer-about { grid-column: 1 / -1; } .ui-footer-bottom { display: block; } .ui-footer-bottom span { display: block; margin: 7px 0; } }
/* Error states share the same brand and typography as the main layouts. */
.ui-error-container { display: grid; min-height: 100dvh; place-items: center; padding: 22px; }
.ui-error-card { width: min(100%, 510px); text-align: center; padding: clamp(28px,5vw,50px); }
.ui-error-brand { display: block; width: 170px; height: auto; margin: 0 auto 16px; }
.ui-error-code { display: block; font-size: clamp(3rem,7vw,5rem); line-height: 1.2; font-weight: 900; color: #2458cf; }
.ui-error-card h1 { font-size: 1.35rem; font-weight: 900; margin: 7px 0 12px; }
.ui-error-card p { font-size: .85rem; line-height: 2; color: #71849e; }
.ui-error-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
@media (max-width: 640px) { .live-dropdown:not(.hidden) { position: fixed !important; top: 70px !important; right: 12px !important; left: 12px !important; width: auto !important; max-width: none !important; } }

/* Long forms have a clear hierarchy and a reachable primary action. */
.ui-resource-form-card { overflow: visible; }
.ui-form-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--ui-border); margin-bottom: 1.4rem; padding-bottom: 1.25rem; }
.ui-form-heading h2 { color: var(--ui-ink); font-size: 1.28rem; font-weight: 900; line-height: 1.5; }
.ui-form-heading p { color: var(--ui-muted); font-size: .82rem; margin-top: .2rem; }
.ui-form-actions { position: sticky; bottom: 0; z-index: 5; padding: .9rem 0; background: var(--ui-card); border-top: 1px solid var(--ui-border); }
.ui-report-stat { border-radius: 15px; }
.ui-report-stat .text-3xl { color: var(--ui-ink); font-size: 1.75rem; }
@media (max-width: 640px) { .ui-form-heading { align-items: flex-start; flex-direction: column; } .ui-form-actions > * { flex: 1; } }
/* Tailwind's preflight also applies these resets; keeping them here prevents layout drift if the CDN fails. */
html, body { margin: 0; }
h1, h2, h3, h4, p { margin: 0; }
.ui-auth-aside h2 { color: #fff !important; }
.ui-auth-back a { color: #45648c; }
.ui-auth-back a:hover { color: #2458cf; }
