
/* =========================================================
   OmnivasOS — GLOBAL COORDINATED THEME SYSTEM
   The theme changes complete design tokens, not isolated colors.
   ========================================================= */

:root,
html[data-theme="carelink"]{
  --theme-primary:#0B1F3A;
  --theme-primary-strong:#07162A;
  --theme-primary-soft:#163A70;
  --theme-accent:#D4AF37;
  --theme-accent-soft:#F5E8B5;
  --theme-page:#F7F9FC;
  --theme-page-top:#FFFFFF;
  --theme-surface:#FFFFFF;
  --theme-surface-soft:#F3F6FA;
  --theme-text:#1D2A3A;
  --theme-heading:#0B1F3A;
  --theme-muted:#66758A;
  --theme-border:#CBD4DF;
  --theme-border-soft:#DFE5EC;
  --theme-on-primary:#FFFFFF;
  --theme-on-accent:#0B1F3A;
  --theme-overlay:rgba(11,31,58,.58);
  --theme-shadow:0 12px 32px rgba(11,31,58,.08);
  --theme-shadow-lg:0 24px 62px rgba(11,31,58,.18);
  --theme-success:#157347;
  --theme-success-soft:#EAF7F0;
  --theme-warning:#9A6400;
  --theme-warning-soft:#FFF4D8;
  --theme-danger:#B42318;
  --theme-danger-soft:#FFF0EE;

  /* legacy aliases so existing CSS participates automatically */
  --navy:var(--theme-primary);
  --navy-light:var(--theme-primary-soft);
  --gold:var(--theme-accent);
  --gold-soft:var(--theme-accent-soft);
  --white:var(--theme-surface);
  --bg:var(--theme-page);
  --text:var(--theme-text);
  --muted:var(--theme-muted);
  --border:var(--theme-border);
  --shadow:var(--theme-shadow);
  --shadow-lg:var(--theme-shadow-lg);
  --green:var(--theme-success);
  --red:var(--theme-danger);
}

html[data-theme="emerald"]{
  --theme-primary:#123C32;
  --theme-primary-strong:#0A2922;
  --theme-primary-soft:#1E6958;
  --theme-accent:#C79A3B;
  --theme-accent-soft:#F3E5BE;
  --theme-page:#F4F8F6;
  --theme-page-top:#FCFEFD;
  --theme-surface:#FFFFFF;
  --theme-surface-soft:#EDF5F1;
  --theme-text:#172923;
  --theme-heading:#123C32;
  --theme-muted:#65766F;
  --theme-border:#C7D5CF;
  --theme-border-soft:#DBE5E0;
  --theme-on-primary:#FFFFFF;
  --theme-on-accent:#18342B;
  --theme-overlay:rgba(9,39,32,.60);
  --theme-shadow:0 12px 32px rgba(18,60,50,.09);
  --theme-shadow-lg:0 24px 62px rgba(18,60,50,.20);
}

html[data-theme="burgundy"]{
  --theme-primary:#5B1F32;
  --theme-primary-strong:#3C1221;
  --theme-primary-soft:#87354F;
  --theme-accent:#C89D45;
  --theme-accent-soft:#F4E6C4;
  --theme-page:#FAF6F7;
  --theme-page-top:#FFFFFF;
  --theme-surface:#FFFFFF;
  --theme-surface-soft:#F7EEF1;
  --theme-text:#2C2024;
  --theme-heading:#5B1F32;
  --theme-muted:#78686D;
  --theme-border:#D9C9CE;
  --theme-border-soft:#E8DEE1;
  --theme-on-primary:#FFFFFF;
  --theme-on-accent:#35151F;
  --theme-overlay:rgba(58,15,29,.62);
  --theme-shadow:0 12px 32px rgba(91,31,50,.09);
  --theme-shadow-lg:0 24px 62px rgba(91,31,50,.20);
}

html[data-theme="slate"]{
  --theme-primary:#263746;
  --theme-primary-strong:#17232E;
  --theme-primary-soft:#455D70;
  --theme-accent:#B88B3D;
  --theme-accent-soft:#EEE0C4;
  --theme-page:#F4F6F8;
  --theme-page-top:#FFFFFF;
  --theme-surface:#FFFFFF;
  --theme-surface-soft:#EEF2F5;
  --theme-text:#202B34;
  --theme-heading:#263746;
  --theme-muted:#697782;
  --theme-border:#C9D1D8;
  --theme-border-soft:#DDE3E8;
  --theme-on-primary:#FFFFFF;
  --theme-on-accent:#263746;
  --theme-overlay:rgba(26,39,50,.62);
  --theme-shadow:0 12px 32px rgba(38,55,70,.09);
  --theme-shadow-lg:0 24px 62px rgba(38,55,70,.20);
}

