/* =============================================
   SALAMaty — Stylesheet Principal
   Couleurs nationales: Vert #006233 | Rouge #D21034 | Blanc
   Inspiré du drapeau algérien
============================================= */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Vert Algérie */
  --green-dark:  #004d26;
  --green:       #006233;
  --green-mid:   #1a8a4a;
  --green-light: #e0f2e8;
  --green-pale:  #f0faf3;

  /* Rouge Algérie */
  --red:         #D21034;
  --red-dark:    #a50d28;
  --red-light:   #fde8ed;

  /* Neutres */
  --black:       #111111;
  --gray-dark:   #333333;
  --gray:        #666666;
  --gray-light:  #999999;
  --border:      #cde5d6;
  --white:       #ffffff;
  --bg:          #f3f8f5;

  /* Ombres */
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.06);
  --shadow:      0 2px 12px rgba(0,98,51,0.12);

  /* Layout */
  --radius:      12px;
  --radius-sm:   8px;
  --sidebar-w:   260px;
}

html { font-size: 15px; }

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--black);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
}

/* =============================================
   SIDEBAR
============================================= */
.sidebar {
  position: fixed;
  right: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--green-dark);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform .25s ease;
  overflow-y: auto;
}

/* Bande décorative rouge en haut (couleurs drapeau) */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--red) 0%, var(--red) 50%, transparent 50%);
  opacity: 0.6;
}

.sidebar-logo {
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-logo svg {
  flex-shrink: 0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.logo-text { font-size: 20px; font-weight: 800; color: var(--white); line-height: 1; }
.logo-text span { display: block; font-size: 11px; font-weight: 400; color: rgba(255,255,255,0.50); margin-top: 3px; }

.sidebar-nav { padding: 14px 10px; flex: 1; }

.nav-label {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.30);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  padding: 10px 12px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.72);
  font-size: 13.5px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s, color .18s;
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover  { background: rgba(255,255,255,0.09); color: var(--white); }
.nav-item.active { background: var(--green-mid); color: var(--white); font-weight: 700; }

/* Indicateur rouge sur l'item actif */
.nav-item.active::before {
  content: '';
  position: absolute;
  right: 0; top: 25%; bottom: 25%;
  width: 3px;
  background: var(--red);
  border-radius: 3px 0 0 3px;
}

.ni { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.nav-item.active .ni { opacity: 1; }

.nav-badge {
  margin-right: auto;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  font-size: 11px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.nav-badge.new { background: var(--red); color: var(--white); }

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.10);
  flex-shrink: 0;
}

.user-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.user-card:hover { background: rgba(255,255,255,0.07); }
.user-av {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green-mid); border: 2px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--white); flex-shrink: 0;
}
.user-inf { min-width: 0; }
.user-nm { font-size: 13px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-rl { font-size: 11px; color: rgba(255,255,255,0.45); }

/* =============================================
   MAIN
============================================= */
.main { margin-right: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

/* =============================================
   TOPBAR
============================================= */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}

/* Bande tricolore sous la topbar */
.topbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--green) 50%, var(--red) 50%);
  opacity: 0.35;
}

.menu-toggle {
  display: none; border: none; background: none; cursor: pointer;
  color: var(--gray-dark); padding: 6px;
}

