/* MessageBot - App CSS (RTL, Offline) */
:root{
  --brand-primary: #0A2342;
  --brand-secondary: #00BFA5;
  --bg: #f7f9fb;
  --text: #0f172a;
  --muted: #64748b;
  --card: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 12px 28px rgba(2, 6, 23, .08);
  --radius: 16px;
}

@font-face{
  font-family: "Cairo";
  src: url("/assets/fonts/Cairo-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face{
  font-family: "Cairo";
  src: url("/assets/fonts/Cairo-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Cairo", system-ui, -apple-system, Segoe UI, Tahoma, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
  direction: rtl;
}
a{color:inherit; text-decoration:none}
img{max-width:100%; height:auto}

.container{width:100%; padding:0 16px; margin:0 auto; max-width:1100px}
.row{display:flex; flex-wrap:wrap; margin:-8px}
.col{flex:1; padding:8px; min-width:250px}
.col-4{flex:0 0 33.333%}
.col-6{flex:0 0 50%}
.col-8{flex:0 0 66.666%}
@media (max-width:900px){
  .col-4,.col-6,.col-8{flex:0 0 100%}
}

.bg-soft{background:var(--bg)}
.text-muted{color:var(--muted)}
.small{font-size:.9rem}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
}
.p-4{padding:16px}
.p-3{padding:12px}
.p-2{padding:8px}
.py-5{padding-top:40px;padding-bottom:40px}
.py-4{padding-top:24px;padding-bottom:24px}
.mb-0{margin-bottom:0}
.mb-1{margin-bottom:4px}
.mb-2{margin-bottom:8px}
.mb-3{margin-bottom:12px}
.mb-4{margin-bottom:16px}
.mt-2{margin-top:8px}
.mt-3{margin-top:12px}
.mt-4{margin-top:16px}
.me-2{margin-inline-end:8px}
.ms-2{margin-inline-start:8px}
.d-flex{display:flex}
.align-center{align-items:center}
.justify-between{justify-content:space-between}
.gap-2{gap:8px}
.gap-3{gap:12px}
.w-100{width:100%}

.h1{font-size:2rem;font-weight:800}
.h2{font-size:1.6rem;font-weight:800}
.h3{font-size:1.25rem;font-weight:800}

.badge{
  display:inline-flex;
  align-items:center;
  padding:3px 10px;
  border-radius:999px;
  font-size:.85rem;
  border:1px solid var(--border);
  background:#fff;
}
.badge.success{border-color:rgba(0,191,165,.35); color: #0f766e; background:rgba(0,191,165,.08)}
.badge.warn{border-color:rgba(245,158,11,.35); color:#92400e; background:rgba(245,158,11,.1)}
.badge.danger{border-color:rgba(239,68,68,.35); color:#991b1b; background:rgba(239,68,68,.08)}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid transparent;
  cursor:pointer;
  font-weight:700;
  transition:transform .04s ease, opacity .2s ease;
  user-select:none;
}
.btn:active{transform: translateY(1px)}
.btn-primary{background:var(--brand-primary); color:#fff}
.btn-secondary{background:var(--brand-secondary); color:#003b33}
.btn-outline{background:#fff; border-color:var(--border)}
.btn-danger{background:#ef4444;color:#fff}
.btn-sm{padding:7px 10px; border-radius:10px; font-size:.9rem}
.btn:disabled{opacity:.6; cursor:not-allowed}

.input, select, textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  font:inherit;
  outline:none;
}
textarea{min-height:110px; resize:vertical}
label{font-weight:700; display:block; margin-bottom:6px}
.form-row{margin-bottom:12px}

.navbar{
  background:rgba(255,255,255,.9);
  border-bottom:1px solid var(--border);
  backdrop-filter: blur(8px);
  position:sticky; top:0; z-index:10;
}
.navbar .inner{display:flex; align-items:center; justify-content:space-between; padding:10px 16px; max-width:1100px; margin:0 auto;}
.brand{display:flex; align-items:center; gap:10px}
.brand img{width:40px; height:40px; border-radius:12px; object-fit:cover; border:1px solid var(--border)}
.nav-links{display:flex; align-items:center; gap:8px}
.nav-toggle{display:none}
@media (max-width:900px){
  .nav-links{display:none}
  .nav-toggle{display:inline-flex}
}

.sidebar-backdrop{position:fixed; inset:0; background:rgba(2,6,23,.35); display:none; z-index:20}
.sidebar{position:fixed; top:0; bottom:0; inset-inline-start:0; width:290px; background:#fff; border-inline-end:1px solid var(--border); transform: translateX(110%); transition: transform .2s ease; z-index:30; padding:14px}
.sidebar.open{transform: translateX(0)}
.sidebar-backdrop.show{display:block}
.sidebar a{display:block; padding:10px 10px; border-radius:12px}
.sidebar a:hover{background:rgba(2,6,23,.04)}
.sidebar .section-title{margin-top:14px; font-size:.9rem; color:var(--muted)}

.table{width:100%; border-collapse:separate; border-spacing:0}
.table th,.table td{padding:10px 10px; border-bottom:1px solid var(--border); text-align:right; vertical-align:top}
.table th{color:var(--muted); font-size:.9rem; font-weight:800}
.table-wrap{overflow:auto}

.alert{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
}
.alert.success{border-color:rgba(0,191,165,.35); background:rgba(0,191,165,.08)}
.alert.error{border-color:rgba(239,68,68,.35); background:rgba(239,68,68,.08)}
.alert.info{border-color:rgba(59,130,246,.25); background:rgba(59,130,246,.08)}

.toast-wrap{position:fixed; bottom:14px; inset-inline-start:14px; z-index:999; display:flex; flex-direction:column; gap:8px}
.toast{min-width:260px; max-width:360px; padding:10px 12px; border-radius:14px; border:1px solid var(--border); background:#fff; box-shadow: var(--shadow)}
.toast .t{font-weight:900; margin-bottom:2px}
.toast.success{border-color:rgba(0,191,165,.35)}
.toast.error{border-color:rgba(239,68,68,.35)}
.toast.info{border-color:rgba(59,130,246,.25)}

.kpi{display:flex; align-items:center; justify-content:space-between; gap:10px}
.kpi .num{font-size:1.5rem; font-weight:900}

hr{border:none; border-top:1px solid var(--border); margin:14px 0}

.code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:.9rem;
  background: rgba(2,6,23,.04);
  padding:2px 6px;
  border-radius:10px;
}

.hero{
  background: radial-gradient(1000px 500px at 20% 20%, rgba(0,191,165,.18), transparent 60%),
              radial-gradient(1000px 500px at 80% 0%, rgba(10,35,66,.25), transparent 60%),
              linear-gradient(180deg, #ffffff, #f7f9fb);
  border-bottom:1px solid var(--border);
}
.hero-grid{display:flex; align-items:center; justify-content:space-between; gap:16px; padding:28px 0}
@media (max-width:900px){ .hero-grid{flex-direction:column; text-align:center} }
.hero img{max-width:520px; border-radius:20px; box-shadow: var(--shadow); border:1px solid var(--border)}