html[data-theme="dark"]{
  --theme-primary:#DCE8F5;
  --theme-primary-strong:#FFFFFF;
  --theme-primary-soft:#8EB4DC;
  --theme-accent:#E1B94B;
  --theme-accent-soft:#3B3320;
  --theme-page:#0D131A;
  --theme-page-top:#111922;
  --theme-surface:#151E28;
  --theme-surface-soft:#1C2733;
  --theme-text:#E9EFF5;
  --theme-heading:#F6FAFD;
  --theme-muted:#A7B3BF;
  --theme-border:#344454;
  --theme-border-soft:#283744;
  --theme-on-primary:#0D1620;
  --theme-on-accent:#19170F;
  --theme-overlay:rgba(2,6,10,.76);
  --theme-shadow:0 12px 32px rgba(0,0,0,.30);
  --theme-shadow-lg:0 24px 62px rgba(0,0,0,.48);
  --theme-success:#5BD195;
  --theme-success-soft:#173528;
  --theme-warning:#F0BF5A;
  --theme-warning-soft:#392D17;
  --theme-danger:#FF8177;
  --theme-danger-soft:#3C201F;

  --navy:var(--theme-heading);
  --navy-light:var(--theme-primary-soft);
  --gold:var(--theme-accent);
  --gold-soft:var(--theme-accent-soft);
  --white:var(--theme-surface);
  --bg:var(--theme-page);
  --text:var(--theme-text);
  --muted:var(--theme-muted);
  --border:var(--theme-border);
  --shadow:var(--theme-shadow);
  --shadow-lg:var(--theme-shadow-lg);
  --green:var(--theme-success);
  --red:var(--theme-danger);
}

/* Global surfaces and typography */
html{background:var(--theme-page)!important}
body{
  background:radial-gradient(circle at top,var(--theme-page-top),var(--theme-page) 72%)!important;
  color:var(--theme-text)!important;
}
body,button,input,select,textarea{
  color:var(--theme-text);
}
h1,h2,h3,h4,h5,h6,
.section-title,.auth-card-heading h2,.about-dialog h2,.about-dialog h3,.about-dialog h4{
  color:var(--theme-heading)!important;
}
.subtle,p,.auth-footnote,.hero-card p,.auth-card-heading p,.about-card p,.about-hero p{
  color:var(--theme-muted)!important;
}

/* Structural surfaces */
.care-header,
.auth-card,
.hero-card,
.panel,.stat,.order-card,.room-card,.table-card,.service-location-card,
.running-bill-card,.selected-location-bar,.prep-card,.round-card,.list-item,
.product-card,.quick-product,.modal-box,.about-dialog,.date-group,
.room-metric,.guest-stay-card,.guest-stay-grid>div,
.search-box,.field input,.field select,.field textarea,
input,select,textarea{
  background:var(--theme-surface)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-border)!important;
  box-shadow:var(--theme-shadow);
}

.auth-story,
.entry-page{
  background:var(--theme-page)!important;
}
.hero-card,
.about-hero{
  background:linear-gradient(145deg,var(--theme-surface),var(--theme-surface-soft))!important;
}

.bottom-nav,
.bottom-nav .inner{
  background:var(--theme-surface)!important;
  border-color:var(--theme-border-soft)!important;
}
.bottom-nav a{color:var(--theme-muted)!important}
.bottom-nav a.active{
  color:var(--theme-heading)!important;
  background:var(--theme-surface-soft)!important;
}

