/*
  YTJ Training TMS – UI v4 (Clean Brand)
  - Works with existing markup/classes (.card, .btn, .table, .grid...)
  - RTL-first
  - Brand palette inspired by YTJ logo
*/

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

:root{
  /* Brand */
  --ytj-indigo:#302E76;
  --ytj-cyan:#22B6E9;
  --ytj-magenta:#E62E88;
  --ytj-lime:#A8C637;
  --ytj-orange:#F6B044;

  /* Neutrals */
  --bg:#F6F7FB;
  --surface:#FFFFFF;
  --surface2:#F9FAFF;
  --text:#0B1220;
  --muted:#667085;
  --border:#E6EAF5;

  --shadow:0 18px 45px rgba(15,23,42,.10);
  --shadow-sm:0 10px 26px rgba(15,23,42,.08);
  --radius:18px;

  --ok:#16a34a;
  --danger:#dc2626;

  --grad:linear-gradient(135deg, var(--ytj-indigo) 0%, var(--ytj-cyan) 55%, var(--ytj-magenta) 100%);
  --grad-soft:linear-gradient(135deg, rgba(48,46,118,.08), rgba(34,182,233,.10), rgba(230,46,136,.08));
  --ring:0 0 0 4px rgba(34,182,233,.18);
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:'Cairo', system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans Arabic", sans-serif;
  color:var(--text);
  background:
    radial-gradient(800px 520px at 10% 12%, rgba(34,182,233,.14), transparent 62%),
    radial-gradient(900px 620px at 92% 16%, rgba(230,46,136,.10), transparent 62%),
    radial-gradient(820px 520px at 18% 92%, rgba(48,46,118,.10), transparent 65%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 55%, #ffffff 100%);
}

a{color:var(--ytj-indigo);text-decoration:none}
a:hover{text-decoration:underline}

.container{max-width:1120px;margin:0 auto;padding:20px}

/* Page title */
.page-title{margin:0 0 14px 0;font-weight:900}

/* Top navigation */
.nav{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:18px;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:rgba(255,255,255,.86);
  box-shadow:var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.brand{display:flex;align-items:center;gap:12px;min-width:240px}
.brand-logo{
  width:44px;height:44px;
  object-fit:contain;
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--surface);
  box-shadow:0 10px 18px rgba(15,23,42,.08);
}
.brand-text{display:flex;flex-direction:column;gap:2px;line-height:1.15}
.brand-title{font-weight:900;letter-spacing:.2px}
.brand-sub{font-size:12px;color:var(--muted)}

.badge{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  color:var(--ytj-indigo);
  background:rgba(48,46,118,.06);
  border:1px solid rgba(48,46,118,.12);
}

/* Cards */
.card{
  background:rgba(255,255,255,.94);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  box-shadow:var(--shadow-sm);
}

.card.soft{background:var(--surface2)}

.grid{display:grid;gap:16px}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:920px){.grid-2,.grid-3{grid-template-columns:1fr}}

/* Forms */
label{display:block;margin:10px 0 6px;color:var(--muted);font-size:13px}

input,select,textarea{
  width:100%;
  padding:11px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text);
  outline:none;
  transition: box-shadow .12s ease, border-color .12s ease, transform .05s ease;
}
input::placeholder,textarea::placeholder{color:rgba(102,112,133,.85)}

input:focus,select:focus,textarea:focus{
  border-color:rgba(34,182,233,.70);
  box-shadow:var(--ring);
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.94);
  color:var(--ytj-indigo);
  cursor:pointer;
  transition: transform .08s ease, filter .12s ease, box-shadow .12s ease, background .12s ease;
  user-select:none;
}
.btn:hover{filter:brightness(1.02);box-shadow:0 10px 22px rgba(15,23,42,.08)}
.btn:active{transform:translateY(1px)}

.btn-primary{
  border:0;
  color:#ffffff;
  background:var(--grad);
  box-shadow:0 12px 28px rgba(48,46,118,.16);
  font-weight:900;
}
.btn-primary:hover{filter:brightness(1.05)}

.btn-danger{
  border:0;
  color:#ffffff;
  background:linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow:0 12px 26px rgba(185,28,28,.16);
  font-weight:900;
}

.btn-ghost{
  background:transparent;
  border-color:transparent;
  box-shadow:none;
}
.btn-ghost:hover{background:rgba(48,46,118,.06);box-shadow:none;text-decoration:none}

.row{display:flex;gap:12px;flex-wrap:wrap;align-items:center}

/* Tables */
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:16px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.96);
}
.table th,.table td{padding:11px 12px;border-bottom:1px solid var(--border);text-align:right;vertical-align:top}
.table th{
  font-size:12px;
  font-weight:900;
  color:var(--muted);
  background:linear-gradient(180deg, #FBFCFF, #F3F5FF);
}
.table tr:last-child td{border-bottom:0}
.table tr:hover td{background:rgba(34,182,233,.04)}

/* Alerts */
.alert{padding:12px 14px;border-radius:16px;margin:12px 0;border:1px solid var(--border);background:var(--surface)}
.alert-ok{border-color:rgba(22,163,74,.22);background:rgba(22,163,74,.06)}
.alert-bad{border-color:rgba(220,38,38,.22);background:rgba(220,38,38,.06)}

.small{font-size:12px;color:var(--muted)}
hr{border:0;border-top:1px solid var(--border);margin:14px 0}

/* Tabs */
.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.tab{padding:8px 12px;border-radius:999px;border:1px solid var(--border);background:transparent;color:var(--ytj-indigo)}
.tab.active{background:rgba(48,46,118,.08);border-color:rgba(48,46,118,.14);font-weight:900}

/* KPI */
.kpi{
  padding:16px;
  border-radius:18px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.94);
  box-shadow:var(--shadow-sm);
  position:relative;
  overflow:hidden;
}
.kpi:before{
  content:"";
  position:absolute;
  left:0;right:0;top:0;
  height:6px;
  background:var(--grad);
}
.kpi .n{position:relative;font-size:28px;font-weight:900;margin-top:6px}
.kpi .t{position:relative;color:var(--muted);font-size:12px;font-weight:900}

/* Checkboxes */
.checkbox{display:flex;gap:10px;align-items:flex-start;margin:10px 0}
.checkbox input{width:18px;height:18px;margin-top:4px}

/* Footer */
.footer{margin-top:18px;color:var(--muted);font-size:12px}

/* Auth (login/register) */
.auth-wrap{min-height:70vh;display:grid;place-items:center}
.auth-card{max-width:520px;width:100%}
.auth-title{font-size:22px;font-weight:900;margin:0 0 8px 0}
.auth-sub{margin:0 0 14px 0;color:var(--muted)}

.logo-pill{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.94);
  border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
}
.logo-pill img{width:38px;height:38px;object-fit:contain;border-radius:12px;border:1px solid var(--border);background:#fff}
.logo-pill .lp-title{font-weight:900;line-height:1.1}
.logo-pill .lp-sub{font-size:12px;color:var(--muted)}

/* Nested cards readability (used in course list inside register) */
.card .card{background:var(--surface2)}
