/* ============================================================
   Mdicore ERP — Main Stylesheet
   Medical Theme | Mobile-First | CSS Variables
   ============================================================ */

:root {
  --primary:       #1a6fc4;
  --primary-dark:  #1258a0;
  --primary-light: #e8f1fb;
  --accent:        #00b4a0;
  --accent-dark:   #008c7e;
  --danger:        #e63946;
  --warning:       #f4a261;
  --success:       #2a9d4e;
  --info:          #3a86ff;
  --secondary:     #6c757d;

  --bg:            #f4f6fb;
  --surface:       #ffffff;
  --border:        #dde3ee;
  --text:          #1e2535;
  --text-muted:    #6c757d;
  --sidebar-w:     260px;
  --topbar-h:      60px;
  --radius:        10px;
  --shadow:        0 2px 12px rgba(26,111,196,.09);
  --shadow-lg:     0 6px 30px rgba(26,111,196,.14);
  --transition:    .22s ease;
  --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg:       #0f1117;
  --surface:  #1a1d27;
  --border:   #2e3348;
  --text:     #e0e4f0;
  --text-muted: #8891aa;
  --primary-light: #1a2845;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ── */
h1 { font-size: 1.65rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p  { line-height: 1.65; }
small { font-size: .82rem; }

/* ── Layout ── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
/* ===== SIDEBAR FIX: show all modules (scroll menu) ===== */

/* Sidebar container fixed full height */
.sidebar{
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;

  display: flex;
  flex-direction: column;

  background: linear-gradient(180deg, #0d2957 0%, #1a4080 100%);
  color: #c8d8f8;

  /* IMPORTANT: don't scroll the whole sidebar */
  overflow: hidden;
}

/* Logo stays fixed */
.sidebar-logo{
  flex-shrink: 0;
}

/* Only menu area scrolls */
.sidebar-nav{
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;

  padding: 6px 0 20px;

  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { 
  background: rgba(255,255,255,.18); border-radius: 4px; }
  /*befor css of problem*/
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, #0d2957 0%, #1a4080 100%);
  color: #c8d8f8; display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.1);
  color: #fff; font-size: 1.1rem; font-weight: 700; flex-shrink: 0;
}
.sidebar-logo svg { flex-shrink: 0; }
.sidebar-logo span { color: #6ec6ff; }

.sidebar-nav { padding: 6px 0 20px; flex: 1; }
.sidebar-section { 
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(200,216,248,.45); padding: 12px 18px 4px; font-weight: 600;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 18px; color: #c8d8f8; font-size: .875rem;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,.1); color: #fff;
  border-left-color: #6ec6ff; text-decoration: none;
}
.sidebar-nav a.active { background: rgba(110,198,255,.15); }
.sidebar-nav a svg { opacity: .75; flex-shrink: 0; width: 18px; height: 18px; }
.sidebar-nav a.active svg, .sidebar-nav a:hover svg { opacity: 1; }

/* ── Main content ── */
.main-content {
  margin-left: var(--sidebar-w); flex: 1;
  display: flex; flex-direction: column; min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); }
.page-title { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; color: var(--text); font-size: .85rem;
  display: flex; align-items: center; gap: 6px; transition: background var(--transition);
}
.topbar-btn:hover { background: var(--bg); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.user-info { display: flex; align-items: center; gap: 10px; }
.user-name { font-size: .88rem; font-weight: 600; }
.user-role { font-size: .75rem; color: var(--text-muted); }

/* ── Page content ── */
.page-content { padding: 24px; flex: 1; }
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px; gap: 12px; flex-wrap: wrap;
}
.page-header h1 { font-size: 1.4rem; margin-bottom: 3px; }
.breadcrumb { font-size: .82rem; color: var(--text-muted); }
.breadcrumb a { color: var(--primary); }

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
}
.card-title { font-size: 1rem; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg); }

/* ── Stat cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius); padding: 20px 22px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px; transition: transform var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon.blue   { background: #e8f1fb; color: var(--primary); }
.stat-icon.green  { background: #e8f7ee; color: var(--success); }
.stat-icon.orange { background: #fef3e8; color: var(--warning); }
.stat-icon.red    { background: #fde8ea; color: var(--danger); }
.stat-icon.teal   { background: #e8f8f6; color: var(--accent); }
.stat-icon.purple { background: #ede8fb; color: #7b4fff; }
.stat-icon svg    { width: 26px; height: 26px; }
.stat-info {}
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.stat-sub   { font-size: .78rem; color: var(--text-muted); margin-top: 6px; }

/* ── Tables ── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th {
  background: var(--bg); color: var(--text-muted); font-weight: 600;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 14px; border-bottom: 2px solid var(--border); white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--primary-light); }
td { padding: 11px 14px; vertical-align: middle; }
.td-actions { display: flex; gap: 6px; white-space: nowrap; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px; border-radius: 8px; font-size: .88rem; font-weight: 500;
  border: none; cursor: pointer; text-decoration: none !important;
  transition: all var(--transition); white-space: nowrap;
}
.btn-sm { padding: 5px 12px; font-size: .8rem; border-radius: 6px; }
.btn-xs { padding: 3px 9px; font-size: .75rem; border-radius: 5px; }
.btn-lg { padding: 11px 24px; font-size: .95rem; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #218a3e; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0303b; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-info      { background: var(--info); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-outline-primary { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-icon { padding: 7px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn svg { width: 16px; height: 16px; }
.btn-sm svg { width: 14px; height: 14px; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-control {
  display: block; width: 100%; padding: 9px 13px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: .9rem; font-family: var(--font); color: var(--text);
  background: var(--surface); transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,111,196,.15); }
.form-control::placeholder { color: #b0bac8; }
.form-control[readonly] { background: var(--bg); cursor: default; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-text { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px;
  border-radius: 20px; font-size: .72rem; font-weight: 600; line-height: 1;
}
.badge-success   { background: #d4f1e4; color: #1b7a3a; }
.badge-danger    { background: #fde8ea; color: #b02030; }
.badge-warning   { background: #fef3e8; color: #b56a20; }
.badge-info      { background: #e8f1fb; color: #1258a0; }
.badge-secondary { background: #e9ecef; color: #495057; }
.badge-primary   { background: var(--primary); color: #fff; }

/* ── Alerts ── */
.alert {
  padding: 13px 16px; border-radius: 8px; margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 10px; font-size: .88rem;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #d4f1e4; color: #155724; border-left: 4px solid var(--success); }
.alert-danger  { background: #fde8ea; color: #721c24; border-left: 4px solid var(--danger); }
.alert-warning { background: #fef3e8; color: #856404; border-left: 4px solid var(--warning); }
.alert-info    { background: #e8f1fb; color: #0c5460; border-left: 4px solid var(--info); }

/* ── Search & Filters ── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px;
  background: var(--surface); padding: 14px 18px; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.filter-bar .form-control { max-width: 200px; }
.search-input { position: relative; }
.search-input .form-control { padding-left: 38px; }
.search-input svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* ── Pagination ── */
.pagination { display: flex; gap: 4px; margin-top: 16px; justify-content: center; flex-wrap: wrap; }
.page-link {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 7px; font-size: .85rem;
  border: 1px solid var(--border); color: var(--text); background: var(--surface);
  transition: all var(--transition);
}
.page-link:hover, .page-link.active {
  background: var(--primary); border-color: var(--primary); color: #fff; text-decoration: none;
}

/* ── Grid utilities ── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: repeat(4,1fr); }
.col-span-2 { grid-column: span 2; }

/* ── Utilities ── */
.flex    { display: flex; }
.flex-1  { flex: 1; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.mt-1   { margin-top: 4px; }
.mt-2   { margin-top: 8px; }
.mt-3   { margin-top: 12px; }
.mt-4   { margin-top: 16px; }
.mb-0   { margin-bottom: 0; }
.mb-2   { margin-bottom: 8px; }
.mb-3   { margin-bottom: 12px; }
.mb-4   { margin-bottom: 16px; }
.p-4    { padding: 16px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-primary{ color: var(--primary); }
.text-sm     { font-size: .82rem; }
.text-lg     { font-size: 1.1rem; }
.font-bold   { font-weight: 700; }
.w-full      { width: 100%; }
.d-none      { display: none !important; }
.d-block     { display: block !important; }

/* ── Login page ── */
.login-page { min-height: 100vh; background: linear-gradient(135deg,#0d2957 0%,#1a6fc4 100%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box {
  background: var(--surface); border-radius: 16px; padding: 44px 40px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 1.6rem; color: var(--primary); }
.login-logo p  { color: var(--text-muted); font-size: .88rem; margin-top: 4px; }
.login-logo svg { width: 56px; height: 56px; color: var(--primary); }

/* ── Dashboard chart area ── */
.chart-container { width: 100%; height: 220px; position: relative; }
.chart-bar-wrap  { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding: 0 8px; }
.chart-bar       { flex: 1; border-radius: 6px 6px 0 0; background: var(--primary); min-width: 20px; transition: opacity .2s; position: relative; cursor: default; }
.chart-bar:hover { opacity: .8; }
.chart-bar::after { content: attr(data-val); position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--text-muted); white-space: nowrap; }
.chart-labels    { display: flex; gap: 8px; padding: 4px 8px 0; }
.chart-label     { flex: 1; text-align: center; font-size: .68rem; color: var(--text-muted); }

/* ── Detail view ── */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 16px; }
.detail-item label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 4px; }
.detail-item span  { font-size: .95rem; font-weight: 500; }

/* ── Info box ── */
.info-box { background: var(--primary-light); border-left: 4px solid var(--primary); border-radius: 0 8px 8px 0; padding: 12px 16px; font-size: .88rem; }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 18px; }
.timeline-item::before { content: ''; position: absolute; left: -24px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }
.timeline-date { font-size: .75rem; color: var(--text-muted); margin-bottom: 3px; }

/* ── Print Layout ── */
/*@media print {
  .sidebar, .topbar, .btn, .filter-bar, .pagination, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: #fff; font-size: 11pt; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  .print-header { text-align: center; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid #333; }
  table { font-size: 9pt; }
  thead th { background: #f0f0f0 !important; }
}*/

@media print {
    .no-print, .sidebar, .topbar, .menu-toggle, nav, button, .btn { display: none !important; }
    .main-content { margin: 0 !important; padding: 0 !important; }
    .page-content { padding: 0 !important; }
    body { font-size: 11px; }
    .card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
    table { page-break-inside: auto; }
    tr { page-break-inside: avoid; page-break-after: auto; }
}


/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .menu-toggle { display: flex; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .filter-bar { flex-direction: column; }
  .filter-bar .form-control { max-width: 100%; }
  .td-actions { flex-direction: column; }
  .page-header { flex-direction: column; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-box { padding: 28px 20px; }
}

/* ── Sidebar overlay ── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; }
.sidebar-overlay.show { display: block; }

/* ── Spinner ── */
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dynamic item rows ── */
.item-row { display: grid; grid-template-columns: 3fr 1fr 1.5fr 1.5fr 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.item-row.header { font-size: .78rem; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }

/* ── Invoice print ── */
.invoice-header { display: flex; justify-content: space-between; align-items: flex-start; }
.invoice-title  { font-size: 2rem; font-weight: 700; color: var(--primary); }
.invoice-meta   { text-align: right; font-size: .85rem; }
.invoice-table  { margin: 20px 0; }
.invoice-total  { text-align: right; margin-top: 12px; }
.invoice-total-row { display: flex; justify-content: flex-end; gap: 20px; margin: 4px 0; }
.invoice-total-row strong { min-width: 80px; text-align: right; }

/* ── Autocomplete ────────────────────────────────────── */
.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 1000;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg);
  max-height: 260px; overflow-y: auto; margin-top: 2px;
}
.autocomplete-list .ac-item {
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.autocomplete-list .ac-item:last-child { border-bottom: none; }
.autocomplete-list .ac-item:hover { background: var(--bg); }
.autocomplete-list .ac-item .ac-name { font-weight: 600; font-size: .9rem; }
.autocomplete-list .ac-item .ac-sub  { font-size: .78rem; color: var(--text-muted); }

/* ── Prescription rows ──────────────────────────────── */
.rx-row input, .rx-row select { font-size: .85rem; padding: 6px 8px; }
.sale-row input, .sale-row select { font-size: .85rem; padding: 6px 8px; }
.inv-row input, .inv-row select  { font-size: .85rem; padding: 6px 8px; }

/* ── Print-specific overrides ───────────────────────── */
.print-header { text-align: center; margin-bottom: 20px; }
.print-header h2 { font-size: 1.6rem; }
.invoice-title { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.invoice-table table { width: 100%; }
@media print {
  .no-print, .sidebar, .topbar, .menu-toggle { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  .print-actions { display: none; }
}

/* ── Status badges extra ─────────────────────────────── */
.badge-purple { background: #7c3aed22; color: #7c3aed; }
.badge { font-size: .73rem; }

/* ── Flex utilities ──────────────────────────────────── */
.flex { display: flex; }
.flex.gap-2 { gap: 8px; }
.flex.gap-3 { gap: 12px; }
.flex.justify-between { justify-content: space-between; }
.flex.items-center { align-items: center; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.mb-4 { margin-bottom: 20px; }
.font-bold { font-weight: 700; }
.text-sm { font-size: .82rem; }
.gap-2 { gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}