
/* ============================================================
   Wated Health Final UI Foundation
   Premium Medical SaaS RTL UI
   ============================================================ */

:root{
  --wh-bg:#e7ddbc;
  --wh-bg-soft:#f7f0db;
  --wh-shell:#fffdf9;
  --wh-card:#ffffff;
  --wh-card-soft:#fbfaf7;
  --wh-border:#eee7da;
  --wh-border-strong:#dfd1b4;

  --wh-text:#1f1d1a;
  --wh-text-2:#39342d;
  --wh-muted:#958d7d;
  --wh-muted-2:#b1a895;

  --wh-gold:#b88722;
  --wh-gold-2:#d0aa4a;
  --wh-gold-dark:#8f6412;
  --wh-gold-soft:#f5ecd6;

  --wh-green:#18a56f;
  --wh-green-soft:#eaf9f2;
  --wh-red:#c94747;
  --wh-red-soft:#fff0ef;
  --wh-blue:#466d9d;
  --wh-blue-soft:#eef4fb;

  --wh-shadow-lg:0 34px 95px rgba(84,72,38,.20);
  --wh-shadow-md:0 18px 48px rgba(50,42,25,.08);
  --wh-shadow-sm:0 10px 24px rgba(38,32,20,.055);

  --wh-radius-page:34px;
  --wh-radius-xl:28px;
  --wh-radius-lg:22px;
  --wh-radius-md:16px;
  --wh-radius-sm:12px;

  --wh-sidebar:280px;
  --wh-topbar:76px;

  --wh-font:'Tajawal',Tahoma,Arial,sans-serif;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  color:var(--wh-text);
  font-family:var(--wh-font);
  background:
    radial-gradient(circle at 12% 9%,rgba(255,255,255,.66),transparent 24%),
    radial-gradient(circle at 88% 4%,rgba(255,255,255,.36),transparent 22%),
    linear-gradient(135deg,var(--wh-bg-soft),var(--wh-bg));
}
button,input,select,textarea,a{font-family:inherit}
a{text-decoration:none;color:inherit}
button{cursor:pointer}

