:root {
    --bg: #f4f6fb;
    --panel: rgba(255, 255, 255, 0.9);
    --panel-strong: #ffffff;
    --text: #223047;
    --muted: #71809a;
    --line: rgba(34, 48, 71, 0.09);
    --accent: #f7b500;
    --blue-start: #3d8dff;
    --blue-end: #1ac4db;
    --shadow: 0 24px 60px rgba(41, 81, 132, 0.12);
}

html[data-theme="dark"] {
    --bg: #0f1725;
    --panel: rgba(20, 31, 47, 0.92);
    --panel-strong: #162235;
    --text: #eff5ff;
    --muted: #94a7c4;
    --line: rgba(165, 187, 222, 0.12);
    --accent: #ffca3a;
    --blue-start: #5a8dff;
    --blue-end: #22d3ee;
    --shadow: 0 24px 60px rgba(3, 8, 18, 0.45);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: auto;
}

body {
    margin: 0;
    min-width: 320px;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(247, 181, 0, 0.08), transparent 28%),
        linear-gradient(180deg, #f9fbff 0%, #eef2f8 100%);
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(255, 202, 58, 0.08), transparent 28%),
        linear-gradient(180deg, #0d1420 0%, #101b2a 100%);
}

button,
input,
select,
textarea {
    font: inherit;
}

.page-shell {
    display: grid;
    grid-template-columns: 304px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 34px 28px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
}

html[data-theme="dark"] .sidebar {
    background: rgba(12, 19, 31, 0.82);
}

.brand {
    margin-bottom: 40px;
    font-family: "Unbounded", sans-serif;
    font-size: 28px;
    line-height: 1.05;
}

.brand-muted {
    display: block;
    color: rgba(34, 48, 71, 0.42);
}

.brand-accent {
    color: var(--accent);
}

.user-panel {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(61, 141, 255, 0.08);
    border: 1px solid rgba(61, 141, 255, 0.12);
}

.user-panel-name {
    font-weight: 800;
}

