/* ===============================
   Auth Admin Dashboard Layout
=============================== */

:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --line:#e5e7eb;
  --text:#0f172a;
  --muted:#64748b;
  --brand:#0b4f6c;
  --brand-soft:#0ea5e9;
  --danger:#b91c1c;
  --ok:#16a34a;
  --radius:14px;
  --shadow:0 10px 30px rgba(155, 173, 255, 0.627);
}

*{
  box-sizing:border-box;
  font-family:"Cairo",system-ui,-apple-system,Segoe UI,Arial;
}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
}

/* ===== Root Layout ===== */
.auth-dashboard{
  display:flex;
  min-height:100vh;
  flex-direction:row; /* 👈 السايدبار شمال */
}


/* ===== Sidebar ===== */
.sidebar{
  width:260px;
  flex-shrink:0;
  background:linear-gradient(180deg,#0b4f6c,#083b52);
  color:#fff;
  padding:20px 16px;
  box-shadow:-6px 0 20px rgba(0,0,0,.08);
}

.sidebar h3{
  margin:0 0 16px;
  font-size:18px;
}

.sidebar a{
  display:block;
  padding:10px 14px;
  margin-bottom:6px;
  border-radius:10px;
  color:#fff;
  text-decoration:none;
  font-size:14px;
  transition:.2s;
}

.sidebar a:hover{
  background:rgba(255,255,255,.12);
}

.sidebar .danger{
  background:#b91c1c;
}

/* ===== Content ===== */
.main{
  flex:1;
  padding:28px 32px;
}

/* ===== Topbar ===== */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:22px;
}

.h1{
  margin:0;
  font-size:24px;
}

.muted{
  color:var(--muted);
  font-size:13px;
}

/* ===== Alerts ===== */
.alert{
  padding:12px 14px;
  border-radius:10px;
  margin-bottom:14px;
  font-size:14px;
}

.alert-ok{
  background:#ecfdf5;
  color:#065f46;
}

.alert-danger{
  background:#fef2f2;
  color:#7f1d1d;
}

/* ===== Panels ===== */
.panel{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  margin-bottom:22px;
  overflow:hidden;
}

.panel-head{
  padding:16px 20px;
  border-bottom:1px solid var(--line);
}

.panel-title{
  font-weight:700;
}

.panel-body{
  padding:20px;
}
.panel:hover{
  box-shadow:0 12px 28px rgba(37,99,235,.12);
}

/* ===== Forms ===== */
.grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
}

.field{
  display:flex;
  flex-direction:column;
}

.field textarea{
  font-size:13px;
}

label{
  font-size:13px;
  margin-bottom:6px;
}

input,textarea{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--line);
  font-size:14px;
    outline:none;
  transition:border-color .2s ease, box-shadow .2s ease;
}

/* Focus state */
input:focus,
textarea:focus{
  border-color:#60a5fa; /* أزرق فاتح */
  box-shadow:0 0 0 3px rgba(96,165,250,.25);
  outline:none;
}

/* Required field focus (remove black) */
input:required:focus{
  border-color:#60a5fa;
}
/* ===== Textarea Fix ===== */
textarea{
  min-height:70px;   /* 👈 حجم مناسب */
  max-height:140px;  /* 👈 يمنع التمدد المبالغ فيه */
}

/* ===== Buttons ===== */
/* ===============================
   Buttons System (Auth Pages)
=============================== */

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:10px 18px;
  border-radius:10px;
  border:0;
  cursor:pointer;
  font-size:14px;
  font-weight:600;
  line-height:1;
  transition:.2s ease;
  text-decoration:none;
  white-space:nowrap;
}

/* Sizes */
.btn-sm{
  padding:6px 12px;
  font-size:13px;
}

.btn-lg{
  padding:14px 22px;
  font-size:15px;
}

/* Types */
.btn-primary{
  background:#0b4f6c;
  color:#fff;
}

.btn-primary:hover{
  background:#083b52;
}

.btn-ghost{
  background:#f1f5f9;
  color:#0f172a;
}

.btn-ghost:hover{
  background:#e2e8f0;
}

.btn-danger{
  background:#b91c1c;
  color:#fff;
}

.btn-danger:hover{
  background:#991b1b;
}

/* Disabled */
.btn:disabled{
  opacity:.6;
  cursor:not-allowed;
}

/* ===== Table ===== */
.table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}

.table th,
.table td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  text-align:right;
}

.table th{
  background:#f8fafc;
  font-weight:600;
}

.actions{
  white-space:nowrap;
}
/* ===============================
   Companies Table Scroll
=============================== */

.table-wrap{
  max-height:340px;          /* 👈 ارتفاع مناسب */
  overflow-y:auto;
  border-radius:12px;
}

/* تحسين شكل الاسكرول */
.table-wrap::-webkit-scrollbar{
  width:8px;
}
.table-wrap::-webkit-scrollbar-thumb{
  background:#bfdbfe;
  border-radius:8px;
}
.table-wrap::-webkit-scrollbar-track{
  background:#f1f5f9;
}
/* Sticky table header */
.table thead th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f8fbff;        /* نفس لون الهيدر */
  border-bottom:1px solid var(--line);
}
.table th:first-child,
.table td:first-child{
  width:70px;
  text-align:center;
  font-weight:600;
}

/* ===== Status Pills ===== */
.pill{
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
}

.pill.ok{
  background:#dcfce7;
  color:#166534;
}

.pill.danger{
  background:#fee2e2;
  color:#7f1d1d;
}

/* ===== Responsive ===== */
@media(max-width:1000px){
  .grid{
    grid-template-columns:1fr 1fr;
  }
}

@media(max-width:700px){
  .auth-dashboard{
    flex-direction:column;
  }
  .sidebar{
    width:100%;
  }
  .grid{
    grid-template-columns:1fr;
  }
}
/* ===== Form Actions ===== */
.form-actions{
  display:flex;
  justify-content:flex-end; /* RTL: يمين */
  margin-top:10px;
}

.form-actions .btn{
  width:auto;          /* ❌ مش بعرض الشاشة */
  min-width:140px;     /* ✔️ حجم محترم */
}
/* ===============================
   Dashboard Stats Cards
=============================== */

.stats-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
  margin:20px 0 30px;
}

.stat-card{
  background:#ffffff;
  border:1px solid var(--panel-border);
  border-radius:14px;
  padding:18px 20px;
  box-shadow:0 8px 20px rgba(37,99,235,.08);
  transition:.2s ease;
}

.stat-card:hover{
  box-shadow:0 12px 28px rgba(37,99,235,.15);
}

.stat-card .label{
  font-size:13px;
  color:var(--muted);
}

.stat-card .value{
  font-size:30px;
  font-weight:700;
  margin-top:6px;
  color:#0b4f6c;
}

/* Responsive */
@media(max-width:1100px){
  .stats-grid{
    grid-template-columns:repeat(2,1fr);
  }
}

@media(max-width:600px){
  .stats-grid{
    grid-template-columns:1fr;
  }
}