/* ---------- Brand ---------- */
.wh-mark{
  width:58px;
  height:58px;
  border-radius:50%;
  background:linear-gradient(135deg,#fffaf0,#f1e2bb);
  border:1px solid #e2d0a2;
  display:grid;
  place-items:center;
  box-shadow:0 14px 30px rgba(184,135,34,.14);
  flex:0 0 auto;
}
.wh-mark svg{width:38px;height:38px}
.wh-brand{
  display:flex;
  align-items:center;
  gap:14px;
}
.wh-brand strong{
  display:block;
  font-size:22px;
  line-height:1.1;
  letter-spacing:-.4px;
  font-weight:900;
}
.wh-brand span{
  display:block;
  margin-top:5px;
  color:var(--wh-muted);
  font-size:12.5px;
  font-weight:700;
}

/* ---------- Login Final ---------- */
.login-page{
  min-height:100vh;
  padding:34px;
  display:grid;
  place-items:center;
}
.login-shell{
  width:min(1180px,100%);
  min-height:680px;
  background:rgba(255,255,255,.86);
  border:1px solid rgba(255,255,255,.88);
  border-radius:var(--wh-radius-page);
  box-shadow:var(--wh-shadow-lg);
  display:grid;
  grid-template-columns:minmax(0,1.05fr) 430px;
  overflow:hidden;
  backdrop-filter:blur(16px);
}
.login-visual{
  position:relative;
  padding:42px;
  background:
    radial-gradient(circle at 15% 20%,rgba(255,255,255,.76),transparent 26%),
    linear-gradient(135deg,#fffaf0,#ead8a8);
  border-left:1px solid #e4d5b4;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.login-visual:before{
  content:"";
  position:absolute;
  width:420px;
  height:420px;
  border-radius:50%;
  left:-150px;
  top:-150px;
  background:rgba(184,135,34,.10);
}
.login-visual:after{
  content:"";
  position:absolute;
  width:260px;
  height:260px;
  border-radius:50%;
  right:52px;
  bottom:58px;
  border:1px solid rgba(184,135,34,.16);
  background:rgba(255,255,255,.22);
}
.login-visual-content{
  position:relative;
  z-index:2;
  max-width:560px;
}
.login-visual h1{
  margin:56px 0 18px;
  font-size:48px;
  line-height:1.18;
  letter-spacing:-1.2px;
  font-weight:900;
}
.login-visual p{
  margin:0;
  color:#756b59;
  line-height:2;
  font-size:16px;
  font-weight:600;
}
.login-metrics{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  max-width:620px;
}
.login-metric{
  background:rgba(255,255,255,.60);
  border:1px solid rgba(255,255,255,.66);
  border-radius:18px;
  padding:16px;
  box-shadow:0 12px 28px rgba(92,75,36,.08);
}
.login-metric b{
  display:block;
  font-size:24px;
  font-weight:900;
  direction:ltr;
  text-align:right;
}
.login-metric span{
  display:block;
  color:#877a66;
  margin-top:4px;
  font-size:12px;
  font-weight:800;
}
.login-panel{
  padding:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fff;
}
.login-card{
  width:100%;
}
.login-card h2{
  margin:0 0 7px;
  font-size:32px;
  line-height:1.15;
  letter-spacing:-.6px;
  font-weight:900;
}
.login-card .login-subtitle{
  margin:0 0 28px;
  color:var(--wh-muted);
  font-size:14px;
  font-weight:700;
}
.form-field{
  margin-bottom:16px;
}
.form-label{
  display:block;
  margin-bottom:8px;
  color:#554d42;
  font-size:13px;
  font-weight:900;
}
.input-wrap{
  position:relative;
}
.form-input{
  width:100%;
  height:50px;
  border:1px solid var(--wh-border);
  border-radius:17px;
  background:#fff;
  outline:none;
  padding:0 44px 0 16px;
  color:var(--wh-text);
  font-size:15px;
  font-weight:800;
  transition:.16s ease;
}
.form-input::placeholder{color:#c3baaa;font-weight:700}
.form-input:focus{
  border-color:#d2b56d;
  box-shadow:0 0 0 4px rgba(184,135,34,.10);
}
.input-icon{
  position:absolute;
  right:15px;
  top:50%;
  transform:translateY(-50%);
  color:#9a9182;
  display:grid;
  place-items:center;
}
.input-icon svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2}
.password-toggle{
  position:absolute;
  left:10px;
  top:50%;
  transform:translateY(-50%);
  width:34px;
  height:34px;
  border:0;
  border-radius:12px;
  background:#f7f3eb;
  color:#665d50;
  display:grid;
  place-items:center;
}
.password-toggle svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2}
.form-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:6px 0 20px;
}
.checkbox-line{
  display:flex;
  align-items:center;
  gap:8px;
  color:#6b6256;
  font-size:13px;
  font-weight:800;
}
.checkbox-line input{
  width:17px;
  height:17px;
  accent-color:var(--wh-gold);
}
.forgot-link{
  color:var(--wh-gold-dark);
  font-size:13px;
  font-weight:900;
}
.login-btn{
  width:100%;
  height:50px;
  border:0;
  border-radius:17px;
  color:#fff;
  background:linear-gradient(135deg,var(--wh-gold),var(--wh-gold-2));
  box-shadow:0 14px 28px rgba(184,135,34,.20);
  font-size:15px;
  font-weight:900;
  transition:.16s ease;
}
.login-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 18px 34px rgba(184,135,34,.24);
}
.login-footer{
  margin-top:22px;
  color:#a49b8b;
  font-size:12px;
  text-align:center;
  font-weight:700;
}
.alert{
  border-radius:16px;
  padding:12px 14px;
  margin-bottom:16px;
  font-size:13px;
  font-weight:900;
}
.alert-error{
  color:#a92727;
  background:var(--wh-red-soft);
  border:1px solid #ffd0ce;
}
.alert-success{
  color:#16845d;
  background:var(--wh-green-soft);
  border:1px solid #c8efd9;
}