/* Primary controls */
.btn-primary,.hero-btn,.submit-btn,
.service-tab.active,.meal-drink-tab.active,.care-tab.active,
.auth-tabs button.active,.hero-badge,
.quick-product .qty-btn.plus{
  background:linear-gradient(135deg,var(--theme-primary),var(--theme-primary-soft))!important;
  color:var(--theme-on-primary)!important;
  border-color:var(--theme-accent)!important;
}
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .hero-btn,
html[data-theme="dark"] .submit-btn,
html[data-theme="dark"] .service-tab.active,
html[data-theme="dark"] .meal-drink-tab.active,
html[data-theme="dark"] .care-tab.active,
html[data-theme="dark"] .auth-tabs button.active,
html[data-theme="dark"] .hero-badge{
  background:linear-gradient(135deg,#284866,#365F83)!important;
  color:#fff!important;
}

.btn-white,.service-tab,.meal-drink-tab,.care-tab,.tab-pill,.collapse-btn,
.auth-tabs button,.icon-btn{
  background:var(--theme-surface)!important;
  color:var(--theme-heading)!important;
  border-color:var(--theme-border)!important;
}
.btn-gold{
  background:var(--theme-accent)!important;
  color:var(--theme-on-accent)!important;
}

/* Labels / accents / states */
.section-title:after,
.about-card-label,.about-contact-label,.location-card-kicker,
.guest-stay-head span{
  color:var(--theme-accent)!important;
  background-color:var(--theme-accent);
}
.about-card-label,.about-contact-label,.location-card-kicker,.guest-stay-head span{
  background:none!important;
}
.avatar{
  background:linear-gradient(145deg,var(--theme-primary),var(--theme-primary-soft))!important;
  color:var(--theme-on-primary)!important;
  border-color:var(--theme-accent)!important;
}
.room-state.available,.notice.success{
  background:var(--theme-success-soft)!important;
  color:var(--theme-success)!important;
}
.room-state.occupied,.notice.warn{
  background:var(--theme-warning-soft)!important;
  color:var(--theme-warning)!important;
}
.notice.error{
  background:var(--theme-danger-soft)!important;
  color:var(--theme-danger)!important;
}

/* Modals */
.modal-backdrop,.private-modal{
  background:var(--theme-overlay)!important;
  backdrop-filter:blur(10px);
}
.modal-head,.about-topbar,.about-footer{
  border-color:var(--theme-border-soft)!important;
}

/* Forms */
input::placeholder,textarea::placeholder{color:var(--theme-muted)!important}
input:focus,textarea:focus,select:focus{
  border-color:var(--theme-accent)!important;
  box-shadow:0 0 0 4px color-mix(in srgb,var(--theme-accent) 18%,transparent)!important;
}
input[type="file"]::file-selector-button{
  background:linear-gradient(135deg,var(--theme-primary),var(--theme-primary-soft))!important;
  color:var(--theme-on-primary)!important;
  border-color:var(--theme-accent)!important;
}

/* Theme launcher */
.omni-theme-launcher{
  position:fixed;
  right:16px;
  bottom:104px;
  z-index:5500;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border:1px solid var(--theme-border);
  border-radius:14px;
  background:var(--theme-surface);
  color:var(--theme-heading);
  box-shadow:0 10px 28px rgba(0,0,0,.12);
  font-size:18px;
  cursor:pointer;
  opacity:.92;
}
.omni-theme-launcher:hover{transform:translateY(-1px);opacity:1}
body.entry-page .omni-theme-launcher,
body.auth-page .omni-theme-launcher,
body.apply-page .omni-theme-launcher{
  bottom:18px;
}

.omni-theme-modal{
  position:fixed;
  inset:0;
  z-index:999999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:var(--theme-overlay);
  backdrop-filter:blur(10px);
}
.omni-theme-modal.show{display:flex}
.omni-theme-box{
  width:min(430px,100%);
  padding:22px;
  border:1px solid var(--theme-border);
  border-radius:24px;
  background:var(--theme-surface);
  box-shadow:var(--theme-shadow-lg);
}
.omni-theme-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:8px;
}
.omni-theme-head h2{
  margin:0;
  color:var(--theme-heading)!important;
  font-size:22px;
}
.omni-theme-box>p{
  margin:0 0 18px;
  color:var(--theme-muted)!important;
  font-size:13px;
  line-height:1.55;
}
.omni-theme-close{
  width:40px;height:40px;border:0;border-radius:13px;
  background:var(--theme-surface-soft);color:var(--theme-heading);
  font-size:20px;cursor:pointer;
}
.omni-theme-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.omni-theme-choice{
  min-height:72px;
  padding:12px;
  display:flex;
  align-items:center;
  gap:11px;
  border:1px solid var(--theme-border);
  border-radius:16px;
  background:var(--theme-surface);
  color:var(--theme-heading);
  text-align:left;
  cursor:pointer;
}
.omni-theme-choice.active{
  border-color:var(--theme-accent);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--theme-accent) 15%,transparent);
}
.omni-theme-swatch{
  width:34px;height:34px;flex:0 0 34px;border-radius:11px;
  border:1px solid rgba(255,255,255,.35);
  box-shadow:0 5px 12px rgba(0,0,0,.12);
}
.omni-theme-choice strong{display:block;font-size:12px}
.omni-theme-choice small{display:block;margin-top:3px;color:var(--theme-muted);font-size:9px}

@media(max-width:520px){
  .omni-theme-launcher{right:12px;bottom:98px;width:40px;height:40px;border-radius:13px}
  .omni-theme-grid{grid-template-columns:1fr}
  .omni-theme-choice{min-height:58px}
}