.user-panel-role {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.side-link {
    display: block;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 18px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.side-link:hover,
.side-link.active {
    border-color: rgba(61, 141, 255, 0.18);
    background: rgba(61, 141, 255, 0.08);
}

.sidebar-note {
    margin-top: 24px;
    padding: 16px;
    border-radius: 18px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow);
    font-size: 14px;
    line-height: 1.5;
}

.logout-form {
    margin-top: 16px;
}

.logout-button {
    width: 100%;
    padding: 14px 16px;
    background: rgba(34, 48, 71, 0.06);
    color: var(--text);
    font-weight: 800;
}

.theme-fab {
    position: sticky;
    top: 18px;
    z-index: 10;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(34, 48, 71, 0.08);
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.theme-toggle-label-dark {
    display: none;
}

html[data-theme="dark"] .theme-toggle-label-light {
    display: none;
}

html[data-theme="dark"] .theme-toggle-label-dark {
    display: inline;
}

.content {
    padding: 36px;
}

.panel-section-first {
    margin-top: 0;
}

.auth-page {
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 36px;
}

.auth-card {
    width: min(100%, 560px);
    padding: 36px;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.auth-brand {
    margin-bottom: 24px;
}

.auth-text {
    margin-bottom: 24px;
}

.auth-form {
    margin-top: 24px;
}

.auth-hint {
    display: grid;
    gap: 6px;
    margin-top: 20px;
    color: var(--muted);
    font-size: 14px;
}

.auth-theme-fab {
    position: fixed;
    top: 18px;
    right: 18px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-compact {
    align-items: start;
}

.hero,
.card {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

html[data-theme="dark"] .hero,
html[data-theme="dark"] .card,
html[data-theme="dark"] .sidebar-note,
html[data-theme="dark"] .project-meta div,
html[data-theme="dark"] .inner-card,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .theme-fab {
    border-color: rgba(165, 187, 222, 0.1);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 24px;
    padding: 36px;
}

.eyebrow,
.section-index {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

.section-index {
    display: none;
}

h1 {
    margin-bottom: 16px;
    font-family: "Unbounded", sans-serif;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.02;
}

h2 {
    margin-bottom: 0;
    font-family: "Unbounded", sans-serif;
    font-size: clamp(26px, 4vw, 42px);
}

.hero-text {
    max-width: 700px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

.hero-card {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(61, 141, 255, 0.12), rgba(26, 196, 219, 0.12));
}

.hero-card-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hero-card-value {
    margin-bottom: 14px;
    font-size: 18px;
    font-weight: 700;
}

.panel-section {
    margin-top: 28px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 16px;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.projects-header {
    margin-bottom: 18px;
}

.tab-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tab-button,
.ghost-button,
.primary-button {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(34, 48, 71, 0.06);
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.tab-link.current {
    background: linear-gradient(135deg, var(--blue-start), var(--blue-end));
    color: #fff;
}

.ghost-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(34, 48, 71, 0.07);
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.primary-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--blue-start), var(--blue-end));
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 16px 28px rgba(61, 141, 255, 0.24);
}

.projects-card {
    display: flex;
    flex-direction: column;
    padding-top: 22px;
    height: calc(100vh - 180px);
    min-height: 680px;
}

.count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: rgba(61, 141, 255, 0.12);
    color: #2d78e8;
    font-weight: 800;
    font-size: 14px;
    box-shadow: inset 0 0 0 1px rgba(61, 141, 255, 0.12);
}

.projects-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
    margin-bottom: 18px;
}

.create-project-button {
    min-width: 0;
    flex: 1 1 auto;
    padding-inline: 28px;
}

.export-toolbar {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.download-popover {
    position: relative;
}

.download-popover summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    list-style: none;
}

.download-popover summary::-webkit-details-marker {
    display: none;
}

.icon-circle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(61, 141, 255, 0.14);
    border-radius: 999px;
    background: rgba(61, 141, 255, 0.08);
    color: #2d78e8;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-circle-button:hover {
    transform: translateY(-1px);
    background: rgba(61, 141, 255, 0.14);
    border-color: rgba(61, 141, 255, 0.24);
}

.icon-circle-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.download-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 20;
    min-width: 160px;
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.download-menu-item {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 14px;
    background: rgba(34, 48, 71, 0.05);
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.download-menu-item[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.admin-sync-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.admin-sync-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel-strong);
    min-height: 0;
}

.admin-sync-card h4 {
    margin: 0;
    font-size: 22px;
}

.admin-sync-card-wide {
    width: 100%;
    max-width: none;
}

.admin-sync-type-strip {
    align-items: center;
}

.admin-sync-type-strip .tab-button {
    min-width: 88px;
    padding: 14px 20px;
    font-size: 18px;
}

.admin-sync-type-strip .tab-button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.admin-import-form {
    max-width: 360px;
}

.tab-button {
    padding: 12px 18px;
    background: rgba(34, 48, 71, 0.06);
    color: var(--text);
    font-weight: 800;
}

.tab-button.current {
    background: linear-gradient(135deg, var(--blue-start), var(--blue-end));
    color: #fff;
}

.panel-grid {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 20px;
}

.projects-layout {
    align-items: stretch;
}

.users-grid {
    grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(7, 12, 24, 0.62);
    backdrop-filter: blur(10px);
}

.modal-dialog {
    width: min(100%, 760px);
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.modal-dialog-project {
    width: min(100%, 940px);
}

.modal-card {
    padding: 28px;
}

.modal-card-project {
    padding: 24px;
}

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

.card {
    padding: 24px;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
    justify-content: flex-end;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(34, 48, 71, 0.07);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.badge.accent {
    background: rgba(247, 181, 0, 0.14);
    color: #8a6400;
}

.badge.success {
    background: rgba(30, 180, 120, 0.14);
    color: #15724f;
}

.badge.warning {
    background: rgba(227, 60, 60, 0.12);
    color: #972f2f;
}

.project-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.projects-scroll-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
    align-content: start;
    grid-auto-rows: max-content;
    scrollbar-width: auto;
    scrollbar-color: rgba(61, 141, 255, 0.55) transparent;
}

.projects-scroll-list::-webkit-scrollbar {
    width: 8px;
}

.projects-scroll-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(61, 141, 255, 0.22);
}

.projects-scroll-list::-webkit-scrollbar-track {
    background: transparent;
}

.project-link {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(61, 141, 255, 0.14);
    border-radius: 18px;
    background: rgba(61, 141, 255, 0.05);
    color: #2d78e8;
    text-align: left;
    text-decoration: none;
    font-weight: 800;
}

.project-link.current {
    border-color: rgba(61, 141, 255, 0.28);
    background: rgba(61, 141, 255, 0.14);
}

.project-view {
    height: calc(100vh - 180px);
    min-height: 680px;
    overflow-y: auto;
    scrollbar-width: auto;
    scrollbar-color: rgba(61, 141, 255, 0.55) transparent;
}

.project-view::-webkit-scrollbar {
    width: 8px;
}

.project-view::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(61, 141, 255, 0.55);
}

.project-view::-webkit-scrollbar-track {
    background: transparent;
}

.empty-state,
.empty-card-state {
    padding: 16px;
    border-radius: 18px;
    background: rgba(34, 48, 71, 0.05);
    color: var(--muted);
    line-height: 1.6;
}

html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .empty-card-state {
    background: rgba(255, 255, 255, 0.04);
}

.status-banner {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(30, 180, 120, 0.12);
    color: #15724f;
    font-weight: 700;
    transition: opacity 0.24s ease, transform 0.24s ease, margin 0.24s ease;
}

.status-banner.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
}