.topbar-title { font-size: 17px; font-weight: 700; color: var(--black); flex: 1; }
.topbar-sub { font-size: 13px; color: var(--gray); font-weight: 400; margin-right: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.notif-bell { position: relative; cursor: pointer; padding: 6px; color: var(--gray-dark); }
.notif-dot {
  position: absolute; top: 0; left: 0;
  background: var(--red); color: var(--white);
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* =============================================
   BUTTONS
============================================= */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none;
  transition: background .18s, transform .1s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary   { background: var(--green);      color: var(--white); }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: var(--green-light); color: var(--green-dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: #c5e6d2; }
.btn-danger    { background: var(--red-light);   color: var(--red);   border: 1px solid #f5c2cc; }
.btn-danger:hover { background: #fbd0d8; }
.btn-ghost     { background: transparent;        color: var(--gray-dark); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-icon { padding: 8px; }

/* =============================================
   CONTENT AREA
============================================= */
.content { padding: 28px 32px; flex: 1; }

/* =============================================
   STATS ROW
============================================= */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow); }

.stat-icon {
  width: 50px; height: 50px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.si-green { background: var(--green-light); }
.si-red   { background: var(--red-light); }
.si-amber { background: #fef9e7; }
.si-blue  { background: #eaf3fb; }

.stat-val   { font-size: 28px; font-weight: 800; color: var(--black); line-height: 1; }
.stat-lbl   { font-size: 12.5px; color: var(--gray); margin-top: 4px; }
.stat-delta { font-size: 12px; color: var(--green); font-weight: 600; margin-top: 3px; }
.stat-delta.neg { color: var(--red); }

/* =============================================
   CARDS
============================================= */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 22px;
}

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 13px;
}

.card-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.card-icon.red { background: var(--red-light); }

.card-title    { font-size: 15px; font-weight: 700; color: var(--black); }
.card-subtitle { font-size: 12.5px; color: var(--gray); margin-top: 2px; }
.card-header-actions { margin-right: auto; display: flex; gap: 8px; }
.card-body { padding: 22px; }
.card-body.compact { padding: 14px 22px; }

/* =============================================
   FORM ELEMENTS
============================================= */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.form-grid.g3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.g1 { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group.s2 { grid-column: span 2; }
.form-group.s3 { grid-column: span 3; }

label.field-label { font-size: 12.5px; font-weight: 600; color: var(--gray-dark); }
label .req { color: var(--red); margin-right: 3px; }

input[type="text"], input[type="email"], input[type="tel"],
input[type="date"], input[type="number"], input[type="password"],
select, textarea {
  font-family: 'Cairo', sans-serif;
  font-size: 13.5px; color: var(--black);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 13px; width: 100%;
  outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
  direction: rtl;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--green-mid);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(26,138,74,0.14);
}
input::placeholder, textarea::placeholder { color: #bbb; }
textarea { resize: vertical; min-height: 85px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 36px;
}

/* Pills */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-item input { display: none; }
.pill-item label {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 15px;
  border: 1.5px solid var(--border);
  border-radius: 30px;
  font-size: 13px; font-weight: 500;
  color: var(--gray-dark); cursor: pointer;
  transition: all .15s; background: var(--bg);
}
.pill-item input:checked + label {
  background: var(--green-light);
  border-color: var(--green-mid);
  color: var(--green-dark); font-weight: 700;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px 20px; text-align: center;
  cursor: pointer; transition: all .2s;
  background: var(--bg);
}
.upload-zone:hover { border-color: var(--green-mid); background: var(--green-pale); }
.upload-zone input[type="file"] { display: none; }
.upload-icon { font-size: 30px; margin-bottom: 7px; }
.upload-text { font-size: 13px; color: var(--gray); }
.upload-text strong { color: var(--green-dark); }

.divider { height: 1px; background: var(--border); margin: 22px 0; }

/* =============================================
   ALERTS / BADGES
============================================= */
.alert {
  display: flex; gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13.5px;
}
.alert-warn    { background: #fff8e6; border: 1px solid #f5d87a; }
.alert-danger  { background: var(--red-light); border: 1px solid #f5c2cc; }
.alert-success { background: var(--green-light); border: 1px solid #9fd9b4; }
.alert-icon    { font-size: 18px; flex-shrink: 0; }
.alert-body strong { display: block; margin-bottom: 2px; color: var(--black); font-size: 13.5px; }
.alert-body p  { color: var(--gray-dark); margin: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 600;
}
.b-green  { background: var(--green-light); color: var(--green-dark); }
.b-red    { background: var(--red-light);   color: var(--red-dark); }
.b-amber  { background: #fef9e7; color: #7d5a00; }
.b-gray   { background: #f0f0f0; color: var(--gray-dark); }
.b-blue   { background: #eaf3fb; color: #1a5f8a; }

/* =============================================
   TABLE
============================================= */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  background: var(--green-pale);
  color: var(--green-dark); font-weight: 700;
  padding: 11px 16px; text-align: right;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:hover td { background: var(--green-pale); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* =============================================
   LAYOUT 2 COLONNES
============================================= */
.layout-2col { display: grid; grid-template-columns: 1fr 270px; gap: 22px; align-items: start; }
.panel-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.panel-hdr  { padding: 13px 17px; border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 700; color: var(--black); background: var(--green-pale); }
.panel-body { padding: 15px 17px; }
.qi-row { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; padding: 5px 0; }
.qi-lbl { color: var(--gray); }
.qi-val { font-weight: 600; color: var(--black); }

/* =============================================
   SEARCH / FILTER BAR
============================================= */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; background: var(--white);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; max-width: 360px; min-width: 200px; }
.search-wrap input { padding-right: 38px; background: var(--bg); }
.search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-light); }

/* =============================================
   ACTIONS BAR (sticky bottom)
============================================= */
.actions-bar {
  background: var(--white); border-top: 1px solid var(--border);
  padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; bottom: 0; z-index: 50;
}
.actions-info { font-size: 12.5px; color: var(--gray); }
.actions-info strong { color: var(--black); }
.actions-btns { display: flex; gap: 8px; }

/* =============================================
   STEPS INDICATOR
============================================= */
.steps { display: flex; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; }
.step { flex: 1; padding: 13px 16px; display: flex; align-items: center; gap: 9px; border-left: 1px solid var(--border); cursor: pointer; }
.step:last-child { border-left: none; }
.step.done   { background: var(--green-pale); }
.step.active { background: var(--green-light); }
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; color: var(--gray);
}
.step.active .step-num { background: var(--green); color: var(--white); }
.step.done   .step-num { background: var(--green-dark); color: var(--white); }
.step-lbl { font-size: 12.5px; font-weight: 600; color: var(--gray); }
.step.active .step-lbl, .step.done .step-lbl { color: var(--green-dark); }

/* =============================================
   TABS
============================================= */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 22px; }
.tab-btn {
  padding: 11px 20px; font-size: 13.5px; font-weight: 600;
  color: var(--gray); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  font-family: 'Cairo', sans-serif; transition: color .18s;
}
.tab-btn:hover { color: var(--green-dark); }
.tab-btn.active { color: var(--green-dark); border-bottom-color: var(--green); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* =============================================
   PATIENT CARD (vue)
============================================= */
.patient-header-card {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  border-radius: var(--radius); padding: 28px 32px;
  color: var(--white); margin-bottom: 24px;
  display: flex; align-items: center; gap: 24px;
  position: relative; overflow: hidden;
}
.patient-header-card::after {
  content: '';
  position: absolute; top: -30px; left: -30px;
  width: 150px; height: 150px;
  background: rgba(255,255,255,.05); border-radius: 50%; pointer-events: none;
}
/* Accent rouge (drapeau) sur la carte patient */
.patient-header-card::before {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
  opacity: 0.7;
}

.ph-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,.2); border: 3px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; flex-shrink: 0; overflow: hidden;
}
.ph-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ph-name  { font-size: 22px; font-weight: 800; }
.ph-meta  { font-size: 13px; opacity: .75; margin-top: 4px; }
.ph-badges { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.ph-badge { background: rgba(255,255,255,.18); border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 600; }
.ph-badge.danger { background: rgba(210,16,52,.7); }
.ph-actions { margin-right: auto; display: flex; gap: 8px; }
.ph-actions .btn { background: rgba(255,255,255,.15); color: var(--white); border-color: rgba(255,255,255,.25); }
.ph-actions .btn:hover { background: rgba(255,255,255,.25); }

/* Info grid */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
.info-lbl  { font-size: 11.5px; color: var(--gray-light); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.info-val  { font-size: 14px; color: var(--black); font-weight: 500; margin-top: 3px; }

/* =============================================
   LOGIN PAGE — avec drapeau Algérie
============================================= */
.login-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(0,98,51,0.08) 0%, transparent 50%),
    linear-gradient(225deg, rgba(210,16,52,0.06) 0%, transparent 50%),
    #f3f8f5;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

/* Bandes drapeau en arrière-plan */
.login-page::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--green) 50%, var(--red) 50%);
  z-index: 10;
}

.login-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px; padding: 48px 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 8px 40px rgba(0,98,51,0.12);
}

.login-logo { text-align: center; margin-bottom: 32px; }

.login-flag-wrapper {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 10px;
}
.login-flag-wrapper svg {
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.login-flag-wrapper h1 {
  font-size: 28px; font-weight: 800;
  color: var(--black);
  letter-spacing: -0.5px;
}

.login-logo p { font-size: 13px; color: var(--gray); margin-top: 6px; }

.login-error {
  background: var(--red-light); color: var(--red-dark);
  border: 1px solid #f5c2cc;
  padding: 11px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 20px;
}
.login-field label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-dark); margin-bottom: 7px; }
.login-btn { width: 100%; padding: 12px; font-size: 15px; font-weight: 700; border-radius: var(--radius-sm); justify-content: center; }

/* Badges de rôle sur la page login */
.login-roles {
  display: flex; gap: 8px; justify-content: center; margin-top: 18px;
}
.role-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.role-admin  { background: var(--green-light); color: var(--green-dark); }
.role-doctor { background: #eaf3fb; color: #1a5f8a; }

.login-footer { text-align: center; margin-top: 20px; font-size: 12px; color: var(--gray-light); }

/* =============================================
   PROGRESS BAR
============================================= */
.progress-bar  { background: var(--bg); border-radius: 10px; height: 7px; overflow: hidden; margin-top: 10px; }
.progress-fill { height: 100%; background: var(--green); border-radius: 10px; transition: width .4s ease; }

/* =============================================
   PATIENT LIST ROW
============================================= */
.patient-row { display: flex; align-items: center; gap: 13px; padding: 12px 16px; border-bottom: 1px solid var(--border); transition: background .15s; }
.patient-row:last-child { border-bottom: none; }
.patient-row:hover { background: var(--green-pale); cursor: pointer; }
.pt-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--green-light); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: var(--green-dark);
  overflow: hidden;
}
.pt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pt-info { flex: 1; }
.pt-name { font-size: 14px; font-weight: 700; color: var(--black); }
.pt-meta { font-size: 12px; color: var(--gray); margin-top: 2px; }

/* =============================================
   ADD ROW (tables dynamiques)
============================================= */
.add-row {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 13px; font-weight: 600;
  color: var(--green-dark); cursor: pointer;
  padding: 7px 13px; border-radius: var(--radius-sm);
  border: 1px dashed var(--green-mid);
  background: var(--green-pale); transition: background .18s;
}
.add-row:hover { background: var(--green-light); }

/* Drug table */
.drug-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.drug-table th { background: var(--green-light); color: var(--green-dark); font-weight: 700; padding: 10px 12px; text-align: right; border-bottom: 2px solid var(--border); }
.drug-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.drug-table tr:hover td { background: var(--green-pale); }
.drug-table input, .drug-table select { padding: 6px 9px; font-size: 12.5px; }

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 1100px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .layout-2col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(100%); width: 260px; }
  .sidebar.open { transform: translateX(0); box-shadow: -8px 0 32px rgba(0,0,0,0.2); }
  .main { margin-right: 0; }
  .menu-toggle { display: flex; }
  .content { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.g3 { grid-template-columns: 1fr 1fr; }
  .form-group.s2, .form-group.s3 { grid-column: span 1; }
  .steps .step-lbl { display: none; }
}

@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr; }
  .form-grid.g3 { grid-template-columns: 1fr; }
  .data-table th, .data-table td { padding: 8px 10px; font-size: 12.5px; }
  .login-box { padding: 32px 22px; }
  .login-flag-wrapper h1 { font-size: 22px; }
  .filter-bar { gap: 8px; }
  .search-wrap { min-width: 100%; }
}