/* =========================================================
   DentalLab – SINGLE FILE THEME
   (header + tabs + layout + panels + chat + list + RTL)
   ========================================================= */

/* ---------- Design tokens ---------- */
:root{
  --bg: #0b1220;
  --bg2:#0f1a30;
  --panel:#0f1a2a;
  --panel2:#101f36;
  --border: rgba(255,255,255,.08);
  --border2: rgba(255,255,255,.12);

  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.62);

  --primary:#4ea1ff;
  --primary2:#2b7bff;
  --danger:#ff4d4d;
  --ok:#3ddc97;
  --warn:#ffb020;

  --shadow: 0 14px 40px rgba(0,0,0,.35);
  --radius: 18px;
  --radius2: 14px;

  --gap: 14px;
  --pad: 14px;

  --font: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ---------- Base reset-ish ---------- */
html, body{
  background: radial-gradient(1200px 600px at 30% -10%, rgba(78,161,255,.18), transparent 55%),
              radial-gradient(900px 500px at 80% 10%, rgba(61,220,151,.10), transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: var(--font);
}

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

.app{
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 12px 26px;
}

/* ---------- RTL support ---------- */
html[dir="rtl"] .dentallab-header,
html[dir="rtl"] .dl-tabs,
html[dir="rtl"] .dl-layout,
html[dir="rtl"] .dl-chatHead,
html[dir="rtl"] .dl-panelHead,
html[dir="rtl"] .dl-itemTop,
html[dir="rtl"] .dl-kv,
html[dir="rtl"] .dl-msg{
  direction: rtl;
}
html[dir="rtl"] .dl-search i{ left: auto; right: 12px; }
html[dir="rtl"] .dl-search input{ padding-left: 12px; padding-right: 36px; }

/* ---------- Bootstrap "harmonisation" ---------- */
.bg-dark{ background: transparent !important; }
.text-light{ color: var(--text) !important; }
.text-muted{ color: var(--muted) !important; }

.btn-primary{
  background: linear-gradient(180deg, var(--primary), var(--primary2)) !important;
  border: 1px solid rgba(78,161,255,.35) !important;
  box-shadow: 0 10px 24px rgba(78,161,255,.18);
}
.btn-primary:hover{ filter: brightness(1.03); }
.btn-outline-light{
  border-color: rgba(255,255,255,.18) !important;
  color: rgba(255,255,255,.88) !important;
}
.btn-outline-light:hover{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.28) !important;
}
.btn-outline-danger{
  border-color: rgba(255,77,77,.45) !important;
  color: rgba(255,255,255,.9) !important;
}
.btn-outline-danger:hover{
  background: rgba(255,77,77,.10) !important;
}

/* =========================================================
   HEADER (dentallab_header.inc.php)
   ========================================================= */
.dentallab-header{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.dentallab-brand{ min-width: 260px; }
.dentallab-logo{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(78,161,255,.25), rgba(61,220,151,.10));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}
.dentallab-logo i{
  font-size: 20px;
  color: rgba(255,255,255,.9);
}

.dentallab-title{
  font-weight: 700;
  letter-spacing: .2px;
  font-size: 16px;
  line-height: 1.1;
}
.dentallab-subtitle{
  font-size: 12px;
  opacity: .85;
  margin-top: 2px;
}

.dentallab-controls{ gap: 10px; }
.dentallab-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
  color: rgba(255,255,255,.85);
}
.dentallab-select{
  background: rgba(0,0,0,.18) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: rgba(255,255,255,.88) !important;
  border-radius: 12px !important;
}
.dentallab-select:focus{
  box-shadow: 0 0 0 .2rem rgba(78,161,255,.18) !important;
  border-color: rgba(78,161,255,.40) !important;
}

/* =========================================================
   TABS
   ========================================================= */
.dl-tabs{
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.dl-tab{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.86);
  padding: 10px 12px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: .15s ease;
}
.dl-tab:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
}
.dl-tab.active{
  background: linear-gradient(180deg, rgba(78,161,255,.22), rgba(255,255,255,.05));
  border-color: rgba(78,161,255,.35);
  box-shadow: 0 12px 28px rgba(78,161,255,.14);
}
.dl-tab i{ opacity: .9; }

/* sections show/hide */
.dl-section{ display:none; }
.dl-section.active{ display:block; }

/* =========================================================
   LAYOUT + PANELS
   ========================================================= */
.dl-layout{
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: var(--gap);
  align-items: start;
}
@media (max-width: 980px){
  .dl-layout{ grid-template-columns: 1fr; }
}

.dl-panel{
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* generic headings */
.dl-panelHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.dl-h2{
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.dl-sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.dl-actions{ display:flex; gap:8px; }

.dl-btnSoft{
  border-radius: 12px !important;
  background: rgba(0,0,0,.16) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
}

/* =========================================================
   CASES LIST (left)
   ========================================================= */
.dl-search{
  position: relative;
  padding: 12px 14px 10px;
}
.dl-search i{
  position:absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .65;
}
.dl-input,
.dl-search input{
  width: 100%;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.90);
  border-radius: 14px;
  padding: 10px 12px 10px 36px;
  outline: none;
}
.dl-input:focus{
  border-color: rgba(78,161,255,.40);
  box-shadow: 0 0 0 4px rgba(78,161,255,.12);
}

.dl-list{
  padding: 10px 10px 12px;
  display:flex;
  flex-direction: column;
  gap: 8px;
  max-height: 68vh;
  overflow:auto;
}
.dl-list::-webkit-scrollbar{ height:10px; width:10px; }
.dl-list::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.12); border-radius: 99px; }