/* ---------- App Layout Final ---------- */
.app-shell{
  width:min(1540px,calc(100% - 88px));
  min-height:calc(100vh - 88px);
  margin:44px auto;
  background:rgba(255,255,255,.92);
  border:1px solid rgba(255,255,255,.86);
  border-radius:var(--wh-radius-page);
  box-shadow:var(--wh-shadow-lg);
  display:grid;
  grid-template-columns:var(--wh-sidebar) minmax(0,1fr);
  overflow:hidden;
}
.sidebar{
  background:linear-gradient(180deg,#fff,#fbfaf7);
  border-left:1px solid var(--wh-border);
  padding:24px 18px;
  display:flex;
  flex-direction:column;
  gap:20px;
}
.sidebar .wh-brand{
  padding:4px 4px 18px;
  border-bottom:1px solid var(--wh-border);
}
.side-section-label{
  color:#b0a796;
  font-size:12px;
  font-weight:900;
  margin:0 12px -8px;
}
.nav{
  display:grid;
  gap:7px;
}
.nav-btn{
  min-height:48px;
  border-radius:17px;
  padding:0 14px;
  display:flex;
  align-items:center;
  gap:12px;
  color:#514a40;
  font-size:15px;
  font-weight:900;
  transition:.16s ease;
  position:relative;
}
.nav-btn:hover{
  background:#f8f4ed;
}
.nav-btn.active{
  background:#f1eadc;
  color:var(--wh-gold-dark);
}
.nav-btn.active:before{
  content:"";
  position:absolute;
  left:-18px;
  width:4px;
  height:32px;
  border-radius:999px;
  background:linear-gradient(180deg,var(--wh-gold),var(--wh-gold-2));
}
.nav-icon{
  margin-right:auto;
  width:31px;
  height:31px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:#f9f6ef;
  border:1px solid #f1eadc;
  color:#7c7366;
}
.nav-icon svg{
  width:18px;
  height:18px;
  stroke:currentColor;
  fill:none;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.nav-btn.active .nav-icon{
  background:#fff8e9;
  border-color:#ead7a9;
  color:var(--wh-gold-dark);
}
.session-card{
  margin-top:auto;
  background:#fffdf8;
  border:1px solid #eadfc9;
  border-radius:20px;
  padding:14px;
  box-shadow:var(--wh-shadow-sm);
  display:flex;
  gap:12px;
  align-items:center;
}
.session-badge{
  width:40px;
  height:40px;
  border-radius:14px;
  background:var(--wh-green-soft);
  color:var(--wh-green);
  display:grid;
  place-items:center;
}
.session-badge svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:2}
.session-card strong{
  display:block;
  font-size:13px;
  font-weight:900;
}
.session-card span{
  display:block;
  color:var(--wh-green);
  margin-top:4px;
  font-size:12px;
  font-weight:800;
}
.main{
  min-width:0;
  background:linear-gradient(180deg,#fffefd,#fbfaf8);
}
.topbar{
  min-height:76px;
  padding:15px 26px;
  background:rgba(255,255,255,.92);
  border-bottom:1px solid var(--wh-border);
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:18px;
  align-items:center;
}
.profile-area{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.mobile-menu{
  display:none;
}
.user-avatar{
  width:46px;
  height:46px;
  border-radius:50%;
  background:linear-gradient(135deg,#f1e2bd,#fff);
  border:1px solid #e7dcc4;
  position:relative;
  flex:0 0 auto;
}
.user-avatar:before{
  content:"";
  position:absolute;
  inset:8px;
  border-radius:50%;
  background:linear-gradient(135deg,#263225,#6c7650);
}
.user-avatar:after{
  content:"";
  position:absolute;
  bottom:2px;
  right:2px;
  width:11px;
  height:11px;
  border-radius:50%;
  background:var(--wh-green);
  border:3px solid #fff;
}
.user-meta strong{
  display:block;
  font-size:15px;
  line-height:1.1;
  font-weight:900;
  white-space:nowrap;
}
.user-meta span{
  display:block;
  margin-top:4px;
  color:var(--wh-muted);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.icon-btn{
  width:40px;
  height:40px;
  border-radius:50%;
  border:1px solid var(--wh-border);
  background:#fff;
  color:#5a5247;
  display:grid;
  place-items:center;
}
.icon-btn svg{
  width:18px;
  height:18px;
  stroke:currentColor;
  fill:none;
  stroke-width:2;
}
.top-tools{
  display:flex;
  align-items:center;
  gap:10px;
}
.org-pill{
  min-width:250px;
  height:44px;
  border:1px solid var(--wh-border);
  background:#fff;
  border-radius:999px;
  padding:0 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:#2e2923;
  font-size:14px;
  font-weight:900;
}
.tabs{
  min-height:60px;
  padding:0 26px;
  background:#fff;
  border-bottom:1px solid var(--wh-border);
  display:flex;
  align-items:center;
  gap:12px;
  overflow:auto;
}
.tab{
  min-height:38px;
  padding:0 16px;
  border-radius:16px;
  display:flex;
  align-items:center;
  color:#5f574c;
  font-size:14px;
  font-weight:900;
  white-space:nowrap;
}
.tab:hover,.tab.active{
  background:#f2eee7;
  color:var(--wh-text);
}
.content{
  padding:24px 26px 32px;
}
.page-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:22px;
}
.page-title h1{
  margin:0 0 7px;
  font-size:30px;
  line-height:1.18;
  letter-spacing:-.6px;
  font-weight:900;
}
.page-title p{
  margin:0;
  color:var(--wh-muted);
  font-size:14px;
  font-weight:700;
}
.actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.btn{
  height:40px;
  border-radius:16px;
  border:1px solid #d6bd7a;
  background:#fff;
  color:var(--wh-gold-dark);
  padding:0 17px;
  font-size:14px;
  font-weight:900;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.btn.primary{
  border:0;
  color:#fff;
  background:linear-gradient(135deg,var(--wh-gold),var(--wh-gold-2));
  box-shadow:0 12px 24px rgba(184,135,34,.16);
}
.btn.neutral{
  border-color:var(--wh-border);
  color:#5f574c;
}
.grid-kpi{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-bottom:22px;
}
.kpi-card{
  min-height:128px;
  background:#fff;
  border:1px solid #f0ece3;
  border-radius:22px;
  padding:18px;
  box-shadow:var(--wh-shadow-sm);
  position:relative;
}
.kpi-card .more{
  position:absolute;
  top:16px;
  left:16px;
  color:#7d7468;
  font-weight:900;
  letter-spacing:2px;
}
.kpi-head{
  display:flex;
  align-items:center;
  gap:10px;
  justify-content:flex-end;
  margin-bottom:12px;
  color:#2d2924;
  font-size:14px;
  font-weight:900;
}
.kpi-icon{
  width:42px;
  height:42px;
  border-radius:50%;
  background:#fff7e8;
  border:1px solid #efe0bd;
  color:var(--wh-gold-dark);
  display:grid;
  place-items:center;
}
.kpi-icon svg{width:19px;height:19px;stroke:currentColor;fill:none;stroke-width:2}
.kpi-number{
  direction:ltr;
  text-align:left;
  font-size:32px;
  line-height:1;
  font-weight:900;
  letter-spacing:-.7px;
}
.kpi-note{
  margin-top:12px;
  color:#b0a798;
  font-size:12px;
  font-weight:800;
}
.kpi-note .good{
  color:var(--wh-green);
  background:var(--wh-green-soft);
  border-radius:999px;
  padding:3px 7px;
  font-weight:900;
  margin-left:6px;
}
.card{
  background:#fff;
  border:1px solid #f0ece3;
  border-radius:22px;
  padding:20px;
  box-shadow:var(--wh-shadow-sm);
}
.table-card{
  background:#fff;
  border:1px solid #f0ece3;
  border-radius:22px;
  box-shadow:var(--wh-shadow-sm);
  overflow:hidden;
}
.table-head{
  min-height:58px;
  padding:0 18px;
  border-bottom:1px solid #f3eee6;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.table-head h3{
  margin:0;
  font-size:16px;
  font-weight:900;
}
.table-wrap{overflow:auto}
.table{
  width:100%;
  min-width:860px;
  border-collapse:collapse;
}
.table th{
  padding:14px 16px;
  background:#fbfaf7;
  color:#a79e8f;
  font-size:12px;
  text-align:right;
  font-weight:900;
}
.table td{
  padding:14px 16px;
  border-top:1px solid #f2eee7;
  color:#454039;
  font-size:14px;
  font-weight:700;
}
.status{
  min-width:84px;
  height:26px;
  padding:0 10px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:900;
}
.status.success{background:var(--wh-green-soft);color:var(--wh-green)}
.status.warning{background:#fff4df;color:#9b6b13}
.status.danger{background:var(--wh-red-soft);color:var(--wh-red)}
.form-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}
.form-actions{
  margin-top:20px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.select, .textarea{
  width:100%;
  border:1px solid var(--wh-border);
  border-radius:17px;
  background:#fff;
  outline:none;
  color:var(--wh-text);
  font-size:14px;
  font-weight:800;
}
.select{height:50px;padding:0 14px}
.textarea{min-height:110px;padding:14px;resize:vertical}
@media(max-width:1280px){
  .app-shell{width:calc(100% - 40px);grid-template-columns:260px minmax(0,1fr)}
  .grid-kpi{grid-template-columns:repeat(2,minmax(0,1fr))}
  .topbar{grid-template-columns:1fr}
  .org-pill{min-width:100%}
}
@media(max-width:920px){
  .login-page{padding:0}
  .login-shell{min-height:100vh;border-radius:0;grid-template-columns:1fr}
  .login-visual{display:none}
  .login-panel{padding:24px}
  .app-shell{width:100%;min-height:100vh;margin:0;border-radius:0;grid-template-columns:1fr}
  .sidebar{position:fixed;right:-310px;top:0;width:280px;height:100vh;z-index:50;transition:.2s;box-shadow:-24px 0 70px rgba(0,0,0,.18)}
  .sidebar.open{right:0}
  .mobile-menu{display:grid}
  .content{padding:18px}
  .page-heading{display:block}
  .actions{margin-top:14px}
  .tabs{justify-content:flex-start}
}
@media(max-width:640px){
  .grid-kpi,.form-grid{grid-template-columns:1fr}
  .login-card h2{font-size:27px}
  .content{padding:14px}
}

/* Final login typography polish */
.login-visual h1{
  font-size:42px !important;
  line-height:1.25 !important;
}

.login-visual p{
  font-size:15px !important;
  max-width:560px !important;
}

.login-metric{
  text-align:center !important;
}

.login-metric b{
  font-size:20px !important;
  text-align:center !important;
}

.login-metric span{
  font-size:12px !important;
}

.login-card h2{
  font-size:31px !important;
}

.login-card .login-subtitle{
  font-size:13px !important;
}
