:root {
  --bg: #060a17;
  --bg-soft: #0f1a31;
  --panel: #121f3d;
  --panel-soft: #17284d;
  --border: rgba(125, 154, 255, 0.2);
  --text: #f4f7ff;
  --muted: #a8b7dd;
  --accent: #5e6cff;
  --accent-2: #27c4f5;
  --success: #35d49a;
  --warning: #f7b955;
  --danger: #f0617f;
  --shadow: 0 18px 45px rgba(2, 7, 24, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Inter", "Segoe UI", "Roboto", sans-serif;
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(65, 122, 255, 0.32), transparent 56%),
    radial-gradient(900px 420px at 88% 0%, rgba(80, 200, 255, 0.2), transparent 52%),
    radial-gradient(circle at top, #122347 0%, #081024 45%, #060a17 100%);
  color: var(--text);
}

a {
  color: var(--accent-2);
}

#root {
  min-height: 100vh;
}

.platform-shell {
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr);
  gap: 0.85rem;
  padding: 0.85rem;
  min-height: 100vh;
}

.sidebar {
  border: 1px solid rgba(124, 153, 233, 0.24);
  background:
    linear-gradient(160deg, rgba(20, 34, 66, 0.94) 0%, rgba(12, 21, 43, 0.97) 58%, rgba(8, 16, 34, 0.99) 100%);
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: calc(100vh - 1.7rem);
  border-radius: 22px;
  box-shadow: 0 18px 44px rgba(2, 8, 28, 0.42), inset 0 0 0 1px rgba(129, 158, 245, 0.08);
}

.brand {
  display: block;
  margin-bottom: 1.3rem;
  padding: 0;
  width: fit-content;
  max-width: 100%;
}

.brand img {
  display: block;
  width: min(168px, 100%);
  height: auto;
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.72rem 0.74rem;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  font-size: 0.92rem;
}

.nav-btn:hover {
  background: rgba(55, 83, 144, 0.2);
  border-color: rgba(130, 160, 255, 0.26);
  color: var(--text);
}

.nav-btn.active {
  background: linear-gradient(90deg, rgba(84, 104, 255, 0.22), rgba(38, 183, 241, 0.14));
  border-color: rgba(114, 154, 255, 0.38);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(125, 156, 255, 0.28);
}

.content {
  min-width: 0;
  padding: 1.1rem 1.2rem 1.5rem;
  border-radius: 22px;
  border: 1px solid rgba(124, 153, 233, 0.2);
  background:
    radial-gradient(1000px 360px at -10% -20%, rgba(89, 135, 255, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(10, 19, 41, 0.93), rgba(8, 15, 32, 0.95));
  box-shadow: 0 18px 44px rgba(2, 8, 28, 0.36);
}

.topbar {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding: 1.05rem 1.15rem;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)),
    rgba(9, 16, 35, 0.76);
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.35);
  backdrop-filter: blur(18px);
}

.topbar-toolbar {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.topbar-copy {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}

.topbar-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.34rem 0.72rem;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #bfe7ff;
}

.topbar-title {
  margin: 0;
  font-size: clamp(2rem, 3.6vw, 3.35rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 700;
}

.gradient-text {
  background: linear-gradient(120deg, #f8fbff 0%, #93c5fd 50%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar-subtitle {
  margin: 0.45rem 0 0;
  max-width: 920px;
  color: #b2c1df;
  font-size: 0.95rem;
  line-height: 1.65;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.topbar-meta-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.72);
  padding: 0.34rem 0.72rem;
  font-size: 0.77rem;
  font-weight: 600;
  color: #d7e4fb;
}

.topbar-meta-chip.status-online,
.topbar-meta-chip.ok,
.topbar-meta-chip.monitoring-online,
.topbar-meta-chip.monitoring-active {
  border-color: rgba(74, 222, 128, 0.3);
  background: rgba(20, 83, 45, 0.34);
  color: #dcfce7;
}

.topbar-meta-chip.status-offline,
.topbar-meta-chip.monitoring-offline,
.topbar-meta-chip.alert-muted {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(51, 65, 85, 0.38);
  color: #e2e8f0;
}

.topbar-meta-chip.alert-recent,
.topbar-meta-chip.monitoring-connected,
.topbar-meta-chip.alert-no-person {
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(154, 52, 18, 0.34);
  color: #fed7aa;
}

.topbar-meta-chip.monitoring-ready {
  border-color: rgba(134, 239, 172, 0.34);
  background: rgba(21, 128, 61, 0.24);
  color: #dcfce7;
}

.topbar-meta-chip.alert-fall {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(127, 29, 29, 0.38);
  color: #fee2e2;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-nav-btn {
  white-space: nowrap;
}

.topbar-meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  max-width: 100%;
}

