body { font-family: system-ui, -apple-system, Segoe UI, Arial; background:#fafafa; }
.container { max-width: 1050px; margin: 24px auto; padding: 0 12px; }

/* ===== College Logo Header ===== */
.brandbar{
  display:flex;
  justify-content:center;
  align-items:center;
  margin: 10px 0 18px;
}
.brandbar img{
  height: 72px;
  max-width: 100%;
  object-fit: contain;
}

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { padding: 8px 12px; border: 1px solid #ccc; background: #fff; cursor: pointer; text-decoration: none; color: #111; border-radius: 8px; }
.btn:hover { background: #f5f5f5; }
.danger { border-color: #ffb3b3; }

.error { padding: 10px; background: #ffe4e4; border: 1px solid #ffb3b3; border-radius: 8px; margin: 10px 0; }
.card { padding: 12px; border: 1px solid #eee; border-radius: 12px; background: #fff; }
.muted { color: #666; font-size: 13px; }

/* Forms */
input, select, textarea { padding: 10px; border-radius: 10px; border: 1px solid #ddd; width: 100%; box-sizing: border-box; }
label { display:block; margin: 10px 0 6px; color:#222; font-size: 14px; }
form button { width: 100%; margin-top: 12px; }

/* Login layout */
.auth-wrap { display:flex; justify-content:center; }
.auth-card { width: 420px; max-width: 100%; padding: 16px; }
.auth-title { text-align:center; margin: 0 0 10px; }
.auth-sub { text-align:center; margin: 0 0 12px; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-top: 10px; background:#fff; border-radius: 12px; overflow:hidden; }
th, td { border: 1px solid #eee; padding: 10px; vertical-align: middle; }
th { background: #fafafa; white-space: nowrap; }

/* ===== Print ===== */
@media print{
  .actions, .btn, button { display:none !important; }
  .brandbar{ margin: 0 0 12px; }
  body{ background:#fff; }
}
/* ===== Admin UI tweaks ===== */
.center { text-align: center; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid transparent;
}
.badge.ok {
  background: #e9f8ee;
  border-color: #bfe8c9;
  color: #1e7a34;
}
.badge.bad {
  background: #ffecec;
  border-color: #ffc7c7;
  color: #b42318;
}

/* forms spacing */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}
.form-grid .btn { width: auto; min-width: 140px; }
.section-gap { margin-top: 14px; }

/* labs dropdown in table */
.labs-dd summary {
  cursor: pointer;
  user-select: none;
  color: #333;
}
.labs-dd ul {
  margin: 8px 0 0;
  padding: 0 18px 0 0;
}
.labs-dd li { margin: 4px 0; }
/* ===== Inventory redesign ===== */
.brandbar { display:flex; justify-content:center; margin: 8px 0 16px; }
.brand { text-align:center; }
.brand-logo { width: 64px; height: 64px; object-fit: contain; display:block; margin: 0 auto 6px; }
.brand-title { font-weight: 700; font-size: 18px; }
.brand-subtitle { color:#666; font-size: 13px; margin-top: 2px; }

.thin { padding: 10px; }
.rowbar { display:flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tiny { font-size: 12px; }

.w-xs { width: 90px; }
.w-sm { width: 180px; }
.w-md { width: 220px; }
.w-lg { width: 280px; }

.grid2 { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

.boxhead { display:flex; justify-content: space-between; align-items:center; gap: 8px; }
.badge { padding: 4px 10px; border-radius: 999px; border: 1px solid #ddd; background:#fafafa; font-size: 12px; }

.list .row { display:flex; justify-content: space-between; gap: 10px; padding: 10px; border: 1px solid #eee; border-radius: 10px; margin: 8px 0; background:#fff; }
.list .meta { color:#666; font-size: 12px; margin-top: 4px; }
.list .btns { display:flex; gap: 8px; align-items:center; }

.labs-dd { position: relative; }
.labs-dd summary { list-style:none; }
.labs-dd summary::-webkit-details-marker { display:none; }
.ddmenu { min-width: 260px; padding: 10px; border: 1px solid #eee; border-radius: 12px; background:#fff; margin-top: 8px; }
.ddmenu label { display:flex; gap: 8px; align-items:center; padding: 6px 4px; }

.lab-section { margin-top: 12px; }
.lab-head { display:flex; justify-content: space-between; align-items:center; gap: 10px; }
.lab-title { font-size: 16px; font-weight: 700; }
.lab-controls { display:flex; gap: 8px; align-items:center; }

.table-wrap { overflow-x: auto; }
table .actions-col { white-space: nowrap; }
.center { text-align: center; }

/* ===== تحسينات المسافات/الشكل ===== */
.section-gap{ margin-top: 12px; }
.lab-card{ margin-top: 12px; }

.brand-title{ font-weight: 800; }
.logo{ width: 56px; height: 56px; object-fit: contain; display:block; margin: 0 auto 8px; }

.bar{ margin-top: 10px; }
.bar-grid{ display:grid; gap:10px; align-items:center; }
.add-grid{ grid-template-columns: 1fr 1.2fr 1.2fr 0.6fr 0.9fr 1.2fr auto; }
.tables-bar{ grid-template-columns: 240px 1fr 320px; }

.labs-dd summary{ cursor:pointer; font-weight:700; }
.toggles{ display:grid; grid-template-columns: 1fr 1fr; gap:8px; margin-top:8px; }
.toggle-row{ display:flex; gap:8px; align-items:center; }

.lab-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.lab-name{ font-weight:800; font-size:16px; }

.table-wrap{ overflow:auto; }
table{ width:100%; border-collapse:collapse; }
th, td{ border:1px solid #eee; padding:10px; vertical-align:middle; }
th{ background:#fafafa; font-weight:800; }

/* badges */
.badge{ padding:4px 10px; border-radius:999px; font-size:12px; font-weight:800; display:inline-block; border:1px solid #ddd; }
.badge.ok{ background:#ecfdf3; border-color:#b7f0c7; color:#0f7a35; }
.badge.warn{ background:#fff7e6; border-color:#ffe0a3; color:#8a5a00; }
.badge.bad{ background:#ffecec; border-color:#ffb3b3; color:#b00020; }

/* modal */
.modal-backdrop{
  position:fixed; inset:0;
  background:rgba(0,0,0,.25);
  display:flex; align-items:center; justify-content:center;
  padding:18px;
  z-index:9999;
}

.modal{
  width:min(820px, 100%);
  background:#fff;
  border-radius:16px;
  border:1px solid #eee;
  box-shadow: 0 10px 40px rgba(0,0,0,.15);
  overflow:hidden;
}

.modal-head{
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 16px;
  border-bottom:1px solid #eee;
}

.modal-title{ font-weight:900; }
.small-btn{
  padding:6px 10px;
  border:1px solid #ddd;
  border-radius:10px;
  background:#fff;
  cursor:pointer;
}

.modal-body{ padding:14px 16px; }
.modal-row{ display:grid; grid-template-columns: 120px 1fr; gap:10px; align-items:center; margin-bottom:10px; }

.modal-items{
  border:1px solid #eee;
  border-radius:14px;
  padding:10px;
  max-height: 320px;
  overflow:auto;
}

.modal-item{ padding:6px 6px; border-bottom:1px dashed #eee; }
.modal-item:last-child{ border-bottom:none; }

.modal-item-label{
  display:flex; gap:10px; align-items:center;
  cursor:pointer;
}

.mi-code{ font-weight:900; width:140px; }
.mi-name{ flex:1; }
.mi-badge{ width:170px; text-align:left; }

.modal-actions{ display:flex; gap:10px; justify-content:flex-start; margin-top:12px; }

/* ===== طباعة ===== */
@media print{
  .no-print{ display:none !important; }
  body{ background:#fff; }
  .print-page{ page-break-after: always; }
  .print-page:last-child{ page-break-after: auto; }
}

/* ===== Layout clean (RTL friendly) ===== */
.brand{ text-align:center; margin-top:6px; }
.brand-title{ font-weight:900; margin-top:6px; }
.logo{ width:64px; height:64px; object-fit:contain; display:block; margin:0 auto; }

.top-actions{
  display:flex;
  gap:10px;
  justify-content:flex-start; /* نبيها يسار */
  direction:ltr;              /* عشان أزرارنا تثبت يسار حتى مع RTL */
  margin-top:10px;
}

.section-gap{ margin-top:14px; }
.section-title{ font-weight:900; margin-bottom:10px; }

.card.compact{ padding:12px; }

/* Controls compact */
.control{
  height:38px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid #ddd;
  background:#fff;
  width:100%;
}

/* Bars */
.bar-grid{ display:grid; gap:10px; align-items:center; }
.add-grid{
  grid-template-columns: 160px 1.1fr 1.1fr 90px 160px 1fr 90px;
}
.tables-bar{
  grid-template-columns: 1fr 240px 220px;
}

/* Toggle list */
.toggles{ display:grid; grid-template-columns: 1fr 1fr; gap:8px; margin-top:10px; }
.toggle-row{ display:flex; gap:8px; align-items:center; }

/* Make tables not too spaced */
.lab-card{ margin-top:12px; }
.lab-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.lab-name{ font-weight:900; }

/* Mobile wrap */
@media (max-width: 1000px){
  .add-grid{ grid-template-columns: 1fr 1fr; }
  .tables-bar{ grid-template-columns: 1fr; }
  .toggles{ grid-template-columns: 1fr; }
}
/* ===== Compact inventory tables (override at END) ===== */
.table-wrap table th,
.table-wrap table td{
  padding: 6px 8px !important;   /* يقلل سماكة الصف */
  font-size: 13px !important;
  line-height: 1.2 !important;
}

.table-wrap table th{
  white-space: nowrap !important;
}

.table-wrap table a{
  font-size: 12px !important;
}

/* كبّس بادجات الحالة داخل الجداول فقط */
.table-wrap table .badge{
  padding: 3px 8px !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
}
td { white-space: nowrap; }
td:nth-child(5) { /* عمود الملاحظات */
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}