:root{
  --bg:#F8FAFC;
  --paper:#FFFFFF;
  --paper2:#FFFFFF;
  --ink:#0F172A;
  --muted:#64748B;
  --line:#E2E8F0;

  --green:#1E293B;
  --green2:#334155;
  --green3:#F1F5F9;

  --accent:#2563EB;
  --accent2:#DBEAFE;

  --danger:#EF4444;

  --shadow:0 4px 18px rgba(15,23,42,.05);
  --shadow2:0 12px 30px rgba(15,23,42,.08);

  --radius:16px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Arial,'Noto Sans Hebrew',sans-serif;
  direction:rtl;
  background:
    radial-gradient(circle at 12% 0%,rgba(19,138,85,.06),transparent 28%),
    linear-gradient(180deg,#fafbf8 0%,var(--bg) 100%);
  color:var(--ink);
  font-size:13px;
  line-height:1.55;
}
a{color:inherit;text-decoration:none}

/* Login */
.login-page{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  overflow:hidden;
  background:
    linear-gradient(135deg,#093d27 0%,#124b31 46%,#f9fbf8 46%,#f9fbf8 100%);
}
.login-card{
  width:min(400px,94vw);
  background:rgba(255,255,255,.9);
  padding:28px;
  border-radius:24px;
  box-shadow:0 30px 80px rgba(0,0,0,.16);
  border:1px solid rgba(255,255,255,.75);
  backdrop-filter:blur(18px);
}
.brand{
  font-size:25px;
  font-weight:700;
  color:var(--green);
  margin:0 0 6px;
  letter-spacing:-.7px;
}
.login-card .muted{margin-bottom:18px}

/* App shell */
.layout{
  display:grid;
  grid-template-columns:210px 1fr;
  min-height:100vh;
}
.sidebar{
  background:
linear-gradient(
180deg,
#0F172A 0%,
#1E293B 100%
);
  color:#fff;
  padding:22px 16px;
  position:sticky;
  top:0;
  height:100vh;
  box-shadow:-18px 0 45px rgba(7,61,39,.15);
}
.side-brand{
  display:flex;
  align-items:center;
  gap:11px;
  margin-bottom:26px;
}
.side-logo{
  width:40px;
  height:40px;
  border-radius:14px;
  background:rgba(255,255,255,.14);
  display:grid;
  place-items:center;
  font-size:20px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);
}
.sidebar h2{
  margin:0;
  font-size:19px;
  font-weight:700;
  letter-spacing:-.5px;
}
.sidebar .sub{
  font-size:11px;
  color:#b8d1c5;
  margin-top:2px;
}
.nav{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.nav button{
  width:100%;
  padding:11px 13px;
  border:1px solid transparent;
  border-radius:13px;
  background:transparent;
  color:#e0ece6;
  font-weight:700;
  text-align:right;
  cursor:pointer;
  font-size:13px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.nav button:before{
  content:'‹';
  opacity:.65;
  font-size:15px;
}
.nav button:hover,.nav button.active{
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.10);
  color:#fff;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.03);
}
.nav .sep{
  height:1px;
  background:rgba(255,255,255,.15);
  margin:14px 0;
}
.nav .logout{
  margin-top:22px;
  background:rgba(255,255,255,.08);
  justify-content:center;
  text-align:center;
}

.main{
  padding:24px 26px 36px;
  width:100%;
  max-width:1380px;
  margin:0 auto;
}
.top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:20px;
}
.top h1{
  margin:0;
  font-size:27px;
  color:var(--green);
  letter-spacing:-.9px;
  line-height:1.12;
}
.crumbs{
  font-size:12px;
  color:var(--muted);
  margin-top:7px;
}
.topbar-actions{
  display:flex;
  gap:9px;
  align-items:center;
}
.user-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:rgba(255,255,255,.88);
  border:1px solid var(--line);
  border-radius:999px;
  padding:7px 12px;
  color:#32423a;
  box-shadow:0 7px 18px rgba(16,38,27,.045);
}

