/* ============================================================================
   ASB Bettenübersicht — professional theme layer
   Layered ON TOP of Bootstrap (which still drives modals + grid + JS).
   Plain CSS by design: editable without re-running the Tailwind build.
   Load order: bootstrap.min.css -> main.css -> theme.css -> tailwind.css
   ========================================================================== */

/* ---- Inter (self-hosted, vendored in /fonts) ------------------------------ */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --asb-red: #ed1639;
  --asb-red-dark: #c70f2e;
  --asb-red-soft: #fde3e8;
  --asb-ink: #1f2937;
  --asb-muted: #6b7280;
  --asb-line: #e5e7eb;
  --asb-bg: #f3f4f6;
  --asb-surface: #ffffff;
  --asb-radius: 12px;
  --asb-radius-sm: 8px;
  --asb-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --asb-shadow-soft: 0 6px 20px rgba(16, 24, 40, .10);
}

body {
  background-color: var(--asb-bg);
  color: var(--asb-ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: opacity .25s ease;
}

h1, h2, h3, h4, h5, h6 { color: #111827; }

/* ---- Navbar ---------------------------------------------------------------- */
.app-navbar {
  background-color: var(--asb-surface) !important;
  border-bottom: 1px solid var(--asb-line);
  box-shadow: var(--asb-shadow);
  padding: .55rem 0;
}
.app-navbar .navbar-brand {
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: .6rem;
  letter-spacing: -.01em;
}
.app-navbar .navbar-brand img {
  width: 30px;
  height: 30px;
}
.app-navbar .navbar-text {
  color: var(--asb-muted);
  font-size: .85rem;
  line-height: 1.35;
}
.app-navbar .navbar-text b { color: var(--asb-ink); }

/* ---- Buttons --------------------------------------------------------------- */
.btn {
  --bs-btn-border-radius: var(--asb-radius-sm);
  border-radius: var(--asb-radius-sm);
  font-weight: 600;
  letter-spacing: .01em;
  box-shadow: none;
  transition: background-color .15s ease, border-color .15s ease,
    color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(237, 22, 57, .25);
}

.btn-primary,
.btn-danger {
  background-color: var(--asb-red);
  border-color: var(--asb-red);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus,
.btn-danger:hover, .btn-danger:focus {
  background-color: var(--asb-red-dark);
  border-color: var(--asb-red-dark);
  color: #fff;
}

.btn-outline-primary {
  color: var(--asb-red);
  border-color: var(--asb-red);
  background-color: transparent;
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
  background-color: var(--asb-red);
  border-color: var(--asb-red);
  color: #fff;
}

/* gender toggle (M/W/D) uses blue instead of the brand red */
#patControl .btn-check[name="inp-gender"] + .btn {
  color: #2563eb;
  border-color: #2563eb;
}
#patControl .btn-check[name="inp-gender"] + .btn:hover,
#patControl .btn-check[name="inp-gender"]:checked + .btn {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.btn-outline-danger {
  color: var(--asb-red);
  border-color: var(--asb-red-soft);
  background-color: transparent;
}
.btn-outline-danger:hover, .btn-outline-danger:focus {
  background-color: var(--asb-red);
  border-color: var(--asb-red);
  color: #fff;
}

.btn-success {
  background-color: #16794f;
  border-color: #16794f;
}
.btn-success:hover, .btn-success:focus {
  background-color: #136443;
  border-color: #136443;
}

.btn-outline-secondary {
  color: #475569;
  border-color: #cbd5e1;
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus {
  background-color: #475569;
  border-color: #475569;
  color: #fff;
}

/* ---- Forms ----------------------------------------------------------------- */
.form-label {
  font-weight: 600;
  font-size: .85rem;
  color: #374151;
  margin-bottom: .35rem;
}
.form-control,
.form-select {
  border-radius: var(--asb-radius-sm);
  border: 1px solid #d1d5db;
  color: var(--asb-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus,
.form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .25);
}

/* ---- Cards / modals -------------------------------------------------------- */
.modal-content {
  border: none;
  border-radius: var(--asb-radius);
  box-shadow: var(--asb-shadow-soft);
  overflow: hidden;
}
.modal-header {
  border-bottom: 1px solid var(--asb-line);
  padding: 1rem 1.25rem;
  background: var(--asb-surface);
}
.modal-title { font-weight: 700; letter-spacing: -.01em; }
.modal-body { padding: 1.25rem; }
.modal-footer {
  border-top: 1px solid var(--asb-line);
  padding: .85rem 1.25rem;
  gap: .5rem;
}

/* ---- Alerts ---------------------------------------------------------------- */
.alert {
  border-radius: var(--asb-radius-sm);
  border: 1px solid transparent;
}
.alert-primary {
  background-color: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a8a;
}
.alert-warning {
  background-color: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}
.alert-danger {
  background-color: var(--asb-red-soft);
  border-color: #f8c6cf;
  color: var(--asb-red-dark);
}

/* ---- Login screen ---------------------------------------------------------- */
.login.modal-dialog { max-width: 420px; }
.login .modal-content { box-shadow: var(--asb-shadow-soft); }
.login .modal-header {
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid var(--asb-line);
  padding-top: 1.5rem;
}
.login .login-logo {
  width: 56px;
  height: 56px;
}
.login .modal-title { text-align: center; }
.login .modal-body { padding: 1.5rem; }

/* ---- Surface card used in the admin overview ------------------------------- */
.surface-card {
  background: var(--asb-surface);
  border: 1px solid var(--asb-line);
  border-radius: var(--asb-radius);
  box-shadow: var(--asb-shadow);
}

/* ---- Patient list ---------------------------------------------------------- */
/* refresh button icon + spinner */
.js-refresh .refresh-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
.js-refresh.spinning .refresh-icon { animation: asb-spin .7s linear infinite; }

/* casus-created success card */
.casus-created {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  line-height: 1.2;
  padding: .5rem 0 .25rem;
}
.casus-created-check { animation: casus-pop .3s ease-out; }
@keyframes casus-pop {
  from { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); }
  to   { transform: scale(1); opacity: 1; }
}
.casus-created-label {
  color: var(--asb-muted);
  font-size: .95rem;
}
.casus-created-num {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  color: #111827;
}

.pats-head {
  background: #f8fafc !important;
  color: var(--asb-muted);
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .72rem !important;
  border: 1px solid var(--asb-line);
  border-radius: var(--asb-radius-sm) var(--asb-radius-sm) 0 0;
}
#patsContainer {
  border: 1px solid var(--asb-line);
  border-top: none;
  background: var(--asb-surface);
}
#pats .row {
  border-bottom: 1px solid #f1f5f9;
  border-left: 3px solid transparent;
  align-items: center;
}
#pats .pat-icon-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
#pats .pat-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #000;
  pointer-events: none;
}
#pats .pat-check { width: 22px; height: 22px; flex-shrink: 0; }
/* time matches the infos text size */
#pats .pat-time { font-size: .8em; }
/* soften the legacy status tints + add a left status accent */
#pats .row-done  { background-color: #deffe8; border-left-color: #16794f; }
#pats .row-todo  { background-color: #f8d1d1; border-left-color: var(--asb-red); }
#pats .row-abtr  { background-color: #fde68a; border-left-color: #e3a00f; }