.status-banner-floating {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 90;
    width: min(560px, calc(100vw - 48px));
    margin: 0;
    box-shadow: var(--shadow);
}

html[data-theme="dark"] .status-banner {
    background: rgba(30, 180, 120, 0.18);
    color: #7be0b7;
}

html[data-theme="dark"] .badge.success {
    background: rgba(30, 180, 120, 0.18);
    color: #7be0b7;
}

html[data-theme="dark"] .badge.warning {
    background: rgba(227, 60, 60, 0.16);
    color: #ffb0b0;
}

.error-box {
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(227, 60, 60, 0.1);
    color: #972f2f;
}

html[data-theme="dark"] .error-box {
    background: rgba(227, 60, 60, 0.14);
    color: #ffb0b0;
}

.error-box ul {
    margin: 10px 0 0;
    padding-left: 18px;
}

.project-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.project-meta div,
.inner-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel-strong);
}

.project-meta span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.project-meta strong {
    white-space: pre-line;
    word-break: break-word;
}

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

.selection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.selection-card {
    min-width: 0;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel-strong);
}

.selection-card legend {
    padding: 0 6px;
    font-weight: 800;
}

.selection-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.inner-card ul {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.project-form {
    display: grid;
    gap: 16px;
}

.project-modal-form {
    gap: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-row-tight {
    gap: 14px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 700;
}

.field-hint {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
    color: var(--text);
}

textarea {
    min-height: 130px;
    resize: vertical;
}

.project-modal-columns textarea {
    min-height: 112px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.form-actions-start {
    justify-content: flex-start;
}

.form-actions-spread {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.primary-button {
    padding: 15px 24px;
    max-width: 100%;
    background: linear-gradient(135deg, var(--blue-start), var(--blue-end));
    color: #fff;
    font-weight: 800;
    box-shadow: 0 16px 28px rgba(61, 141, 255, 0.24);
}

.primary-button.slim {
    width: 100%;
    justify-content: center;
}

.ghost-button {
    padding: 12px 16px;
    background: rgba(34, 48, 71, 0.07);
    color: var(--text);
    font-weight: 800;
}

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

.card-description {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.7;
}

.probe-card {
    margin-bottom: 20px;
}

.probe-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.probe-meta-grid div,
.admin-warning-list div {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
}

.probe-meta-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.probe-textarea {
    min-height: 260px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
}

.admin-warning-card {
    margin-top: 20px;
}

.admin-warning-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.admin-overview-card {
    padding-bottom: 28px;
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.admin-summary-grid div {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
}

.admin-summary-grid span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sync-type-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.compact-form {
    gap: 14px;
}

.disabled-toolset {
    margin: 0;
    padding: 0;
    border: 0;
}

.disabled-toolset[disabled] {
    opacity: 0.58;
}

.disabled-toolset[disabled] input,
.disabled-toolset[disabled] select,
.disabled-toolset[disabled] textarea,
.disabled-toolset[disabled] button {
    cursor: not-allowed;
}

.admin-compact-card {
    max-width: 760px;
}

.admin-base-row,
.admin-sms-row {
    display: grid;
    gap: 14px;
}

.admin-base-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-sms-row {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.admin-inline-card {
    padding: 18px 20px;
    border-radius: 22px;
}

.admin-inline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-inline-head h3 {
    margin-bottom: 0;
    font-size: 22px;
}

.admin-inline-form {
    display: grid;
    gap: 12px;
}

.admin-inline-card input[type="file"] {
    padding: 10px 12px;
}

.admin-inline-card-button .form-actions {
    min-height: 44px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cell-meta {
    color: var(--muted);
    font-size: 14px;
}

.empty-table {
    color: var(--muted);
    text-align: center;
}

@media (max-width: 1100px) {
    .page-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .hero,
    .panel-grid,
    .users-grid,
    .selection-grid,
    .probe-meta-grid,
    .admin-warning-list,
    .admin-summary-grid,
    .admin-base-row,
    .admin-sms-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .content,
    .sidebar {
        padding: 20px;
    }

    .section-header,
    .card-title-row,
    .form-row,
    .columns-2,
    .project-meta,
    .probe-meta-grid,
    .admin-warning-list,
    .admin-summary-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .projects-toolbar,
    .export-toolbar {
        align-items: stretch;
    }

    .create-project-button,
    .export-toolbar,
    .download-popover,
    .icon-circle-button {
        width: 100%;
    }

    .projects-toolbar {
        flex-wrap: wrap;
    }

    .projects-card,
    .project-view {
        height: auto;
        min-height: 0;
    }

    .projects-scroll-list,
    .project-view {
        overflow: visible;
        padding-right: 0;
    }

    .download-menu {
        left: 0;
        right: auto;
        width: 100%;
    }

    .section-header {
        align-items: start;
    }

    .header-actions {
        width: 100%;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sidebar-topbar {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 32px;
    justify-content: space-between;
}

.brand {
    margin-bottom: 0;
}

.brand-muted {
    color: rgba(34, 48, 71, 0.56);
}

html[data-theme="dark"] .brand-muted {
    color: rgba(239, 245, 255, 0.24);
}

.theme-icon-button {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    margin-top: -6px;
    margin-right: 2px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(34, 48, 71, 0.06);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

html[data-theme="dark"] .theme-icon-button {
    background: rgba(255, 255, 255, 0.06);
}

.theme-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-icon-dark {
    display: none;
}

html[data-theme="dark"] .theme-icon-light {
    display: none;
}

html[data-theme="dark"] .theme-icon-dark {
    display: inline;
}

.auth-theme-icon {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 20;
}

.auth-card {
    width: min(100%, 620px);
}

.auth-checkbox-row {
    display: inline-flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    width: fit-content;
    align-self: flex-start;
}

.auth-checkbox-row span {
    flex: 0 0 auto;
    text-align: left;
}

.projects-layout {
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    min-height: calc(100vh - 150px);
    align-items: stretch;
}

.projects-card,
.project-view {
    min-height: calc(100vh - 170px);
}

.projects-toolbar {
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.projects-tools,
.projects-primary-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.projects-tools {
    margin-left: auto;
}

.projects-primary-actions {
    flex: 0 0 auto;
}

.create-project-button {
    min-width: 180px;
}

.export-toolbar .icon-circle-button {
    flex-shrink: 0;
}

.project-search-toolbar {
    margin-bottom: 16px;
}

.tool-popover[open] .icon-circle-button,
.icon-circle-button:hover {
    background: rgba(61, 141, 255, 0.14);
    border-color: rgba(61, 141, 255, 0.24);
}

.search-input {
    width: 100%;
    padding: 12px 14px;
}

.project-list-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.project-list-item.is-filter-hidden {
    display: none;
}

.project-link {
    grid-column: 1 / -1;
}

.project-select-toggle:not([hidden]) + .project-link {
    grid-column: auto;
}

.project-select-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.project-select-toggle span {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1px solid rgba(61, 141, 255, 0.22);
    background: rgba(61, 141, 255, 0.08);
}

.project-select-toggle input {
    display: none;
}

.project-select-toggle input:checked + span {
    background: linear-gradient(135deg, var(--blue-start), var(--blue-end));
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.75);
}

.project-bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(34, 48, 71, 0.05);
}

.project-bulk-toolbar-copy {
    margin-right: auto;
    color: var(--muted);
    font-weight: 700;
}

.icon-circle-button.is-active {
    background: rgba(61, 141, 255, 0.2);
    border-color: rgba(61, 141, 255, 0.4);
    color: #2d78e8;
}

html[data-theme="dark"] .icon-circle-button.is-active {
    background: rgba(90, 141, 255, 0.28);
    border-color: rgba(90, 141, 255, 0.42);
    color: #a9c8ff;
}

.ghost-link-button-danger,
.ghost-button-danger,
.danger-outline-button {
    color: #d05353;
}

.modal-dialog {
    width: min(100%, 860px);
    max-height: calc(100vh - 40px);
    overflow: auto;
}

.modal-dialog-project,
.modal-dialog-user {
    width: min(100%, 980px);
}

.modal-dialog-user {
    width: min(100%, 900px);
}

.modal-card-project,
.modal-card-user {
    max-height: calc(100vh - 40px);
    overflow: auto;
}

.modal-card-user {
    scrollbar-width: auto;
    scrollbar-color: rgba(61, 141, 255, 0.55) transparent;
}

.modal-card-user::-webkit-scrollbar {
    width: 8px;
}

.modal-card-user::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(61, 141, 255, 0.55);
}

.modal-card-user::-webkit-scrollbar-track {
    background: transparent;
}

.modal-copy {
    color: var(--muted);
    line-height: 1.6;
}

.modal-list {
    margin: 14px 0 0;
    padding-left: 18px;
    color: var(--muted);
}

.field-shell {
    position: relative;
}

.field-shell input,
.field-shell select,
.field-shell textarea {
    padding: 18px 18px 16px;
}

.select-input {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 22px) calc(50% - 3px),
        calc(100% - 15px) calc(50% - 3px);
    background-size: 7px 7px, 7px 7px;
    background-repeat: no-repeat;
    padding-right: 42px;
}

input[type="date"] {
    color-scheme: dark;
}

html[data-theme="light"] input[type="date"] {
    color-scheme: light;
}

.project-modal-form {
    gap: 12px;
}

.export-statistics-form {
    gap: 18px;
}

.stats-freshness-note {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 18px;
    border: 1px solid rgba(61, 141, 255, 0.16);
    border-radius: 20px;
    background: rgba(61, 141, 255, 0.08);
    color: var(--muted);
    font-weight: 600;
}

.stats-freshness-note strong {
    color: var(--text);
}

.project-modal-form .form-row,
.project-modal-columns {
    align-items: start;
}

.export-modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.project-modal-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-modal-columns textarea {
    min-height: 140px;
}

.export-date-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
}

.export-controls-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, 260px);
    align-items: start;
}

.export-date-field {
    min-width: 0;
}

.export-date-field input[type="date"] {
    min-height: 72px;
    padding-right: 54px;
    font-size: 17px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    transform: scale(1.28);
    transform-origin: center;
    cursor: pointer;
}

.export-selection-row {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
    align-items: start;
}

.export-selection-row-simple {
    grid-template-columns: minmax(220px, 280px);
    justify-content: end;
}

.export-date-hint {
    margin-top: -8px;
}

.export-projects-field {
    min-width: 0;
    align-self: stretch;
}

.export-project-picker-list {
    display: grid;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    scrollbar-width: auto;
    scrollbar-color: rgba(61, 141, 255, 0.55) transparent;
}

.export-project-picker-list::-webkit-scrollbar {
    width: 8px;
}

.export-project-picker-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(61, 141, 255, 0.55);
}

.export-project-picker-list::-webkit-scrollbar-track {
    background: transparent;
}

.export-project-option {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding-inline: 14px;
}

.export-project-option-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.export-project-picker-summary {
    width: 100%;
}

.export-project-picker-menu {
    width: 100%;
    min-width: 100%;
    max-width: none;
}

.export-project-picker-menu-static {
    position: static;
    margin-top: 14px;
    display: block;
    padding: 20px;
    border-radius: 28px;
}

.export-project-summary-static {
    min-height: 64px;
    align-items: center;
}

.export-project-picker-list {
    width: 100%;
}

.export-format-field {
    width: 100%;
    max-width: 280px;
}

.export-format-field .select-input {
    min-height: 72px;
    font-size: 17px;
}

.geo-picker {
    position: relative;
}

.geo-picker-summary {
    list-style: none;
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 18px 42px 16px 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel-strong);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.geo-picker-summary::-webkit-details-marker {
    display: none;
}

.geo-picker-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: fit-content;
    min-width: min(420px, 100%);
    max-width: min(680px, calc(100vw - 64px));
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    z-index: 15;
}

.geo-picker-list {
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
    scrollbar-width: auto;
    scrollbar-color: rgba(61, 141, 255, 0.55) transparent;
}

.geo-picker-list::-webkit-scrollbar {
    width: 8px;
}

.geo-picker-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(61, 141, 255, 0.55);
}

.geo-picker-list::-webkit-scrollbar-track {
    background: transparent;
}

.geo-option {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 14px;
    cursor: pointer;
    width: max-content;
    max-width: 100%;
}

.geo-option:hover {
    background: rgba(61, 141, 255, 0.08);
}

.geo-option span {
    line-height: 1.4;
    white-space: nowrap;
}

.field-row-user {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
    align-items: start;
}

.field-role-group {
    display: block;
    min-width: 0;
}

.field-shell-compact {
    width: 100%;
    max-width: none;
}

.select-input-compact {
    width: 100%;
    min-width: 0;
}

.selection-note-inline {
    margin: 0;
    max-width: 720px;
}

.selection-note-user {
    max-width: 520px;
}

.selection-note-user-role {
    margin-top: 10px;
}

.user-limit-block {
    max-width: 620px;
    margin-top: -2px;
}

.field-shell-account-limit {
    max-width: 620px;
}

.selection-card-compact {
    width: 148px;
    max-width: 148px;
    padding: 16px 18px;
}

.selection-inline-grid-tight {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.checkbox-row-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 4px 0;
}

.checkbox-row-compact span {
    min-width: 0;
}

.checkbox-row-project-type {
    font-size: 16px;
    font-weight: 700;
    max-width: 114px;
}

.checkbox-panel-inline {
    align-self: start;
    min-height: auto;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.checkbox-panel-inline-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    margin-top: 0;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    font-weight: 700;
}

.checkbox-panel-inline-user span {
    max-width: none;
    white-space: nowrap;
}

.checkbox-panel-inline-user input {
    margin-left: auto;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.users-header {
    align-items: center;
}

.users-create-button {
    min-width: 250px;
    text-align: center;
}

.users-list-card {
    height: calc(100vh - 170px);
    max-height: calc(100vh - 170px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.users-list-card .table-wrap {
    flex: 1 1 auto;
    overflow: auto;
    scrollbar-width: auto;
    scrollbar-color: rgba(61, 141, 255, 0.55) transparent;
}

.users-list-card .table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.users-list-card .table-wrap::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(61, 141, 255, 0.55);
}

.users-list-card .table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.admin-layout {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    min-height: calc(100vh - 150px);
    align-items: stretch;
}

.admin-menu-card,
.admin-content-card {
    height: calc(100vh - 170px);
    max-height: calc(100vh - 170px);
}

.admin-menu {
    display: grid;
    gap: 10px;
}

.admin-menu-card {
    overflow: auto;
    scrollbar-width: auto;
    scrollbar-color: rgba(61, 141, 255, 0.55) transparent;
}

.admin-menu-card::-webkit-scrollbar {
    width: 8px;
}

.admin-menu-card::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(61, 141, 255, 0.55);
}

.admin-menu-card::-webkit-scrollbar-track {
    background: transparent;
}

.admin-menu-link {
    display: block;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 18px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.admin-menu-link.active,
.admin-menu-link:hover {
    border-color: rgba(61, 141, 255, 0.18);
    background: rgba(61, 141, 255, 0.08);
}

.admin-content-card {
    max-height: calc(100vh - 170px);
    overflow-y: auto;
    scrollbar-width: auto;
    scrollbar-color: rgba(61, 141, 255, 0.55) transparent;
}

.admin-content-card::-webkit-scrollbar {
    width: 8px;
}

.admin-content-card::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(61, 141, 255, 0.55);
}

.admin-content-card::-webkit-scrollbar-track {
    background: transparent;
}

.admin-realtime-table-wrap {
    width: 100%;
    overflow: auto;
    scrollbar-width: auto;
    scrollbar-color: rgba(61, 141, 255, 0.55) transparent;
}

.admin-realtime-table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.admin-realtime-table-wrap::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(61, 141, 255, 0.55);
}

.admin-realtime-table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.admin-realtime-table {
    width: 100%;
    table-layout: fixed;
}

.admin-realtime-table th,
.admin-realtime-table td {
    vertical-align: top;
}

.admin-limits-table thead th,
.admin-ai-prompts-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(16, 31, 58, 0.98);
    backdrop-filter: blur(2px);
}

