html { color-scheme: light; }
body, .sidebar, .main > header, .card, .metrics article, .auth-card, input, select, textarea, button { transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease; }

.logo-img { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; box-shadow: 0 8px 18px #477bd935; }
.logo-img.large { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px; display: block; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-action { min-width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; color: #536177; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; padding: 0 11px; }
.header-action i { font-size: 15px; }
.header-action.install { color: #3568c4; background: #edf3ff; border-color: #d8e5fa; }
.theme-fab { position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: #3d67ac; box-shadow: 0 10px 28px #17233c24; cursor: pointer; }
.btn { gap: 7px; }
.btn i { font-size: 13px; }
.sidebar nav i.bi { font-size: 16px; }
.metric-icon-bi { width: 42px; height: 42px; border-radius: 10px; background: #edf3ff; color: #477bd9; display: grid; place-items: center; font-size: 18px; }
.offline-card { text-align: center; }
.offline-icon { display: block; font-size: 42px; color: #7c8da7; margin: 10px 0; }

html[data-theme="dark"] { color-scheme: dark; --navy:#dbe7ff; --ink:#e7edf8; --muted:#95a2b7; --line:#26334a; --bg:#0b1120; --blue:#70a1ff; }
html[data-theme="dark"] body { background:#0b1120; color:#e7edf8; }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .main > header,
html[data-theme="dark"] .card,
html[data-theme="dark"] .metrics article,
html[data-theme="dark"] .auth-card { background:#111a2b; border-color:#26334a; box-shadow:0 4px 18px #00000025; }
html[data-theme="dark"] .sidebar nav a { color:#9ba9bf; }
html[data-theme="dark"] .sidebar nav a:hover,
html[data-theme="dark"] .sidebar nav a.active { background:#1a2b49; color:#8ab3ff; }
html[data-theme="dark"] .brand small,
html[data-theme="dark"] .page-title p,
html[data-theme="dark"] .card p,
html[data-theme="dark"] .metrics small,
html[data-theme="dark"] .account small { color:#95a2b7; }
html[data-theme="dark"] .global-search,
html[data-theme="dark"] .form-grid input,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .form-grid textarea,
html[data-theme="dark"] .auth-card input,
html[data-theme="dark"] .inline input,
html[data-theme="dark"] .inline select,
html[data-theme="dark"] .header-action,
html[data-theme="dark"] .logout { background:#0d1627; border-color:#2b3a52; color:#d9e2f1; }
html[data-theme="dark"] .global-search input { color:#d9e2f1; }
html[data-theme="dark"] .header-action.install { background:#18305a; color:#91b8ff; }
html[data-theme="dark"] .table-card th { background:#0e1728; color:#9eabc0; border-color:#26334a; }
html[data-theme="dark"] .table-card td { color:#b8c4d7; border-color:#202c40; }
html[data-theme="dark"] .table-card tr:hover td { background:#142037; }
html[data-theme="dark"] .finance-bars i,
html[data-theme="dark"] .progress { background-color:#202d42; }
html[data-theme="dark"] .odontogram span { background:#172238; color:#7f91ac; }
html[data-theme="dark"] .metric-icon-bi,
html[data-theme="dark"] .metrics article > i { background:#1a2d4f; color:#87aff6; }
html[data-theme="dark"] .auth-bg { background:radial-gradient(circle at 15% 15%,#172a4d,transparent 35%),#0b1120; }
html[data-theme="dark"] .theme-fab { background:#172238; border-color:#31415a; color:#ffd977; }

@media(max-width:780px){
  .header-action span { display:none; }
  .header-action { padding:0; width:38px; }
  .header-tools { margin-left:auto; }
}

@media print {
  .theme-fab, .header-tools, .menu, .sidebar { display:none!important; }
  .main { margin-left:0; }
}
