
/* Luxury Admin UI (RTL) */
:root{
  --bg:#0b1220;
  --panel:#0f1a2e;
  --panel2:#0b1426;
  --text:#e7edf7;
  --muted:#9fb0c9;
  --border:rgba(255,255,255,.08);
  --shadow:0 18px 50px rgba(0,0,0,.35);
  --gold1:#ffe7a3;
  --gold2:#d4af37;
  --emerald:#0b6b5f;
  --accent: var(--gold2);
  --danger:#ff5a6a;
  --ok:#36d399;
  --warn:#fbbf24;
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 800px at 80% -10%, rgba(212,175,55,.20), transparent 55%),
              radial-gradient(900px 600px at 10% 0%, rgba(11,107,95,.18), transparent 60%),
              linear-gradient(180deg, var(--bg), #070b14 75%);
  color:var(--text);
  font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  direction: rtl;
}

a{color:inherit; text-decoration:none}
small{color:var(--muted)}
.container{max-width:1200px; margin:0 auto; padding:22px}
.app{
  display:grid;
  grid-template-columns: 280px 1fr;
  min-height:100vh;
}
.sidebar{
  position:sticky; top:0; height:100vh;
  padding:22px 16px;
  background: linear-gradient(180deg, rgba(15,26,46,.92), rgba(11,20,38,.86));
  border-left:1px solid var(--border);
  backdrop-filter: blur(14px);
}
.brand{
  display:flex; align-items:center; gap:12px;
  padding:12px 12px 18px;
  border-bottom:1px solid var(--border);
  margin-bottom:16px;
}
.logo{
  width:42px; height:42px; border-radius:14px;
  display:grid; place-items:center;
  background: radial-gradient(circle at 30% 30%, rgba(255,231,163,.65), rgba(212,175,55,.20) 60%),
              linear-gradient(135deg, rgba(212,175,55,.25), rgba(11,107,95,.20));
  border:1px solid rgba(212,175,55,.30);
  box-shadow:0 12px 26px rgba(0,0,0,.35);
}
.logo span{
  font-weight:900; font-size:18px;
  background: linear-gradient(135deg, var(--gold1), var(--gold2));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.brand h1{font-size:16px; margin:0}
.brand p{margin:2px 0 0; font-size:12px; color:var(--muted)}
.nav{display:flex; flex-direction:column; gap:8px; padding:8px}
.nav a{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 12px;
  border:1px solid transparent;
  border-radius:14px;
  color:var(--text);
  background: rgba(255,255,255,.02);
}
.nav a:hover{background: rgba(255,255,255,.04); border-color:var(--border)}
.nav a.active{
  background: linear-gradient(135deg, rgba(212,175,55,.16), rgba(11,107,95,.12));
  border-color: rgba(212,175,55,.28);
}
.badge{
  font-size:12px; padding:4px 10px; border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--border);
  color: var(--muted);
}
.content{padding:22px 24px}
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
  box-shadow: var(--shadow);
}
.title{margin:0; font-size:18px}
.userchip{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background: rgba(255,255,255,.03);
}
.avatar{
  width:34px; height:34px; border-radius:12px;
  background: linear-gradient(135deg, rgba(212,175,55,.22), rgba(11,107,95,.22));
  border:1px solid rgba(212,175,55,.25);
}
.grid{display:grid; grid-template-columns: repeat(12, 1fr); gap:14px; margin-top:14px}
.card{
  grid-column: span 12;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card .hd{
  padding:14px 16px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background: linear-gradient(135deg, rgba(212,175,55,.08), rgba(11,107,95,.08));
  border-bottom:1px solid var(--border);
}
.card .bd{padding:16px}
.kpis{display:grid; grid-template-columns: repeat(12, 1fr); gap:12px}
.kpi{
  grid-column: span 6;
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  background: rgba(0,0,0,.14);
}
.kpi h3{margin:0 0 6px; font-size:13px; color:var(--muted)}
.kpi .v{font-size:22px; font-weight:900; letter-spacing:.2px}
.kpi .v span{font-size:13px; color:var(--muted); font-weight:700}
@media (max-width: 980px){
  .app{grid-template-columns:1fr}
  .sidebar{position:relative; height:auto; border-left:0; border-bottom:1px solid var(--border)}
  .content{padding:16px}
  .kpi{grid-column: span 12}
}

input,select,button,textarea{
  font:inherit;
  color:var(--text);
}
input,select,textarea{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.18);
  outline:none;
}
input:focus,select:focus,textarea:focus{border-color: rgba(212,175,55,.45); box-shadow: 0 0 0 4px rgba(212,175,55,.10)}
.form-grid{display:grid; grid-template-columns: repeat(12,1fr); gap:12px}
.col-4{grid-column: span 4}
.col-6{grid-column: span 6}
.col-12{grid-column: span 12}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:10px;
  padding:11px 14px;
  border-radius:14px;
  border:1px solid rgba(212,175,55,.25);
  background: linear-gradient(135deg, rgba(212,175,55,.18), rgba(11,107,95,.10));
  color: var(--text);
  cursor:pointer;
  transition: transform .08s ease, filter .12s ease;
}
.btn:hover{filter:brightness(1.07)}
.btn:active{transform: translateY(1px)}
.btn.secondary{
  border-color: var(--border);
  background: rgba(255,255,255,.04);
}
.btn.danger{
  border-color: rgba(255,90,106,.30);
  background: rgba(255,90,106,.12);
}
.btn.link{border:0; background:transparent; padding:0; color: var(--gold2)}
.notice{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  margin-bottom:12px;
}
.notice.ok{border-color: rgba(54,211,153,.25); background: rgba(54,211,153,.10)}
.notice.err{border-color: rgba(255,90,106,.25); background: rgba(255,90,106,.10)}
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:16px;
  border:1px solid var(--border);
}
.table th, .table td{
  padding:12px 10px;
  text-align:right;
  border-bottom:1px solid var(--border);
  vertical-align:middle;
}
.table th{
  font-size:12px;
  color:var(--muted);
  background: rgba(0,0,0,.18);
  position:sticky; top:0;
}
.table tr:hover td{background: rgba(255,255,255,.02)}
.pill{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:12px;
  color:var(--muted);
  background: rgba(0,0,0,.18);
}
.pill.ok{color:#b7f7dd; border-color: rgba(54,211,153,.25); background: rgba(54,211,153,.10)}
.pill.off{color:#ffd0d5; border-color: rgba(255,90,106,.25); background: rgba(255,90,106,.10)}
.hr{height:1px; background:var(--border); margin:14px 0}
.login-wrap{
  min-height:100vh;
  display:grid; place-items:center;
  padding:20px;
}
.login-card{
  width:min(440px, 92vw);
  border:1px solid var(--border);
  border-radius:24px;
  background: rgba(255,255,255,.03);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.login-card .hd{
  padding:18px 18px 12px;
  background: linear-gradient(135deg, rgba(212,175,55,.10), rgba(11,107,95,.10));
  border-bottom:1px solid var(--border);
}
.login-card .bd{padding:18px}


.admin-kpis-8 .kpi{grid-column: span 3}
@media (max-width: 1200px){.admin-kpis-8 .kpi{grid-column: span 4}}
@media (max-width: 780px){.admin-kpis-8 .kpi{grid-column: span 12}}
.agency-cards{display:grid; gap:14px}
.agency-card{border:1px solid var(--border); border-radius:18px; background:rgba(0,0,0,.16); padding:16px}
.agency-head{display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:14px; flex-wrap:wrap}
.agency-title-row{display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:8px}
.agency-title-row h3{margin:0; font-size:20px}
.agency-meta-line{display:flex; flex-wrap:wrap; gap:12px; color:var(--muted); font-size:13px}
.agency-actions{display:flex; gap:8px; flex-wrap:wrap}
.agency-stats-grid{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:12px}
.agency-finance-grid{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:12px}
.mini-stat,.money-box{border:1px solid var(--border); border-radius:16px; background:rgba(255,255,255,.03); padding:12px}
.mini-stat small,.money-box span{display:block; color:var(--muted); margin-bottom:8px; font-size:12px}
.mini-stat strong,.money-box strong{display:block; font-size:22px; font-weight:900; line-height:1.15}
.mini-stat span{display:block; color:var(--muted); margin-top:6px; font-size:12px}
.mini-stat.highlight,.kpi.highlight,.money-box.highlight{background:linear-gradient(135deg, rgba(212,175,55,.14), rgba(11,107,95,.10)); border-color:rgba(212,175,55,.24)}
.agency-footer-line{display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; color:var(--muted); font-size:13px; padding-top:10px; border-top:1px solid var(--border)}
@media (max-width: 1100px){.agency-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.agency-finance-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width: 700px){.agency-stats-grid,.agency-finance-grid{grid-template-columns:1fr}.agency-head{flex-direction:column}.agency-actions{width:100%}.agency-actions .btn{flex:1}}
