:root {
    --bg-top: #eef3ef;
    --bg-bottom: #d9e4dc;
    --panel: rgba(250, 252, 251, 0.92);
    --panel-strong: #ffffff;
    --ink: #18221e;
    --muted: #68766f;
    --line: rgba(60, 92, 79, 0.16);
    --accent: #1d7a59;
    --accent-deep: #0f5a40;
    --accent-soft: rgba(29, 122, 89, 0.14);
    --good: #217351;
    --good-soft: rgba(33, 115, 81, 0.12);
    --bad: #a34236;
    --bad-soft: rgba(163, 66, 54, 0.12);
    --shadow: 0 24px 60px rgba(36, 63, 53, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    background:
        radial-gradient(circle at top left, rgba(29, 122, 89, 0.18), transparent 24%),
        radial-gradient(circle at top right, rgba(19, 71, 52, 0.14), transparent 18%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    min-height: 100vh;
}

.page-shell {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.admin-shell {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 18px;
    padding: 24px 20px;
    border-radius: 30px;
    background:
        linear-gradient(180deg, rgba(20, 48, 40, 0.98), rgba(34, 66, 56, 0.94)),
        radial-gradient(circle at top right, rgba(94, 176, 136, 0.26), transparent 32%);
    color: #edf5f1;
    box-shadow: 0 28px 70px rgba(19, 41, 34, 0.28);
}

.sidebar-brand h1 {
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.02;
    margin-bottom: 12px;
    max-width: 12ch;
}

.admin-sidebar .eyebrow,
.admin-sidebar .section-label {
    color: rgba(184, 232, 210, 0.82);
}

.admin-sidebar .subtle,
.admin-sidebar .sidebar-status span,
.admin-sidebar .sidebar-status small {
    color: rgba(231, 242, 237, 0.72);
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.sidebar-group {
    display: grid;
    gap: 8px;
}

.sidebar-group-title {
    margin: 0 0 2px;
    padding: 0 4px;
    color: rgba(231, 242, 237, 0.58);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-weight: 700;
}

.sidebar-link {
    display: block;
    padding: 13px 15px;
    border-radius: 16px;
    color: #f3f8f5;
    text-decoration: none;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    transform: translateX(2px);
    background: rgba(110, 202, 162, 0.18);
    border-color: rgba(169, 231, 205, 0.26);
}

.sidebar-status {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-status span,
.sidebar-status strong,
.sidebar-status small {
    display: block;
}

.sidebar-status strong {
    margin: 8px 0 6px;
    font-size: 1.18rem;
    color: #ffffff;
}

.admin-main {
    min-width: 0;
}

.dashboard-stage {
    padding: 18px;
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 28px 80px rgba(77, 106, 94, 0.14);
}

.dashboard-panels {
    min-height: 760px;
}

.content-panel {
    display: none;
}

.content-panel.is-active {
    display: block;
}

.dashboard-primary {
    min-width: 0;
}

.stage-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
    padding: 14px 12px 18px;
}

.stage-copy h2 {
    font-size: clamp(2rem, 3.8vw, 3.1rem);
    line-height: 0.98;
    margin-bottom: 8px;
}

.stage-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.toolbar-pill {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: #f3f7f4;
    color: var(--accent-deep);
    border: 1px solid rgba(29, 122, 89, 0.1);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-weight: 700;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 280px;
    gap: 18px;
    align-items: start;
}

.modem-layout-single {
    margin-top: 6px;
}

.modem-list-page .modem-list {
    position: static;
}

.detail-page-shell {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
}

.detail-backbar {
    margin-bottom: 18px;
}

.workspace-main {
    min-width: 0;
}

.workspace-rail {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 24px;
}

.rail-card {
    padding: 22px 20px;
    border-radius: 26px;
    border: 1px solid var(--line);
    background: rgba(250, 252, 251, 0.95);
    box-shadow: var(--shadow);
}

.profile-card {
    text-align: center;
}

.profile-avatar {
    width: 76px;
    height: 76px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.9rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent) 0%, #86b7a2 100%);
}

.profile-card h3 {
    margin-bottom: 4px;
    font-size: 1.32rem;
}

.profile-card p {
    margin: 0;
    color: var(--muted);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.profile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.rail-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--accent-deep);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-weight: 700;
    background: #f4f8f5;
    border: 1px solid rgba(29, 122, 89, 0.1);
}

.rail-card-head {
    margin-bottom: 12px;
}

.activity-list {
    display: grid;
    gap: 12px;
}

.activity-item {
    display: grid;
    gap: 4px;
    padding: 14px 14px;
    border-radius: 18px;
    background: #f8fbf9;
    border: 1px solid rgba(29, 122, 89, 0.08);
}

.activity-item strong {
    font-size: 0.98rem;
}

.activity-item span,
.activity-item small {
    color: var(--muted);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    line-height: 1.45;
}

.activity-item.highlight {
    background: linear-gradient(180deg, rgba(225, 242, 234, 0.88), rgba(247, 251, 249, 0.95));
}

.sidebar-status-soft {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-footer {
    display: grid;
    gap: 10px;
}

.sidebar-ghost-link,
.sidebar-ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    width: 100%;
    padding: 0 14px;
    border-radius: 16px;
    text-decoration: none;
    color: #f3f8f5;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-ghost-button {
    cursor: pointer;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-copy {
    display: grid;
    gap: 3px;
}

.topbar-copy span {
    color: var(--muted);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-size: 0.92rem;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.flash {
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    backdrop-filter: blur(10px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.flash-success {
    color: var(--good);
    background: rgba(245, 255, 249, 0.88);
    border-color: rgba(33, 115, 81, 0.24);
}

.flash-error {
    color: var(--bad);
    background: rgba(255, 247, 245, 0.9);
    border-color: rgba(163, 66, 54, 0.24);
}

.login-shell {
    min-height: calc(100vh - 140px);
    display: grid;
    place-items: center;
}

.login-card {
    width: min(520px, 100%);
    padding: 28px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.login-title {
    margin-top: 6px;
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.login-form label {
    display: grid;
    gap: 8px;
}

.login-form span {
    color: var(--muted);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.login-form input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    font-size: 1rem;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.account-panel {
    display: grid;
    grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
    gap: 20px;
    margin-bottom: 20px;
    padding: 24px 26px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.account-panel-copy h3 {
    margin-bottom: 10px;
    font-size: 1.55rem;
}

.account-form {
    display: grid;
    gap: 14px;
}

.account-form label {
    display: grid;
    gap: 8px;
}

.account-form span {
    color: var(--muted);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.account-form input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    font-size: 1rem;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.hero,
.stats,
.account-panel,
.admin-panel,
.modem-card,
.modem-list {
    animation: fade-up 0.5s ease both;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 22px;
}

.admin-hero .hero-copy h2 {
    font-size: clamp(2rem, 3.6vw, 3.35rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
}

.hero-copy,
.db-status,
.stat-card,
.modem-list,
.modem-card {
    backdrop-filter: blur(10px);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero-copy,
.db-status,
.modem-card,
.modem-list {
    border-radius: 28px;
}

.hero-copy {
    padding: 28px;
    position: relative;
    overflow: hidden;
}

.hero-copy::after {
    content: "";
    position: absolute;
    inset: auto -12% -42% auto;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(29, 122, 89, 0.16), transparent 68%);
}

.eyebrow,
.section-label {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 700;
}

h1 {
    max-width: 760px;
    font-size: clamp(2.4rem, 4.6vw, 4.3rem);
    line-height: 0.96;
    letter-spacing: -0.03em;
}

.subtle,
.db-status span,
.db-status small,
.card-head p,
dt,
.empty-state,
.stat-card p,
.overview-card small,
.modem-link span,
.modem-link small,
.client-list-head p {
    color: var(--muted);
}

.subtle {
    max-width: 700px;
    margin: 14px 0 0;
    font-size: 1rem;
    line-height: 1.7;
}

.db-status {
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.db-status strong {
    margin-top: 8px;
    font-size: 1.2rem;
}

.db-status small {
    margin-top: 10px;
    line-height: 1.5;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 20px 22px;
    border-radius: 22px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto -26px -42px auto;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(29, 122, 89, 0.14), transparent 68%);
}

.stat-card span,
.overview-card span {
    display: block;
    margin-bottom: 8px;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--accent-deep);
}

.stat-card strong {
    display: block;
    font-size: 2.3rem;
    margin-bottom: 6px;
}

.stat-card p {
    margin: 0;
    line-height: 1.55;
    font-size: 0.95rem;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.modem-layout {
    display: grid;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.modem-list {
    padding: 18px;
    position: sticky;
    top: 24px;
}

.modem-detail-panel {
    min-width: 0;
}

.search-form {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.search-row input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    font-size: 0.98rem;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.modem-detail-panel.loading {
    opacity: 0.6;
    transition: opacity 0.18s ease;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.pagination-status {
    color: var(--muted);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-size: 0.92rem;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-heading h2 {
    margin-top: 2px;
}

.pill,
.mini-badge,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-weight: 700;
}

.pill {
    padding: 8px 12px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    white-space: nowrap;
    font-size: 0.82rem;
}

.modem-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel-strong);
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.modem-link:hover,
.modem-link.active {
    border-color: rgba(29, 122, 89, 0.38);
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(29, 90, 67, 0.12);
}

.modem-link-copy strong,
.modem-link-copy span,
.modem-link-copy small,
.modem-link-meta small {
    display: block;
}

.modem-link-copy strong {
    margin-bottom: 4px;
}

.modem-link-copy small,
.modem-link-meta {
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.modem-link-meta {
    text-align: right;
}

.mini-badge,
.badge {
    padding: 8px 12px;
    font-size: 0.76rem;
}

.mini-badge.online,
.badge.online {
    color: var(--good);
    background: var(--good-soft);
}

.mini-badge.offline,
.badge.offline {
    color: var(--bad);
    background: var(--bad-soft);
}

.mini-badge {
    margin-bottom: 8px;
}

.modem-card {
    padding: 24px;
    min-width: 0;
    overflow: hidden;
}

.support-note {
    margin: 0 0 18px;
    padding: 8px 0 14px;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    line-height: 1.5;
}

.support-note.supported {
    background: transparent;
    color: var(--good);
    border-color: rgba(33, 115, 81, 0.18);
}

.support-note.unsupported {
    background: transparent;
    color: var(--bad);
    border-color: rgba(163, 66, 54, 0.18);
}

.support-note.queued {
    background: transparent;
    color: var(--accent-deep);
    border-color: rgba(29, 122, 89, 0.18);
}

.support-note.success {
    background: transparent;
    color: var(--good);
    border-color: rgba(33, 115, 81, 0.18);
}

.support-note.failed {
    background: transparent;
    color: var(--bad);
    border-color: rgba(163, 66, 54, 0.18);
}

.card-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.card-head h2 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    margin-bottom: 6px;
}

.card-head p {
    margin: 0;
    word-break: break-word;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.modem-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.modem-overview-text {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.overview-line {
    min-width: 0;
}

.overview-line span {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.overview-line strong {
    display: block;
    font-size: 1.02rem;
    line-height: 1.45;
    font-weight: 700;
    word-break: break-word;
}

.overview-card {
    padding: 16px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 249, 240, 0.95));
}

.overview-card.emphasis {
    background: linear-gradient(180deg, rgba(245, 210, 178, 0.46), rgba(255, 251, 246, 0.96));
}

.overview-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.2rem;
    line-height: 1.25;
    word-break: break-word;
}

.overview-card small {
    display: block;
    line-height: 1.45;
    font-size: 0.88rem;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.details {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 0;
    margin: 0 0 22px;
}

.details-text {
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    gap: 10px 18px;
    align-items: start;
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
}

.details-text dt,
.details-text dd {
    padding: 0;
    margin: 0;
}

.details div {
    padding: 15px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--panel-strong);
}

.action-panel {
    margin: 0 0 22px;
    padding: 18px 0;
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: transparent;
}

.admin-panel {
    margin-bottom: 20px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
    box-shadow: var(--shadow);
}

.admin-grid {
    margin-top: 12px;
}

.modem-client-admin {
    margin-top: 22px;
}

.modem-client-create {
    margin-bottom: 18px;
}

.modem-client-users {
    display: grid;
    gap: 14px;
}

.modem-client-user-row {
    display: grid;
    gap: 12px;
    padding: 14px 0 10px;
    border-top: 1px solid var(--line);
}

.modem-client-user-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.modem-client-user-actions,
.modem-client-delete-form {
    display: flex;
    justify-content: flex-end;
}

.action-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: start;
    margin-bottom: 14px;
}

.command-note small {
    font-size: 0.82rem;
}

.pending-grid,
.action-grid {
    display: grid;
    gap: 14px;
}

.pending-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 14px;
}

.pending-grid-text {
    grid-template-columns: 1fr;
}

.pending-grid div {
    padding: 0 0 10px;
    border-radius: 0;
    border: 0;
    background: transparent;
    border-bottom: 1px dashed rgba(60, 92, 79, 0.18);
}

.pending-grid span,
.action-form label span,
.action-copy {
    display: block;
    color: var(--muted);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    line-height: 1.5;
}

.pending-grid strong {
    display: block;
    margin-top: 6px;
    word-break: break-word;
}

.action-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.7fr);
    align-items: start;
}

.action-form {
    display: grid;
    gap: 14px;
}

.action-form label {
    display: grid;
    gap: 8px;
}

.action-form input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    font-size: 1rem;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.action-form select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    font-size: 1rem;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.checkbox-row {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-button {
    color: #fffaf6;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    box-shadow: 0 12px 24px rgba(15, 90, 64, 0.22);
}

.secondary-button {
    color: var(--accent-deep);
    background: rgba(29, 122, 89, 0.1);
    border: 1px solid rgba(29, 122, 89, 0.18);
}

.secondary-link {
    text-decoration: none;
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-1px);
}

.action-form-compact {
    padding: 0;
    border-radius: 0;
    border: 0;
    background: transparent;
}

.status-queued {
    color: var(--accent-deep);
    background: rgba(29, 122, 89, 0.12);
}

.status-success {
    color: var(--good);
    background: var(--good-soft);
}

.status-failed {
    color: var(--bad);
    background: var(--bad-soft);
}

dt {
    margin-bottom: 8px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

dd {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
    word-break: break-word;
}

.client-list {
    padding: 18px 0 0;
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    overflow-x: auto;
}

.client-list-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 14px;
    margin-bottom: 14px;
}

.client-list-head h3 {
    margin-top: 4px;
    font-size: 1.35rem;
}

.client-list-head p {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 18px;
    background: var(--panel-strong);
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 0.95rem;
}

th {
    background: rgba(220, 235, 227, 0.72);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent-deep);
}

tbody tr:hover {
    background: rgba(224, 239, 232, 0.6);
}

tr:last-child td {
    border-bottom: none;
}

.empty-state {
    margin: 0;
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: rgba(249, 252, 250, 0.88);
    line-height: 1.6;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .admin-shell,
    .hero,
    .account-panel,
    .modem-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar,
    .modem-list,
    .workspace-rail {
        position: static;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .modem-overview,
    .details,
    .pending-grid,
    .action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .details-text {
        grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
    }

    .modem-client-user-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100%, calc(100% - 24px));
        padding-top: 20px;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .stage-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stage-toolbar {
        justify-content: flex-start;
    }

    .stats,
    .modem-overview,
    .details,
    .pending-grid,
    .action-grid {
        grid-template-columns: 1fr;
    }

    .details-text {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .admin-sidebar,
    .hero-copy,
    .db-status,
    .dashboard-stage,
    .account-panel,
    .admin-panel,
    .modem-card,
    .modem-list {
        padding-left: 18px;
        padding-right: 18px;
    }

    .profile-actions {
        grid-template-columns: 1fr;
    }

    .modem-client-user-fields {
        grid-template-columns: 1fr;
    }

    .modem-client-user-actions,
    .modem-client-delete-form {
        justify-content: flex-start;
    }

    .card-head,
    .client-list-head,
    .panel-heading,
    .action-panel-head {
        flex-direction: column;
        align-items: start;
    }

    .modem-link {
        grid-template-columns: 1fr;
    }

    .modem-link-meta {
        text-align: left;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    tbody tr {
        border: 1px solid var(--line);
        border-radius: 16px;
        margin-bottom: 12px;
        overflow: hidden;
        background: var(--panel-strong);
    }

    td {
        border-bottom: 1px solid var(--line);
        padding: 10px 14px;
    }

    td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        color: var(--accent-deep);
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    }
}
body {
    font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
    background: #f4f6f9;
}

.content-wrapper {
    background: #f4f6f9;
}

.nav-app-label {
    font-weight: 600;
    color: #343a40;
}

.nav-user-summary .nav-link {
    color: #6c757d;
}

.flash-toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: min(420px, calc(100vw - 2rem));
    z-index: 1080;
}

.acs-login-page {
    background:
        linear-gradient(135deg, rgba(52, 58, 64, 0.88), rgba(0, 123, 255, 0.72)),
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 35%),
        #1f2d3d;
}

.login-box .login-logo a {
    color: #fff;
}

.login-box .card {
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.22);
}

.acs-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #17a2b8, #007bff);
    color: #fff;
    font-weight: 700;
}

.sidebar-meta {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logout {
    margin-top: 1rem;
}

.acs-summary-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-height: 100%;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 0.35rem 1rem rgba(31, 45, 61, 0.06);
}

.acs-summary-chip span {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
}

.acs-summary-chip small {
    color: #6c757d;
}

.dashboard-panels .content-panel {
    display: none;
}

.dashboard-panels .content-panel.is-active {
    display: block;
}

.small-box .icon {
    opacity: 0.25;
}

.modem-list-page {
    margin-top: 1.25rem;
}

.modem-list-group .list-group-item {
    border-radius: 0.65rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.modem-link-copy strong {
    display: block;
    margin-bottom: 0.2rem;
}

.app-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.pagination-status {
    color: #6c757d;
}

.account-form {
    max-width: 560px;
}

@media (max-width: 767.98px) {
    .flash-toast-stack {
        left: 1rem;
        right: 1rem;
        width: auto;
    }

    .acs-summary-chip {
        margin-top: 1rem;
        align-items: flex-start;
    }

    .app-pagination {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Modern modem detail page */
.modem-detail-wrapper .content-header h1 {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modem-detail-wrapper .content-header p {
    margin-top: 0.35rem;
    max-width: 740px;
}

.modem-detail-wrapper .content {
    padding-top: 0.4rem;
}

.desktop-only-warning {
    display: none;
    padding: 1rem;
}

.desktop-only-warning-card {
    width: min(560px, 100%);
    margin: 0 auto;
    border-radius: 0.9rem;
    border: 1px solid rgba(31, 45, 61, 0.14);
    background: #ffffff;
    box-shadow: 0 0.75rem 1.8rem rgba(31, 45, 61, 0.08);
    padding: 1.15rem 1.1rem;
}

.desktop-only-warning-card .desktop-only-label {
    margin: 0 0 0.35rem;
    color: #2f5f8b;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.desktop-only-warning-card h2 {
    margin: 0 0 0.55rem;
    font-size: 1.05rem;
    color: #1f2d3d;
}

.desktop-only-warning-card p {
    margin: 0 0 0.75rem;
    color: #516173;
    line-height: 1.45;
}

.desktop-only-warning-card .btn {
    min-width: 180px;
}

.detail-page-shell {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 1.5rem;
    overflow-x: hidden;
}

body.page-modem-detail {
    overflow-x: hidden;
}

body.page-modem-detail .modem-detail-wrapper .row > [class*="col-"] {
    min-width: 0;
}

body.page-modem-detail .modem-detail-wrapper main {
    min-width: 0;
    overflow-x: hidden;
}

.modem-modern {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    animation: none;
    display: grid;
    gap: 1rem;
}

.modem-modern .modem-section-card {
    position: relative;
    border-radius: 1rem;
    border: 1px solid rgba(31, 45, 61, 0.2);
    background: #ffffff;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.82),
        0 0.85rem 1.9rem rgba(31, 45, 61, 0.09);
    padding: 1rem 1.1rem;
}

.modem-modern .modem-section-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(17, 35, 58, 0.06);
}

.modem-modern .modem-hero {
    border: 0;
    padding: 1.2rem;
    color: #eff7ff;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 18%, rgba(56, 189, 248, 0.35), transparent 42%),
        radial-gradient(circle at 12% 90%, rgba(6, 182, 212, 0.22), transparent 38%),
        linear-gradient(140deg, #0b2742 0%, #184a70 58%, #1f5d82 100%);
}

.modem-modern .modem-hero::after {
    content: "";
    position: absolute;
    inset: auto -58px -68px auto;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
    pointer-events: none;
}

.modem-modern .modem-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.modem-modern .modem-hero-title .section-label {
    color: rgba(226, 242, 255, 0.82);
    margin-bottom: 0.55rem;
}

.modem-modern .modem-hero-title h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    line-height: 1.1;
    color: #ffffff;
}

.modem-modern .modem-serial {
    margin: 0.5rem 0 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: rgba(236, 247, 255, 0.92);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.modem-modern .modem-hero-status {
    display: grid;
    gap: 0.45rem;
    justify-items: end;
    text-align: right;
}

.modem-modern .modem-hero-status .badge {
    font-size: 0.74rem;
    padding: 0.5rem 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.modem-modern .modem-hero-status small {
    color: rgba(224, 239, 252, 0.9);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.modem-modern .modem-hero-meta {
    margin-top: 1rem;
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.modem-modern .modem-meta-card {
    padding: 0.7rem 0.75rem;
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.18);
    min-width: 0;
}

.modem-modern .modem-meta-card span,
.modem-modern .modem-meta-card strong,
.modem-modern .modem-meta-card small {
    display: block;
}

.modem-modern .modem-meta-card span {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.69rem;
    color: rgba(224, 241, 255, 0.84);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.modem-modern .modem-meta-card strong {
    margin: 0.35rem 0;
    font-size: 1.08rem;
    line-height: 1.3;
    color: #ffffff;
    word-break: break-word;
}

.modem-modern .modem-meta-card small {
    color: rgba(224, 241, 255, 0.82);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    line-height: 1.42;
}

.modem-modern .support-note.modem-section-card {
    margin: 0;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(31, 45, 61, 0.12);
    background: #ffffff;
    font-size: 0.95rem;
}

.modem-modern .support-note.supported {
    color: #17865f;
    border-color: rgba(23, 134, 95, 0.22);
    background: rgba(23, 134, 95, 0.06);
}

.modem-modern .support-note.unsupported {
    color: #b54738;
    border-color: rgba(181, 71, 56, 0.22);
    background: rgba(181, 71, 56, 0.06);
}

.modem-modern .support-note.queued {
    color: #0f5375;
    border-color: rgba(15, 83, 117, 0.2);
    background: rgba(15, 83, 117, 0.06);
}

.modem-modern .support-note.success {
    color: #17865f;
    border-color: rgba(23, 134, 95, 0.22);
    background: rgba(23, 134, 95, 0.06);
}

.modem-modern .support-note.failed {
    color: #b54738;
    border-color: rgba(181, 71, 56, 0.22);
    background: rgba(181, 71, 56, 0.06);
}

.modem-modern .command-note {
    margin: 0 0 0.9rem;
    padding: 0.72rem 0.78rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(31, 45, 61, 0.12);
    line-height: 1.45;
}

.modem-modern .modem-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.modem-modern .modem-card-grid > .modem-section-card {
    min-width: 0;
}

.modem-modern .modem-section-head {
    margin-bottom: 0.8rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(31, 45, 61, 0.11);
}

.modem-modern .modem-section-head h3 {
    font-size: 1.15rem;
    margin: 0.2rem 0 0;
}

.modem-modern .modem-overview-modern {
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modem-modern .modem-overview-modern .overview-line {
    padding: 0.72rem 0.78rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(31, 45, 61, 0.09);
    background: #f7fafc;
}

.modem-modern .modem-overview-modern .overview-line span {
    color: #6c7a89;
}

.modem-modern .modem-overview-modern .overview-line strong {
    margin-top: 0.25rem;
    color: #1f2d3d;
}

.modem-modern .ssid-list-panel {
    margin-top: 0.85rem;
    padding-top: 0.9rem;
    border-top: 1px dashed rgba(31, 45, 61, 0.16);
}

.modem-modern .ssid-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(31, 45, 61, 0.11);
}

.modem-modern .ssid-list-manage {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.modem-modern .ssid-list-head h4 {
    margin: 0;
    font-size: 0.98rem;
    color: #1f2d3d;
}

.modem-modern .ssid-list-head span {
    font-size: 0.76rem;
    color: #6c7a89;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.modem-modern .ssid-list-table-wrap {
    width: 100%;
    min-width: 0;
    border: 0;
    border-radius: 0;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    background: transparent;
}

.modem-modern .ssid-list-table {
    width: max-content;
    min-width: max(100%, 760px);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0;
    background: #ffffff;
}

.modem-modern .ssid-list-table th {
    background: #eef4fa;
    color: #2f5f8b;
    border-bottom: 1px solid rgba(31, 45, 61, 0.12);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.56rem 0.62rem;
}

.modem-modern .ssid-list-table td {
    border-bottom: 1px solid rgba(31, 45, 61, 0.08);
    background: #ffffff;
    vertical-align: top;
    font-size: 0.86rem;
    line-height: 1.35;
    white-space: nowrap;
    padding: 0.54rem 0.62rem;
}

.modem-modern .ssid-list-table td strong {
    display: block;
    color: #1f2d3d;
    word-break: break-word;
}

.modem-modern .ssid-list-table td.ssid-security-cell,
.modem-modern .ssid-list-table td.ssid-password-cell {
    min-width: 220px;
    white-space: normal;
}

.modem-modern .ssid-list-table td.ssid-security-cell {
    min-width: 260px;
    max-width: 320px;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.modem-modern .ssid-list-table td.ssid-password-cell {
    min-width: 200px;
    max-width: 260px;
}

.modem-modern .ssid-list-table th:nth-child(6),
.modem-modern .ssid-list-table td[data-label="Power %"] {
    min-width: 108px;
}

.modem-modern .ssid-security-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem 0.32rem;
}

.modem-modern .ssid-security-tags span {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.36rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(47, 95, 139, 0.2);
    background: rgba(47, 95, 139, 0.06);
    color: #2f5f8b;
    font-size: 0.68rem;
    line-height: 1.35;
}

.modem-modern .ssid-list-table td small {
    display: block;
    margin-top: 0.18rem;
    font-size: 0.72rem;
    color: #6c7a89;
    word-break: break-word;
    white-space: normal;
}

.modem-modern .ssid-list-table tbody tr:hover td {
    background: #f7fbff;
}

.modem-modern .ssid-list-table tbody tr.ssid-row-pending td {
    background: rgba(255, 244, 224, 0.64);
}

.modem-modern .ssid-row-forms {
    display: none;
}

.modem-modern .ssid-edit-input,
.modem-modern .ssid-edit-select {
    width: 100%;
    min-width: 96px;
    height: 34px;
    border-radius: 0.55rem;
    border: 1px solid rgba(31, 45, 61, 0.2);
    background: #ffffff;
    color: #1f2d3d;
    font-size: 0.82rem;
    padding: 0.35rem 0.48rem;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.modem-modern .ssid-edit-input:focus,
.modem-modern .ssid-edit-select:focus {
    outline: 0;
    border-color: rgba(0, 123, 255, 0.42);
    box-shadow: 0 0 0 0.12rem rgba(0, 123, 255, 0.12);
}

.modem-modern .ssid-edit-short {
    min-width: 72px;
}

.modem-modern .ssid-field-note {
    display: block;
    margin-top: 0.22rem;
    color: #6c7a89;
    font-size: 0.69rem;
    white-space: normal;
}

.modem-modern .ssid-password-current {
    display: inline-block;
    margin-bottom: 0.3rem;
    padding: 0.1rem 0.42rem;
    border-radius: 0.42rem;
    background: #f1f5f9;
    border: 1px solid rgba(31, 45, 61, 0.12);
    color: #1f2d3d;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.01em;
    max-width: 100%;
    word-break: break-all;
}

.modem-modern .ssid-update-button {
    min-height: 34px;
    padding: 0 0.8rem;
    font-size: 0.8rem;
}

.modem-modern .wifi-connected-table {
    min-width: 680px;
    width: 100%;
    table-layout: fixed;
}

.modem-modern .wifi-connected-table th,
.modem-modern .wifi-connected-table td {
    white-space: normal;
    word-break: break-word;
}

.modem-modern .wifi-connected-table td:nth-child(3) {
    word-break: break-all;
    font-family: "Consolas", "Menlo", "Monaco", monospace;
    font-size: 0.81rem;
}

.modem-modern .connected-list-panel {
    margin-top: 0.8rem;
    margin-bottom: 0.6rem;
}

.modem-modern .ssid-list-empty {
    margin: 0;
    padding: 0.72rem 0.78rem;
    border-radius: 0.75rem;
    border: 1px dashed rgba(31, 45, 61, 0.2);
}

.modem-modern .modem-details-modern {
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.modem-modern .modem-details-modern .detail-cell {
    border: 1px solid rgba(31, 45, 61, 0.09);
    border-radius: 0.8rem;
    background: #f9fbfd;
    padding: 0.72rem 0.78rem;
}

.modem-modern .modem-details-modern .detail-cell-wide {
    grid-column: 1 / -1;
}

.modem-modern .modem-details-modern dt,
.modem-modern .modem-details-modern dd {
    margin: 0;
    padding: 0;
}

.modem-modern .modem-details-modern dt {
    font-size: 0.7rem;
    color: #6c7a89;
    margin-bottom: 0.3rem;
}

.modem-modern .modem-details-modern dd {
    color: #1f2d3d;
    font-size: 0.96rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.modem-modern .modem-details-modern .detail-cell-wide dd {
    font-size: 0.9rem;
}

.modem-modern .action-panel {
    margin: 0;
    border-top: 0;
    border-bottom: 0;
    padding: 1rem 1.1rem;
}

.modem-modern .mini-badge {
    margin-bottom: 0;
    font-size: 0.74rem;
}

.modem-modern .pending-grid {
    margin-bottom: 0.9rem;
    gap: 0.55rem;
}

.modem-modern .pending-grid div {
    padding: 0.68rem 0.74rem;
    border: 1px dashed rgba(31, 45, 61, 0.2);
    border-radius: 0.75rem;
    background: #f7fafc;
}

.modem-modern .action-grid {
    grid-template-columns: 1fr;
    align-items: start;
}

.modem-modern .action-grid > .action-form {
    min-width: 0;
}

.modem-modern .action-form {
    padding: 0.9rem;
    border: 1px solid rgba(31, 45, 61, 0.1);
    border-radius: 0.9rem;
    background: #fbfdff;
}

.modem-modern .action-form-compact {
    justify-content: space-between;
    align-content: start;
}

.modem-modern .action-form input[type="text"],
.modem-modern .action-form select {
    border-color: rgba(31, 45, 61, 0.16);
    background: #ffffff;
}

.modem-modern .action-form input[type="text"]:focus,
.modem-modern .action-form select:focus {
    outline: 0;
    border-color: rgba(0, 123, 255, 0.42);
    box-shadow: 0 0 0 0.16rem rgba(0, 123, 255, 0.16);
}

.modem-modern .primary-button {
    min-height: 44px;
}

.modem-modern .secondary-button {
    min-height: 42px;
}

.modem-modern .status-idle {
    color: #56687a;
    background: #eef2f6;
}

.modem-modern .status-sending {
    color: #0f5375;
    background: rgba(15, 83, 117, 0.12);
}

.modem-modern .client-list {
    margin: 0;
    padding: 1rem 1.1rem;
    border-top: 0;
}

.modem-modern .client-list table {
    min-width: 100%;
    border-radius: 0.8rem;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}

.modem-modern .client-list th {
    background: #eef4fa;
    color: #2f5f8b;
    border-bottom: 1px solid rgba(31, 45, 61, 0.12);
}

.modem-modern .client-list td {
    border-bottom: 1px solid rgba(31, 45, 61, 0.08);
    vertical-align: middle;
}

.modem-modern .client-list tbody tr:hover {
    background: #f7fbff;
}

.modem-modern .admin-panel {
    margin: 0;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(31, 45, 61, 0.1);
    background: #ffffff;
    box-shadow: 0 0.75rem 1.8rem rgba(31, 45, 61, 0.06);
}

.modem-modern .modem-client-user-card {
    border: 1px solid rgba(31, 45, 61, 0.1);
    border-radius: 0.9rem;
    background: #f9fbfd;
    padding: 0.8rem;
}

.modem-modern .modem-client-user-row {
    border-top: 0;
    padding: 0;
}

.modem-modern .modem-client-delete-form {
    margin-top: 0.55rem;
}

@media (max-width: 991.98px) {
    .modem-modern .modem-hero-meta,
    .modem-modern .modem-card-grid,
    .modem-modern .modem-overview-modern,
    .modem-modern .modem-details-modern,
    .modem-modern .action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modem-modern .modem-hero-status {
        justify-items: start;
        text-align: left;
    }
}

@media (max-width: 767.98px) {
    .modem-detail-wrapper .content-header {
        padding-top: 0.9rem;
    }

    .modem-modern .modem-section-card,
    .modem-modern .action-panel,
    .modem-modern .client-list,
    .modem-modern .admin-panel {
        padding: 0.85rem;
    }

    .modem-modern .modem-hero-top,
    .modem-modern .action-panel-head,
    .modem-modern .client-list-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .modem-modern .modem-hero-meta,
    .modem-modern .modem-card-grid,
    .modem-modern .modem-overview-modern,
    .modem-modern .modem-details-modern,
    .modem-modern .action-grid,
    .modem-modern .modem-client-user-fields {
        grid-template-columns: 1fr;
    }

    .modem-modern .modem-client-user-actions,
    .modem-modern .modem-client-delete-form {
        justify-content: flex-start;
    }

    .modem-modern .ssid-list-table {
        min-width: 980px;
    }

    .modem-modern .wifi-connected-table {
        min-width: 720px;
        table-layout: auto;
    }
}

@media (max-width: 991.98px) {
    body.page-modem-detail .modem-detail-wrapper .detail-page-shell,
    body.page-modem-detail .modem-detail-wrapper .modem-detail-intro {
        display: none;
    }

    body.page-modem-detail .desktop-only-warning {
        display: block;
    }

    body.page-modem-detail .modem-detail-wrapper {
        padding-top: 0.5rem;
    }
}

/* Bootstrap-only shell */
.bootstrap-app {
    background: #f3f5f9;
    min-height: 100vh;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1040;
}

.app-sidebar-card {
    position: sticky;
    top: 0.9rem;
}

.app-menu .list-group-item {
    border: 0;
    border-radius: 0.65rem !important;
    margin-bottom: 0.28rem;
    color: #344054;
    font-weight: 500;
}

.app-menu .list-group-item:hover {
    background: #eef4ff;
    color: #103d73;
}

.app-menu .list-group-item.active {
    background: #0d6efd;
    color: #ffffff;
}

.inventory-shell {
    border: 1px solid rgba(31, 45, 61, 0.12);
    border-radius: 1rem;
    padding: 1rem;
    background: #ffffff;
}

.stat-tile {
    border-radius: 0.95rem;
}

.stat-tile-icon {
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #10427a;
    background: rgba(13, 110, 253, 0.12);
}

.stat-tile-success .stat-tile-icon {
    color: #0f5132;
    background: rgba(25, 135, 84, 0.15);
}

.stat-tile-warning .stat-tile-icon {
    color: #7a4b00;
    background: rgba(255, 193, 7, 0.22);
}

.login-bootstrap-card {
    width: min(480px, 100%);
    border-radius: 1.1rem;
}

.page-dashboard .dashboard-panels .content-panel {
    display: none;
}

.page-dashboard .dashboard-panels .content-panel.is-active {
    display: block;
}

.page-modem-detail .modem-detail-wrapper .desktop-only-warning {
    display: none;
}

/* Bootstrap safeguard: cegah bentrok style global lama */
.bootstrap-app .container-fluid,
.bootstrap-app .row,
.bootstrap-app [class^="col-"],
.bootstrap-app [class*=" col-"],
.bootstrap-app .card,
.bootstrap-app .card-body {
    min-width: 0;
}

.bootstrap-app table {
    min-width: 0;
    border-radius: 0;
    overflow: visible;
}

.bootstrap-app .modem-modern.modem-card {
    overflow: visible;
}

.bootstrap-app .modem-modern .modem-section-card,
.bootstrap-app .modem-modern .action-form,
.bootstrap-app .modem-modern .modem-overview-modern .overview-line,
.bootstrap-app .modem-modern .modem-details-modern .detail-cell {
    min-width: 0;
}

.bootstrap-app .modem-modern .modem-overview-modern .overview-line strong,
.bootstrap-app .modem-modern .modem-details-modern dd,
.bootstrap-app .modem-modern .support-note,
.bootstrap-app .modem-modern .action-copy {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Detail modem layout fit: force inner content to follow available column width */
body.page-modem-detail .modem-detail-wrapper,
body.page-modem-detail .modem-detail-wrapper .detail-page-shell,
body.page-modem-detail .modem-detail-wrapper .modem-modern,
body.page-modem-detail .modem-detail-wrapper .modem-modern > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

body.page-modem-detail .modem-detail-wrapper .modem-modern .modem-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

body.page-modem-detail .modem-detail-wrapper .modem-modern .modem-overview-modern,
body.page-modem-detail .modem-detail-wrapper .modem-modern .modem-details-modern {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body.page-modem-detail .modem-detail-wrapper .modem-modern .action-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

body.page-modem-detail .modem-detail-wrapper .modem-modern .ssid-list-manage,
body.page-modem-detail .modem-detail-wrapper .modem-modern .client-list,
body.page-modem-detail .modem-detail-wrapper .modem-modern .admin-panel {
    overflow: hidden;
}

body.page-modem-detail .modem-detail-wrapper .modem-modern .ssid-list-table-wrap,
body.page-modem-detail .modem-detail-wrapper .modem-modern .table-responsive {
    width: 100%;
    max-width: 100%;
}