button.topbar-meta-action-btn {
  border-radius: 999px;
  padding: 0.42rem 0.78rem;
  font-size: 0.77rem;
  white-space: nowrap;
}

.pill {
  border: 1px solid var(--border);
  background: rgba(18, 31, 61, 0.58);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
}

button,
select,
input,
textarea {
  font-family: inherit;
}

button.primary,
button.secondary,
button.danger,
button.ghost {
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.56rem 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

button.primary {
  background: linear-gradient(90deg, var(--accent) 0%, #6b76ff 40%, var(--accent-2) 100%);
  color: white;
  box-shadow: 0 10px 24px rgba(85, 105, 255, 0.32);
}

button.primary:hover {
  filter: brightness(1.07);
}

button.secondary {
  background: rgba(42, 66, 120, 0.6);
  color: var(--text);
  border-color: rgba(140, 165, 255, 0.32);
}

button.secondary:hover {
  background: rgba(60, 90, 162, 0.62);
}

button.danger {
  background: rgba(112, 29, 54, 0.88);
  color: #ffe1e7;
  border-color: rgba(240, 97, 127, 0.34);
}

button.danger:hover {
  background: rgba(143, 42, 72, 0.94);
}

button.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.flash {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.89rem;
}

.flash.success {
  background: rgba(55, 179, 129, 0.18);
  border-color: rgba(74, 225, 164, 0.38);
}

.flash.error {
  background: rgba(216, 80, 116, 0.18);
  border-color: rgba(255, 126, 161, 0.38);
}

.grid {
  display: grid;
  gap: 0.95rem;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  background:
    radial-gradient(700px 180px at 0% -10%, rgba(98, 138, 255, 0.16), transparent 58%),
    linear-gradient(180deg, rgba(20, 35, 67, 0.92) 0%, rgba(13, 24, 51, 0.95) 100%);
  border: 1px solid rgba(126, 154, 228, 0.22);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 0.9rem;
  min-width: 0;
}

.panel h2,
.panel h3 {
  margin: 0 0 0.52rem;
}

.panel h2 {
  font-size: 1rem;
}

.panel h3 {
  font-size: 0.92rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.panel-toggle-head {
  cursor: pointer;
  border-radius: 16px;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.panel-toggle-head:hover {
  background: rgba(29, 47, 87, 0.56);
}

.panel-toggle-head:focus-visible {
  outline: 2px solid rgba(140, 206, 255, 0.72);
  outline-offset: 2px;
}

.panel-toggle-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #d6e4ff;
  white-space: nowrap;
}

.panel-toggle-indicator::before {
  content: "▾";
  font-size: 0.78rem;
  line-height: 1;
}

.panel-toggle-head[data-expanded="false"] .panel-toggle-indicator::before {
  content: "▸";
}

.muted {
  color: var(--muted);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0.28rem 0;
}

.stat-sub {
  color: var(--muted);
  font-size: 0.8rem;
}

.owner-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0.95rem;
}

.owner-list {
  display: grid;
  gap: 0.5rem;
  max-height: 71vh;
  overflow: auto;
  padding-right: 0.2rem;
}

.owner-card {
  border: 1px solid rgba(130, 160, 255, 0.24);
  border-radius: 12px;
  padding: 0.72rem;
  background: rgba(25, 42, 79, 0.46);
  cursor: pointer;
  text-align: left;
}

.owner-card:hover {
  border-color: rgba(158, 186, 255, 0.44);
}

.owner-card.active {
  border-color: rgba(127, 162, 255, 0.68);
  background: rgba(43, 69, 129, 0.45);
  box-shadow: inset 0 0 0 1px rgba(128, 164, 255, 0.4);
}

.owner-card .name {
  font-weight: 700;
  margin-bottom: 0.18rem;
}

.owner-card .meta {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag,
.status {
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
  border: 1px solid rgba(127, 160, 255, 0.33);
  color: #dce6ff;
  background: rgba(42, 66, 120, 0.48);
}

.status.aktiv {
  border-color: rgba(88, 232, 170, 0.55);
  color: #b8ffe0;
  background: rgba(20, 109, 77, 0.42);
}

.status.paused,
.status.meghivva {
  border-color: rgba(251, 201, 96, 0.58);
  color: #ffe7b2;
  background: rgba(131, 92, 29, 0.45);
}

.status.archivalt,
.status.archived,
.status.lemondva,
.status.sztorno {
  border-color: rgba(242, 111, 150, 0.55);
  color: #ffc7d8;
  background: rgba(143, 44, 80, 0.45);
}

.status.fizetett {
  border-color: rgba(99, 227, 179, 0.58);
  color: #c9ffec;
  background: rgba(22, 113, 84, 0.42);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.form-grid.full {
  grid-template-columns: 1fr;
}

.owners-filter-grid {
  grid-template-columns: minmax(220px, 1fr) 260px auto auto;
  align-items: end;
}

.patients-filter-grid {
  grid-template-columns: minmax(220px, 1fr) 260px auto minmax(220px, auto);
  align-items: end;
}

label {
  display: grid;
  gap: 0.32rem;
  font-size: 0.81rem;
  color: var(--muted);
}

input,
select,
textarea {
  border: 1px solid rgba(138, 167, 255, 0.36);
  border-radius: 10px;
  padding: 0.5rem 0.62rem;
  background: rgba(14, 23, 44, 0.92);
  color: var(--text);
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(120, 162, 255, 0.78);
  box-shadow: 0 0 0 2px rgba(95, 126, 255, 0.2);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.inline-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-checkbox-grid {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.admin-checkbox-grid label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.58rem;
  border: 1px solid rgba(121, 157, 255, 0.24);
  border-radius: 999px;
  background: rgba(21, 35, 66, 0.56);
}

.admin-checkbox-grid input {
  width: auto;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

thead th {
  text-align: left;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: #c2d2fc;
  font-weight: 600;
  padding: 0.54rem 0.4rem;
  border-bottom: 1px solid rgba(130, 158, 244, 0.24);
}

.th-sort-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0;
}

.th-sort-btn:hover {
  color: #d6e5ff;
}

.owner-table-name-btn {
  border: 0;
  background: transparent;
  color: #89dbff;
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.owner-table-name-btn:hover {
  color: #b8f1ff;
}

.owner-event-row {
  cursor: pointer;
}

.owner-event-row td {
  transition: background 160ms ease, border-color 160ms ease;
}

.owner-event-row:hover td {
  background: rgba(55, 92, 170, 0.18);
}

.owner-event-open-btn {
  font-weight: 700;
}

.owner-event-open-btn:hover {
  color: #dff6ff;
}

.owner-event-doc-count {
  color: #9cdcff;
  font-weight: 600;
}

.icon-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  max-width: 100%;
  white-space: nowrap;
  padding: 0.26rem 0.56rem;
  border-radius: 999px;
  border: 1px solid rgba(124, 158, 247, 0.3);
  background: rgba(43, 68, 126, 0.42);
  color: #dce9ff;
  font-size: 0.72rem;
  font-weight: 600;
}

.presence-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 0 4px rgba(255, 255, 255, 0.03);
}

.presence-dot.online {
  background: #35d49a;
}

.presence-dot.offline {
  background: #8aa0c4;
}

.icon-status-pill.alert {
  border-color: rgba(245, 126, 158, 0.55);
  background: rgba(143, 45, 81, 0.42);
  color: #ffd8e4;
}

.icon-status-pill.ok {
  border-color: rgba(105, 231, 179, 0.5);
  background: rgba(21, 110, 79, 0.36);
  color: #cbffee;
}

.icon-status-pill.alert-recent {
  border-color: rgba(247, 185, 85, 0.58);
  background: rgba(161, 98, 7, 0.32);
  color: #fff0c9;
}

.icon-status-pill.alert-no-person,
.icon-status-pill.monitoring-connected {
  border-color: rgba(247, 185, 85, 0.58);
  background: rgba(161, 98, 7, 0.32);
  color: #fff0c9;
}

.icon-status-pill.monitoring-ready {
  border-color: rgba(134, 239, 172, 0.42);
  background: rgba(21, 128, 61, 0.24);
  color: #dcfce7;
}

.icon-status-pill.alert-fall {
  border-color: rgba(248, 113, 113, 0.44);
  background: rgba(127, 29, 29, 0.36);
  color: #fee2e2;
}

.icon-status-pill.monitoring-online,
.icon-status-pill.monitoring-active {
  border-color: rgba(105, 231, 179, 0.5);
  background: rgba(21, 110, 79, 0.36);
  color: #cbffee;
}

.icon-status-pill.alert-muted {
  border-color: rgba(128, 155, 201, 0.34);
  background: rgba(44, 61, 92, 0.46);
  color: #d8e3f7;
}

.icon-status-pill.monitoring-offline {
  border-color: rgba(128, 155, 201, 0.34);
  background: rgba(44, 61, 92, 0.46);
  color: #d8e3f7;
}

.owner-table-row-active td {
  background: rgba(55, 92, 170, 0.26);
}

tbody td {
  padding: 0.48rem 0.4rem;
  border-bottom: 1px solid rgba(90, 119, 193, 0.21);
  font-size: 0.84rem;
  vertical-align: top;
}

.empty {
  border: 1px dashed rgba(121, 154, 252, 0.34);
  border-radius: 12px;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
  background: rgba(21, 34, 62, 0.45);
}

.helper {
  color: var(--muted);
  font-size: 0.81rem;
}

.permission-pills {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.permission-pills span {
  background: rgba(52, 84, 152, 0.55);
  border: 1px solid rgba(121, 157, 255, 0.36);
  border-radius: 999px;
  padding: 0.14rem 0.43rem;
  font-size: 0.68rem;
  color: #d8e7ff;
}

.collaborator-email-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

button.collaborator-delete-btn,
button.danger.collaborator-delete-btn {
  flex: 0 0 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
  font-size: 0.68rem;
  line-height: 1;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}

.patient-fee-input {
  width: 120px;
  max-width: 100%;
}

.billing-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.billing-summary-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(110, 146, 236, 0.2);
  background: rgba(26, 40, 74, 0.6);
}

.billing-summary-card strong {
  font-size: 1rem;
  color: #f7fbff;
}

.status-col {
  display: grid;
  gap: 0.32rem;
  min-width: 180px;
}

.status-col.monitoring-presence-col {
  min-width: 0;
}

.monitoring-presence-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.icon-status-pill.monitoring-presence-pill {
  flex: 0 0 auto;
  width: fit-content;
  padding: 0.18rem 0.44rem;
  gap: 0.24rem;
  font-size: 0.69rem;
}

.monitoring-presence-meta {
  font-size: 0.72rem;
  color: #b9caef;
  line-height: 1.35;
}

.alert-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  border: 1px solid rgba(134, 162, 243, 0.35);
  background: rgba(50, 73, 128, 0.45);
  color: #d7e7ff;
}

.alert-pill.active {
  border-color: rgba(245, 126, 158, 0.54);
  background: rgba(143, 45, 81, 0.42);
  color: #ffd3e0;
}

.alert-pill.ok {
  border-color: rgba(105, 231, 179, 0.55);
  background: rgba(21, 110, 79, 0.4);
  color: #cbffee;
}

.status-meta {
  display: grid;
  gap: 0.12rem;
  font-size: 0.72rem;
  color: #b9caef;
}

.activity-col {
  display: grid;
  gap: 0.3rem;
  min-width: 190px;
}

.activity-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  white-space: nowrap;
  font-size: 0.76rem;
  color: #dce8ff;
}

.activity-meter {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(56, 85, 145, 0.4);
  overflow: hidden;
}

.activity-meter.compact {
  width: 92px;
  height: 6px;
  flex: 0 0 auto;
}

.activity-fill {
  height: 100%;
}

.activity-fill.none {
  background: #7786aa;
}

.activity-fill.low {
  background: #35d49a;
}

.activity-fill.medium {
  background: #f7b955;
}

.activity-fill.high {
  background: #f0617f;
}

.section-divider {
  border-top: 1px solid rgba(122, 152, 242, 0.24);
  margin: 0.9rem 0;
  padding-top: 0.9rem;
}

.icon-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.auth-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

pre.code-result {
  background: rgba(10, 16, 34, 0.92);
  border: 1px solid rgba(127, 160, 255, 0.32);
  color: #d7e7ff;
  border-radius: 12px;
  margin: 0;
  padding: 0.8rem;
  overflow: auto;
  max-height: 320px;
  font-size: 0.74rem;
  line-height: 1.45;
}

.chart-box {
  width: 100%;
  height: 265px;
  border-radius: 18px;
  border: 1px solid rgba(109, 145, 238, 0.22);
  background:
    radial-gradient(450px 140px at 50% 100%, rgba(44, 128, 255, 0.2), transparent 65%),
    linear-gradient(180deg, rgba(8, 20, 44, 0.88), rgba(7, 15, 34, 0.96));
  padding: 0.25rem;
  box-shadow: inset 0 0 0 1px rgba(130, 161, 242, 0.08);
}

.due-days-wrap {
  display: grid;
  gap: 0.4rem;
  align-content: end;
}

.due-days-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.due-day-btn {
  padding: 0.38rem 0.55rem;
  font-size: 0.76rem;
}

.due-day-btn.active {
  border-color: rgba(106, 221, 179, 0.65);
  color: #cbffee;
  background: rgba(21, 110, 79, 0.42);
}

.due-custom-input {
  width: 98px;
}

.owners-window-body {
  padding: 0.85rem;
}

.owners-window-shell {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  gap: 0.8rem;
}

.owners-window-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.owners-window-head h1 {
  margin: 0;
}

.owners-window-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.owners-window-filters {
  display: grid;
  grid-template-columns: 1fr 280px auto;
  gap: 0.55rem;
  align-items: end;
}

.owners-window-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 0.75rem;
}

.owner-window-card {
  display: grid;
  gap: 0.55rem;
}

.owner-window-title {
  font-size: 1rem;
  font-weight: 700;
}

.owner-window-meta {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.owner-window-contact {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.owner-window-buttons {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.owner-action-link {
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.45rem 0.62rem;
  font-weight: 600;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.owner-action-link.primary {
  background: linear-gradient(90deg, var(--accent) 0%, #6b76ff 40%, var(--accent-2) 100%);
  color: #fff;
}

.owner-action-link.secondary {
  background: rgba(42, 66, 120, 0.6);
  border-color: rgba(140, 165, 255, 0.32);
  color: var(--text);
}

.owner-action-link.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  text-decoration: none;
  border: 1px solid rgba(114, 155, 255, 0.4);
  padding: 0.25rem 0.46rem;
  border-radius: 999px;
  background: rgba(38, 58, 103, 0.5);
}

.patients-refresh-meta {
  align-self: end;
}

.detail-frame-panel {
  padding: 0.55rem;
}

.detail-frame {
  width: 100%;
  min-height: 960px;
  border: 0;
  border-radius: 18px;
  display: block;
  overflow: hidden;
  background:
    radial-gradient(500px 180px at 50% 100%, rgba(49, 127, 255, 0.16), transparent 65%),
    linear-gradient(180deg, rgba(9, 19, 41, 0.96), rgba(7, 15, 34, 0.98));
}

.patient-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 10, 24, 0.74);
  backdrop-filter: blur(10px);
}

.patient-modal-shell {
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(126, 154, 228, 0.24);
  background:
    radial-gradient(700px 180px at 0% -10%, rgba(98, 138, 255, 0.12), transparent 58%),
    linear-gradient(180deg, rgba(20, 35, 67, 0.96) 0%, rgba(13, 24, 51, 0.98) 100%);
  box-shadow: 0 28px 90px rgba(2, 8, 28, 0.6);
}

.admin-form-modal-shell {
  display: flex;
  flex-direction: column;
}

.admin-form-modal-body {
  padding: 1rem;
  overflow: auto;
}

.admin-modal-form {
  gap: 0.75rem;
}

.admin-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.15rem;
}

.admin-collapsible-panel.is-collapsed .panel-head {
  margin-bottom: 0;
}

.admin-collapsible-body {
  margin-top: 0.2rem;
}

.owner-event-category-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(127, 160, 255, 0.28);
  background: rgba(42, 66, 120, 0.5);
  color: #dce6ff;
  font-size: 0.72rem;
  font-weight: 600;
}

.owner-event-ugyfelkeres {
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(37, 99, 235, 0.22);
  color: #dbeafe;
}

.owner-event-szamlazas {
  border-color: rgba(250, 204, 21, 0.42);
  background: rgba(161, 98, 7, 0.28);
  color: #fef3c7;
}

.owner-event-technikai_problema {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(153, 27, 27, 0.28);
  color: #fee2e2;
}

.owner-event-sales {
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(6, 95, 70, 0.3);
  color: #d1fae5;
}

.owner-event-egyeb {
  border-color: rgba(167, 139, 250, 0.42);
  background: rgba(91, 33, 182, 0.24);
  color: #ede9fe;
}

.patient-modal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(126, 154, 228, 0.18);
}