/* Buttons + inputs */
.btn{
  border:0;
  border-radius:12px;
  padding:9px 14px;
  background:var(--green);
  color:#fff;
  font-weight:700;
  cursor:pointer;
  font-size:12px;
  min-height:36px;
  box-shadow:0 7px 16px rgba(7,61,39,.14);
}
.btn:hover{filter:brightness(1.05)}
.btn.secondary{
  background:#fff;
  color:var(--green);
  border:1px solid var(--line);
  box-shadow:0 7px 16px rgba(16,38,27,.045);
}
.btn.danger{
  background:#fff1f2;
  color:#bf384a;
  border:1px solid #ffd2d8;
  box-shadow:none;
}
.btn.small{
  padding:6px 10px;
  min-height:30px;
  font-size:11px;
}
.input,select,textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid #dce5dd;
  border-radius:12px;
  font-size:13px;
  margin:5px 0;
  background:#fff;
  color:var(--ink);
  font-family:inherit;
}
textarea.input{min-height:82px;resize:vertical}
.input:focus,select:focus,textarea:focus{
  outline:3px solid rgba(19,138,85,.13);
  border-color:#9bc8ad;
}

/* Cards */
.cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:14px;
  margin-bottom:18px;
}
.card{
  background:rgba(255,255,255,.92);
  border:1px solid var(--line);
  border-radius:20px;
  padding:16px;
  box-shadow:var(--shadow);
}
.stat-card{
  min-height:88px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.stat-icon{
  width:38px;
  height:38px;
  border-radius:13px;
  background:var(--green3);
  display:grid;
  place-items:center;
  color:var(--accent);
  font-weight:700;
  font-size:15px;
}
.stat-icon.purple{color:var(--purple);background:#f0eafe}
.stat-icon.blue{color:var(--blue);background:#eaf1ff}
.stat-icon.orange{color:var(--orange);background:#fff3e4}
.stat{
  font-size:30px;
  font-weight:700;
  color:var(--ink);
  letter-spacing:-1px;
  line-height:1;
}
.stat-card.accent .stat{color:var(--danger)}
.stat-label{
  font-weight:700;
  margin-top:5px;
  font-size:13px;
}
.stat-sub{
  font-size:11px;
  color:var(--muted);
  margin-top:4px;
}

/* Panels */
.panel{
  background:rgba(255,255,255,.94);
  border:1px solid var(--line);
  border-radius:20px;
  padding:16px;
  box-shadow:var(--shadow);
  margin-bottom:16px;
}
.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:13px;
}
.panel h2{
  font-size:19px;
  margin:0;
  color:var(--ink);
  letter-spacing:-.45px;
}
.panel .muted{font-size:12px}
.muted{color:var(--muted)}
.grid2{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
}
.grid3{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:12px;
}
.actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

/* Dashboard split sections */
.dash-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}
.activity-list,.compact-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.activity-item{
  display:grid;
  grid-template-columns:42px 1fr auto;
  align-items:center;
  gap:11px;
  padding:10px 8px;
  border-radius:15px;
}
.activity-item:hover{background:#f7faf7}
.activity-icon{
  width:34px;
  height:34px;
  border-radius:12px;
  background:var(--green3);
  color:var(--accent);
  display:grid;
  place-items:center;
  font-weight:700;
}
.activity-title{font-weight:700}
.activity-sub{font-size:11px;color:var(--muted);margin-top:2px}
.activity-time{font-size:11px;color:var(--muted)}

/* Tables */
.table-wrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
}
table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
  min-width:720px;
}
th{
  background:#f0f5f1;
  font-size:11px;
  color:#40534a;
  font-weight:700;
}
th,td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  text-align:right;
  vertical-align:middle;
  white-space:nowrap;
}
tr:last-child td{border-bottom:0}
tbody tr:hover{background:#fbfdfb}
.status-dot{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.status-dot:before{
  content:'';
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--accent);
}
.status-off:before{background:#b8c1ba}
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#edf7f0;
  color:#11613d;
  padding:4px 9px;
  font-size:11px;
  font-weight:700;
}
.badge.gray{background:#f1f3f1;color:#69756d}
.avatar{
  width:32px;
  height:32px;
  border-radius:12px;
  background:#e7f1eb;
  display:inline-grid;
  place-items:center;
  color:#11613d;
  font-weight:700;
  margin-left:8px;
}

/* Lessons */
.lesson{
  display:grid;
  grid-template-columns:74px 1fr auto;
  align-items:center;
  gap:12px;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:16px;
  margin:9px 0;
  background:#fff;
  transition:.15s;
}
.lesson:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 26px rgba(16,38,27,.055);
}
.lesson-thumb{
  width:64px;
  height:46px;
  border-radius:12px;
  background:
    linear-gradient(rgba(7,61,39,.08),rgba(7,61,39,.08)),
    linear-gradient(135deg,#eaf4ee,#f7eadf);
  display:grid;
  place-items:center;
  color:#11613d;
  font-weight:700;
  position:relative;
  overflow:hidden;
}
.lesson-thumb:after{
  content:'▶';
  width:22px;
  height:22px;
  border-radius:50%;
  background:#fff;
  display:grid;
  place-items:center;
  font-size:10px;
  box-shadow:0 6px 16px rgba(0,0,0,.12);
}
.lesson h3{
  margin:0 0 2px;
  font-size:14px;
  letter-spacing:-.15px;
}
.lesson p{
  margin:0;
  color:var(--muted);
  font-size:12px;
}
.progress{
  height:7px;
  background:#e9eee9;
  border-radius:99px;
  overflow:hidden;
  min-width:105px;
}
.progress>div{
  height:100%;
  background:linear-gradient(90deg,#0f7a4b,#45ad76);
}

/* Modal and toast */
.modal{
  position:fixed;
  inset:0;
  background:rgba(4,19,12,.48);
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:50;
}
.modal.open{display:flex}
.modal-box{
  background:#fff;
  border-radius:22px;
  padding:20px;
  width:min(680px,95vw);
  max-height:90vh;
  overflow:auto;
  box-shadow:0 30px 80px rgba(0,0,0,.25);
}
.modal-box h2{
  margin:0 0 13px;
  font-size:20px;
}
.toast{
  position:fixed;
  bottom:20px;
  left:20px;
  background:#102f1d;
  color:#fff;
  padding:12px 18px;
  border-radius:14px;
  display:none;
  z-index:60;
  box-shadow:0 16px 38px rgba(0,0,0,.22);
}
.toast.show{display:block}

/* Plans */
.plan-card{
  min-height:132px;
  position:relative;
  overflow:hidden;
}
.plan-card:before{
  content:'';
  position:absolute;
  inset:auto -40px -60px auto;
  width:150px;
  height:150px;
  border-radius:50%;
  background:rgba(19,138,85,.06);
}
.plan-card h3{
  margin:0 0 9px;
  font-size:17px;
}
.plan-card p{
  margin:5px 0;
  color:#2d4037;
  font-size:12px;
}
.price{
  font-weight:700;
  font-size:17px;
  color:var(--green);
}

@media(max-width:1000px){
  .layout{grid-template-columns:1fr}
  .sidebar{height:auto;position:relative}
  .main{padding:18px}
  .top{display:block}
  .cards{grid-template-columns:1fr}
  .dash-grid{grid-template-columns:1fr}
  .lesson{grid-template-columns:1fr}
  .lesson-thumb{display:none}
}

/* sidebar tabs alignment fix */
.nav button{
  justify-content:flex-start;
  flex-direction:row-reverse;
  gap:10px;
}

.nav button:before{
  margin-inline-start:auto;
  margin-inline-end:0;
}