.admin-col-actions {
    width: 132px;
}

.admin-limits-table .admin-col-limit {
    width: 130px;
}

.admin-limit-input {
    min-width: 96px;
    max-width: 130px;
    text-align: right;
}

.admin-campaign-input {
    min-width: 360px;
}

.admin-blacklist-form {
    width: 100%;
}

.admin-limits-card,
.admin-blacklist-card,
.admin-ai-prompts-card {
    max-height: calc(100vh - 220px);
}

.admin-limits-card {
    min-height: calc(100vh - 230px);
}

.admin-limits-card,
.admin-ai-prompts-card {
    overflow: hidden;
}

.admin-limits-layout {
    height: 100%;
    min-height: 0;
}

.admin-limits-header {
    flex: 0 0 auto;
}

.admin-static-actions-form {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
    flex: 1 1 auto;
}

.admin-limits-form {
    height: 100%;
    min-height: 0;
}

.admin-limits-table-wrap {
    min-height: 320px;
    max-height: calc(100vh - 410px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    margin-top: 6px;
}

.admin-form-actions-static {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-top: 12px;
    margin-top: 10px;
    background: linear-gradient(to top, rgba(16, 31, 58, 0.98) 72%, rgba(16, 31, 58, 0));
}

.admin-blacklist-editor {
    display: grid;
    gap: 10px;
    min-height: 0;
}

.admin-blacklist-textarea {
    width: 100%;
    min-height: 260px;
    max-height: calc(100vh - 430px);
    resize: vertical;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    background: rgba(11, 22, 43, 0.45);
    color: var(--text);
    padding: 14px 16px;
    line-height: 1.4;
}

.admin-ai-prompts-table-wrap {
    max-height: calc(100vh - 340px);
}

.admin-ai-prompts-table .admin-col-category {
    width: 220px;
}

.admin-prompt-system-input {
    min-height: 140px;
    max-height: 240px;
    resize: vertical;
    line-height: 1.35;
}

.admin-stack-form {
    max-width: 360px;
}

.admin-base-row-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-sms-row-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-inline-card-compact h3 {
    font-size: 18px;
}

.admin-disabled-fieldset[disabled] {
    opacity: 1;
}

.admin-disabled-button,
.admin-disabled-button:disabled,
.admin-disabled-fieldset[disabled] .ghost-button,
.admin-disabled-fieldset[disabled] .tab-button {
    background: rgba(119, 134, 158, 0.22);
    color: var(--text);
    box-shadow: none;
}

.file-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
}