.patient-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #eef5ff;
}

.patient-modal-close-btn {
  white-space: nowrap;
}

.patient-modal-frame {
  width: 100%;
  border: 0;
  display: block;
  background: transparent;
}

body.patient-modal-open {
  overflow: hidden;
}

@media (max-width: 1260px) {
  .owner-layout {
    grid-template-columns: 1fr;
  }

  .owner-list {
    max-height: 300px;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .platform-shell {
    grid-template-columns: 1fr;
    padding: 0.55rem;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .content {
    padding: 0.85rem;
  }

  .topbar {
    padding: 0.95rem;
  }

  .topbar-title {
    font-size: clamp(1.7rem, 8vw, 2.4rem);
  }

  .two-col,
  .three-col,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .owners-filter-grid {
    grid-template-columns: 1fr;
  }

  .patients-filter-grid {
    grid-template-columns: 1fr;
  }

  .owners-window-filters {
    grid-template-columns: 1fr;
  }

  .activity-inline {
    width: 100%;
    justify-content: space-between;
  }

  .detail-frame {
    min-height: 720px;
  }

  .patient-modal-overlay {
    padding: 12px;
  }

  .patient-modal-shell {
    width: min(100vw - 24px, 1120px);
    max-height: calc(100vh - 24px);
  }

  .patient-modal-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