/* ---- Casus request loader -------------------------------------------------- */
.casus-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  color: var(--asb-muted);
  font-size: 1rem;
  padding: .75rem 0;
}
.casus-loading .spinner {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 3px solid var(--asb-line);
  border-top-color: var(--asb-red);
  animation: asb-spin .7s linear infinite;
}
@keyframes asb-spin {
  to { transform: rotate(360deg); }
}

/* ---- Status legend (additive, static markup) ------------------------------- */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  align-items: center;
  font-size: .8rem;
  color: var(--asb-muted);
}
.legend .dot {
  display: inline-block;
  width: .8rem;
  height: .8rem;
  border-radius: 3px;
  margin-right: .35rem;
  vertical-align: -1px;
  border: 1px solid rgba(0, 0, 0, .12);
}
.legend .dot-free      { background: #198754; }
.legend .dot-busy      { background: #dc3545; }
.legend .dot-transport { background: #fcd200; }
.legend .dot-neb       { background: #efefef; }
.legend .dot-int       { background: #fff; border: 1px solid #f500f5; }

/* ---- Admin bed group cards ------------------------------------------------- */
.admin-beds-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;   /* all cards in a row share the same height */
  gap: 10px;
  padding: 0 8px;
  margin-top: 1.25rem;    /* space after the legend */
}
.admin-beds {
  float: none !important;
  margin: 0 !important;
  border: 1px solid var(--asb-line) !important;
  border-radius: var(--asb-radius) !important;
  box-shadow: var(--asb-shadow);
  background: var(--asb-surface);
}
/* keep the floorplan SVGs at their natural aspect ratio inside the stretched card */
.admin-beds svg {
  width: 100%;
  height: auto !important;
  display: block;
}
.admin-beds h3 {
  font-size: 1.1rem;
  font-weight: 700;
}
.admin-beds .count { color: var(--asb-red); font-weight: 600; }
.admin-beds .stat { color: var(--asb-muted); }