.file-trigger-button {
    flex: 0 0 auto;
    padding: 10px 14px;
}

.file-field-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-weight: 600;
}

.auth-page .brand-muted {
    color: rgba(239, 245, 255, 0.24);
}

html[data-theme="light"] .auth-page .brand-muted {
    color: rgba(34, 48, 71, 0.5);
}

@media (max-width: 1200px) {
    .projects-layout,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .projects-card,
    .project-view,
    .users-list-card,
    .admin-menu-card,
    .admin-content-card {
        min-height: 0;
        height: auto;
        max-height: none;
    }

    .projects-scroll-list,
    .project-view,
    .users-list-card .table-wrap,
    .admin-menu-card,
    .admin-content-card {
        overflow: visible;
    }
}

@media (max-width: 920px) {
    .projects-toolbar,
    .projects-primary-actions,
    .form-row-user-auth,
    .project-modal-columns,
    .admin-sync-grid,
    .admin-base-row-compact,
    .admin-sms-row-compact {
        grid-template-columns: 1fr;
    }

    .projects-toolbar,
    .projects-primary-actions,
    .field-row-user {
        display: grid;
        grid-template-columns: 1fr;
    }

    .export-date-row,
    .export-selection-row,
    .export-controls-row {
        grid-template-columns: 1fr;
    }

    .export-format-field,
    .export-project-picker-menu {
        max-width: none;
        min-width: 0;
    }

    .admin-campaign-input {
        min-width: 220px;
    }

    .admin-limits-card,
    .admin-blacklist-card,
    .admin-ai-prompts-card {
        max-height: none;
        min-height: 0;
    }

    .admin-blacklist-textarea {
        max-height: none;
    }

    .admin-limits-table-wrap {
        min-height: 260px;
        max-height: none;
    }

    .admin-ai-prompts-table-wrap {
        max-height: none;
    }

    .field-row-user {
        gap: 16px;
    }

    .projects-tools {
        margin-left: 0;
    }

    .create-project-button,
    .users-create-button,
    .field-shell-compact,
    .select-input-compact {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .checkbox-panel-inline {
        justify-content: flex-start;
        min-height: 0;
        padding: 0;
    }

    .selection-card-compact {
        max-width: none;
        width: 100%;
    }

    .checkbox-panel-inline-user {
        width: 100%;
    }

    .user-limit-block,
    .field-shell-account-limit {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .sidebar-topbar {
        margin-bottom: 24px;
    }

    .brand {
        font-size: 24px;
    }

    .modal-backdrop {
        padding: 12px;
    }

    .modal-card-project,
    .modal-card-user {
        padding: 18px;
    }

    .projects-tools,
    .projects-primary-actions,
    .project-bulk-toolbar,
    .table-actions {
        width: 100%;
        justify-content: stretch;
    }

    .project-bulk-toolbar {
        flex-wrap: wrap;
    }

    .icon-circle-button,
    .create-project-button,
    .users-create-button,
    .download-popover,
    .export-toolbar {
        width: 100%;
    }

    .icon-circle-button {
        height: 48px;
        border-radius: 18px;
    }

    .download-menu {
        width: 100%;
        min-width: 0;
    }

    .status-banner-floating {
        top: 12px;
        right: 12px;
        width: calc(100vw - 24px);
    }

    .auth-checkbox-row {
        justify-content: flex-start;
        align-items: center;
    }
}