.dl-item{
  width: 100%;
  text-align: left;
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 10px 10px;
  cursor: pointer;
  transition: .15s ease;
  color: rgba(255,255,255,.90);
}
.dl-item:hover{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.14);
}
.dl-item.active{
  background: linear-gradient(180deg, rgba(78,161,255,.18), rgba(0,0,0,.12));
  border-color: rgba(78,161,255,.30);
  box-shadow: 0 12px 26px rgba(78,161,255,.10);
}
.dl-itemTop{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.dl-itemTitle{
  font-weight: 700;
  font-size: 13px;
}
.dl-itemMeta{
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.66);
  line-height: 1.25;
}

/* pills */
.dl-pill{
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
  color: rgba(255,255,255,.86);
  white-space: nowrap;
}
.dl-pill--danger{
  border-color: rgba(255,77,77,.35);
  background: rgba(255,77,77,.12);
}
.dl-pill--muted{
  opacity: .7;
}

/* =========================================================
   CHAT (right)
   ========================================================= */
.dl-chat{
  display:flex;
  flex-direction: column;
  min-height: 68vh;
}

.dl-chatHead{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.12);
}
.dl-chatIdent{
  display:flex;
  align-items:center;
  gap: 10px;
}
.dl-chatAvatar{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(78,161,255,.20), rgba(61,220,151,.10));
  border: 1px solid rgba(255,255,255,.10);
  display:flex;
  align-items:center;
  justify-content:center;
}
.dl-chatAvatar i{
  color: rgba(255,255,255,.92);
  font-size: 18px;
}
.dl-chatTitle{
  font-weight: 800;
  font-size: 14px;
  line-height: 1.1;
}
.dl-chatSub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.dl-chatTools{ display:flex; gap: 8px; align-items:center; }
.dl-iconBtn{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.14);
  color: rgba(255,255,255,.88);
  border-radius: 12px;
  padding: 8px 10px;
  cursor:pointer;
  transition: .15s ease;
}
.dl-iconBtn:hover{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.18);
}

.dl-chatBody{
  padding: 14px;
  display:flex;
  flex-direction: column;
  gap: 10px;
  overflow:auto;
  flex:1;
}
.dl-chatBody::-webkit-scrollbar{ height:10px; width:10px; }
.dl-chatBody::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.12); border-radius: 99px; }

/* messages */
.dl-msg{ display:flex; flex-direction: column; gap: 4px; }
.dl-msg--me{ align-items: flex-end; }
.dl-msg--them{ align-items: flex-start; }

.dl-bubble{
  max-width: min(82%, 720px);
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.16);
  color: rgba(255,255,255,.90);
  line-height: 1.35;
  font-size: 13px;
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
}
.dl-msg--me .dl-bubble{
  background: linear-gradient(180deg, rgba(78,161,255,.25), rgba(0,0,0,.12));
  border-color: rgba(78,161,255,.30);
}
.dl-meta{
  font-size: 11px;
  color: rgba(255,255,255,.55);
  padding: 0 6px;
}

/* footer input */
.dl-chatFoot{
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.12);
  padding: 12px 14px;
}
.dl-inputRow{
  display:flex;
  gap: 10px;
  align-items:center;
}
.dl-chatInput{
  flex: 1;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.90);
  border-radius: 14px;
  padding: 11px 12px;
  outline:none;
}
.dl-chatInput:focus{
  border-color: rgba(78,161,255,.40);
  box-shadow: 0 0 0 4px rgba(78,161,255,.12);
}
.dl-send{
  border-radius: 14px !important;
  padding: 10px 14px !important;
  font-weight: 700;
}

.dl-pending{
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255,255,255,.65);
  opacity: .95;
}

.dl-hintLine{
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255,255,255,.56);
}

/* =========================================================
   ACCOUNT section
   ========================================================= */
.dl-account{
  display:flex;
  justify-content:center;
}
.dl-h3{
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}
.dl-kv{
  display:grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255,255,255,.08);
}
.dl-k{ color: rgba(255,255,255,.70); font-size: 12px; display:flex; gap:8px; align-items:center; }
.dl-v{ color: rgba(255,255,255,.92); font-size: 13px; font-weight: 600; }
.dl-btnRow{ display:flex; gap: 10px; flex-wrap: wrap; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer{
  margin-top: 18px;
  opacity: .9;
}
.site-footer a{
  color: rgba(255,255,255,.68);
}
.site-footer a:hover{
  color: rgba(255,255,255,.90);
}

/* =========================================================
   Safety: avoid accidental double app wrapper spacing
   ========================================================= */
.app .app{ padding: 0 !important; margin: 0 !important; }
