/* Shared appearance; brand blue and existing layout/typefaces are retained. */
@import url("theme-palette.css?v=1");
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700&display=swap");
:root {
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-ui: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}
html[data-theme="dark"] {
  --bg: #0d1625;
  --card: #172438;
  --text: #e7eef9;
  --muted: #b6c5da;
  --border: #364a65;
  --shadow: 0 14px 40px rgba(0,0,0,.3);
  --bs-body-color: #e7eef9;
  --bs-body-bg: #0d1625;
  --bs-border-color: #364a65;
  --bs-secondary-color: #b6c5da;
  --bs-tertiary-bg: #1c2c42;
  --bs-link-color: #9cc8ff;
}
body, input, select, textarea { font-family: var(--font-body); }
button { font-family: var(--font-ui); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-ui); }
input, select, textarea, button { max-width: 100%; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; }
:where(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid #f5b301;
  outline-offset: 3px;
}
.cs-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 8px;
  margin: 0;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.12);
  cursor: pointer;
  line-height: 1;
}
.cs-theme-toggle:hover { background: rgba(255,255,255,.23); }
.cs-theme-toggle svg { flex-shrink: 0; }
.cs-theme-toggle .cs-theme-sun { display: none; }
html[data-theme="dark"] .cs-theme-toggle .cs-theme-moon { display: none; }
html[data-theme="dark"] .cs-theme-toggle .cs-theme-sun { display: block; }
.cs-theme-floating { position: fixed; right: 16px; bottom: 20px; z-index: 1100; background: #0a3d91; box-shadow: 0 3px 14px #0003; }
.cs-theme-floating:hover { background: #08357f; }
/* Allow fields and flex/grid children to shrink instead of hiding actions. */
.admin-content, .admin-card, .dash-card, .settings-card, .nav-right { min-width: 0; }
.topbar .nav-right { flex-shrink: 0; }
.topbar :is(.profile-menu-wrap, .profile-menu-btn, .mobile-nav-btn) { flex-shrink: 0; }
.topbar .logo-mark { background: white; }
/* Native hidden must win over component display:grid/flex rules. */
[hidden]:not([hidden="until-found"]) { display: none !important; }
html[data-theme="dark"] body { background-color: var(--bg); color: var(--text); }
html[data-theme="dark"] :is(.bg-photo-page, .hero, .form-wrap, .auth-page)::before {
  background-color: rgba(13,22,37,.87);
}
html[data-theme="dark"] :is(input, textarea, select) {
  color: var(--text);
  background-color: #101c2e;
  border-color: var(--border);
  color-scheme: dark;
}
html[data-theme="dark"] :is(input, textarea)::placeholder { color: #a0b3ce; opacity: 1; }
html[data-theme="dark"] input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px #101c2e inset;
}
html[data-theme="dark"] :is(input, textarea, select):disabled { opacity: .7; }
html[data-theme="dark"] :is(.bg-photo-page, .bg-photo-inner, .form-wrap) { color: var(--text); }
html[data-theme="dark"] :is(.welcome, .section-title, .section-sub, .form-title, .form-sub, .label) { color: var(--text); }
html[data-theme="dark"] :is(.subline, .muted, .text-muted, .help-text) { color: var(--muted) !important; }
html[data-theme="dark"] .hero-title .highlight {
  background-image: linear-gradient(135deg, #a9cfff, #79aaff);
}
/* Do not invert document images, portraits, QR codes, charts or map tiles. */
@media (max-width: 600px) {
  .topbar .nav-right { gap: 7px !important; }
  .topbar .nav-welcome { display: none; }
  .cs-theme-toggle { flex-basis: 36px; width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-theme-toggle, .topbar { transition: none !important; }
}
@media print {
  .cs-theme-toggle { display: none !important; }
  html[data-theme="dark"] body { background: white; color: black; }
}
