:root {
    --bg: #f4efe4;
    --bg-strong: #efe3cd;
    --panel: rgba(255, 252, 246, 0.9);
    --panel-strong: #fffaf0;
    --border: rgba(41, 72, 64, 0.12);
    --text: #21332f;
    --text-soft: #5a6d68;
    --primary: #0d7a67;
    --primary-deep: #0a5a4f;
    --accent: #ee8f3b;
    --danger: #ba4d3f;
    --success: #217a4f;
    --shadow: 0 18px 48px rgba(34, 51, 47, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --timeline-min-width: 1080px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(13, 122, 103, 0.12), transparent 26%),
        radial-gradient(circle at right 20%, rgba(238, 143, 59, 0.16), transparent 18%),
        linear-gradient(180deg, #f7f2e7 0%, #efe7d9 100%);
    color: var(--text);
    font-family: var(--font-sans);
}

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

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.page-shell {
    min-height: 100vh;
    padding: 16px;
}

.login-view {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(320px, 520px) minmax(280px, 1fr);
    min-height: calc(100vh - 48px);
    align-items: center;
}

.login-panel,
.aside-card,
.sidebar,
.content-area,
.panel-card,
.table-card,
.status-banner,
.notification-summary {
    backdrop-filter: blur(18px);
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.login-panel {
    border-radius: var(--radius-xl);
    padding: 40px;
}

.brand-mark {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand-mark.small {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 0.95rem;
}

.eyebrow {
    margin: 18px 0 8px;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

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

.login-panel h1 {
    font-size: clamp(2rem, 3vw, 3.25rem);
    line-height: 1.04;
}

.subtext {
    margin-top: 14px;
    color: var(--text-soft);
    line-height: 1.7;
}

.login-form,
.stack-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.login-action-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

label {
    display: grid;
    gap: 8px;
}

.inline-field {
    display: grid;
    gap: 8px;
    align-content: end;
}

.inline-field .secondary-button {
    align-self: end;
}

label span,
.rule-header p,
.section-toolbar p,
.header-hint,
.dev-tip,
.notification-summary span,
.sidebar-footer span {
    color: var(--text-soft);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(13, 122, 103, 0.18);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(13, 122, 103, 0.18);
    border-color: rgba(13, 122, 103, 0.4);
}

.readonly-input {
    background: rgba(33, 51, 47, 0.06);
    color: var(--text-soft);
}

.primary-button,
.secondary-button,
.ghost-button,
.nav-item {
    border: none;
    border-radius: 999px;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
    padding: 13px 18px;
    background: linear-gradient(135deg, var(--primary) 0%, #139c83 100%);
    color: #fff;
    font-weight: 700;
}

.secondary-button {
    padding: 10px 16px;
    background: rgba(13, 122, 103, 0.12);
    color: var(--primary-deep);
    font-weight: 700;
}

.ghost-button {
    padding: 10px 16px;
    background: rgba(33, 51, 47, 0.08);
    color: var(--text);
}

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

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled,
.nav-item:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    transform: none;
    box-shadow: none;
}

.primary-button.is-loading,
.secondary-button.is-loading {
    position: relative;
    pointer-events: none;
}

.form-error {
    min-height: 20px;
    margin-top: 14px;
    color: var(--danger);
    font-size: 0.95rem;
}

.dev-tip {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.92rem;
}

.dev-tip code {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(13, 122, 103, 0.1);
    color: var(--primary-deep);
}

.login-aside {
    display: grid;
    gap: 24px;
}

.aside-card {
    border-radius: var(--radius-xl);
    padding: 28px;
}

.gradient-card {
    background:
        linear-gradient(135deg, rgba(13, 122, 103, 0.92) 0%, rgba(20, 62, 67, 0.92) 72%),
        var(--panel);
    color: #fff;
}

.gradient-card .aside-label,
.gradient-card li {
    color: rgba(255, 255, 255, 0.86);
}

.gradient-card ul {
    padding-left: 18px;
    margin: 18px 0 0;
    display: grid;
    gap: 12px;
}

.stat-card-grid {
    display: grid;
    gap: 16px;
}

.stat-card-grid article {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
    display: grid;
    gap: 8px;
}

.stat-card-grid strong {
    font-size: 1.35rem;
    color: var(--primary-deep);
}

.app-view {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 16px;
    min-height: calc(100vh - 32px);
}

.sidebar {
    padding: 22px;
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-brand {
    display: flex;
    gap: 14px;
    align-items: center;
}

.sidebar-brand h2 {
    font-size: 1.15rem;
}

.nav-list {
    margin-top: 28px;
    display: grid;
    gap: 10px;
}

.nav-item {
    padding: 14px 16px;
    text-align: left;
    background: transparent;
    color: var(--text-soft);
    font-weight: 700;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(13, 122, 103, 0.16) 0%, rgba(238, 143, 59, 0.18) 100%);
    color: var(--text);
}

.sidebar-footer {
    display: grid;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.content-area {
    border-radius: var(--radius-xl);
    padding: 22px;
    overflow: hidden;
}

.page-header,
.section-toolbar,
.header-actions,
.form-actions,
.rule-header,
.filter-bar,
.compact {
    display: flex;
    gap: 14px;
    align-items: center;
}

.page-header,
.section-toolbar,
.rule-header {
    justify-content: space-between;
}

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

.page-header h1 {
    font-size: clamp(1.8rem, 2vw, 2.5rem);
}

.view-section {
    display: grid;
    gap: 18px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.metric-card {
    padding: 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 251, 244, 0.88));
    border: 1px solid var(--border);
}

.metric-card .metric-label {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.metric-card strong {
    display: block;
    margin-top: 12px;
    font-size: 2rem;
    line-height: 1;
}

.metric-card-date {
    min-width: 220px;
}

.metric-card-date .metric-value-date {
    font-size: 1.38rem;
    line-height: 1.15;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.metric-card .metric-note {
    margin-top: 8px;
    color: var(--primary-deep);
    font-size: 0.92rem;
}

.occupancy-toolbar {
    align-items: end;
    flex-wrap: wrap;
}

.occupancy-toolbar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.occupancy-toolbar-actions input[type="date"] {
    width: auto;
    min-width: 170px;
}

.occupancy-legend {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.occupancy-filter-bar {
    margin: 0;
}

.occupancy-room-card {
    margin-top: 18px;
}

.occupancy-room-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.occupancy-board {
    margin-top: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.78);
    overflow: hidden;
}

.occupancy-scroll {
    overflow: auto;
}

.occupancy-grid {
    display: grid;
    grid-template-columns: 236px minmax(var(--timeline-min-width), 1fr);
    min-width: calc(236px + var(--timeline-min-width));
}

.occupancy-corner,
.occupancy-room-meta {
    position: sticky;
    left: 0;
    z-index: 3;
    background: rgba(255, 250, 240, 0.97);
    border-right: 1px solid rgba(33, 51, 47, 0.08);
}

.occupancy-corner {
    padding: 16px 18px;
    color: var(--text-soft);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid rgba(33, 51, 47, 0.08);
    z-index: 4;
}

.occupancy-axis {
    position: relative;
    display: grid;
    grid-template-columns: repeat(24, minmax(48px, 1fr));
    min-height: 54px;
    border-bottom: 1px solid rgba(33, 51, 47, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 243, 234, 0.9));
}

.occupancy-axis-cell {
    position: relative;
    min-height: 54px;
    border-left: 1px solid rgba(33, 51, 47, 0.08);
}

.occupancy-axis-cell span {
    position: absolute;
    top: 14px;
    left: 8px;
    color: var(--text-soft);
    font-size: 0.78rem;
    white-space: nowrap;
}

.occupancy-room-meta {
    padding: 16px 18px;
    display: grid;
    gap: 6px;
    border-bottom: 1px solid rgba(33, 51, 47, 0.08);
}

.occupancy-room-meta strong {
    font-size: 1rem;
}

.occupancy-room-meta div {
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.5;
}

.occupancy-room-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.occupancy-room-track {
    position: relative;
    border-bottom: 1px solid rgba(33, 51, 47, 0.08);
    background-image:
        linear-gradient(to right, rgba(33, 51, 47, 0.08) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 244, 236, 0.84));
    background-size: calc(100% / 24) 100%, auto;
    background-position: left top;
}

.occupancy-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.occupancy-fill.direct {
    background: rgba(13, 122, 103, 0.18);
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.3), inset -1px 0 0 rgba(255, 255, 255, 0.24);
}

.occupancy-fill.impact {
    background: rgba(238, 143, 59, 0.22);
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.28), inset -1px 0 0 rgba(255, 255, 255, 0.22);
}

.occupancy-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(186, 77, 63, 0.9);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.68);
    pointer-events: none;
}

.occupancy-track-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.occupancy-slot {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 16px;
    padding: 0 8px;
    border: none;
    border-radius: 999px;
    cursor: default;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(33, 51, 47, 0.16);
    z-index: 10;
}

.occupancy-slot.direct {
    background: linear-gradient(135deg, var(--primary-deep) 0%, #139c83 100%);
    color: #fff;
}

.occupancy-slot.impact {
    background: linear-gradient(135deg, #d7802f 0%, #ee8f3b 100%);
    color: #fff;
}

.occupancy-slot-title,
.occupancy-slot-time {
    overflow: hidden;
    text-overflow: ellipsis;
}

.occupancy-slot-title {
    font-size: 0.8rem;
    font-weight: 700;
}

.occupancy-slot-time {
    font-size: 0.72rem;
    opacity: 0.94;
    flex: 0 0 auto;
}

.status-banner {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
}

.status-banner.info {
    color: var(--primary-deep);
}

.status-banner.error {
    color: var(--danger);
}

.table-card,
.panel-card,
.notification-summary {
    border-radius: var(--radius-lg);
    padding: 18px;
}

.table-card {
    overflow: auto;
}

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

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

th,
 td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(33, 51, 47, 0.08);
    vertical-align: top;
}

th {
    color: var(--text-soft);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-actions button {
    padding: 8px 12px;
    border-radius: 999px;
    border: none;
    background: rgba(13, 122, 103, 0.12);
    color: var(--primary-deep);
    font-weight: 700;
}

.table-actions .danger {
    background: rgba(186, 77, 63, 0.14);
    color: var(--danger);
}

.table-actions .success {
    background: rgba(33, 122, 79, 0.14);
    color: var(--success);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(13, 122, 103, 0.1);
    color: var(--primary-deep);
    font-size: 0.85rem;
    font-weight: 700;
}

.badge.warn {
    background: rgba(238, 143, 59, 0.16);
    color: #9a4f0d;
}

.badge.muted {
    background: rgba(33, 51, 47, 0.08);
    color: var(--text-soft);
}

.badge.danger {
    background: rgba(186, 77, 63, 0.14);
    color: var(--danger);
}

.table-room-cell {
    min-width: 220px;
}

.room-name-block {
    display: grid;
    gap: 6px;
}

.room-name-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.room-tag-list {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.room-tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(238, 143, 59, 0.16);
    color: #9a4f0d;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
}

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

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

.platform-config-shell {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.2fr);
    gap: 16px;
    align-items: stretch;
    margin-top: 14px;
}

.platform-mode-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(13, 122, 103, 0.1), rgba(255, 255, 255, 0.78));
    border: 1px solid rgba(13, 122, 103, 0.14);
}

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

.platform-config-button {
    display: grid;
    gap: 8px;
    min-height: 104px;
    padding: 18px;
    text-align: left;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(13, 122, 103, 0.14);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
    box-shadow: 0 12px 28px rgba(34, 51, 47, 0.06);
    cursor: pointer;
}

.platform-config-button:hover {
    transform: translateY(-1px);
    border-color: rgba(13, 122, 103, 0.28);
    box-shadow: 0 18px 38px rgba(34, 51, 47, 0.1);
}

.platform-config-button strong {
    color: var(--primary-deep);
    font-size: 1rem;
}

.platform-config-button span {
    color: var(--muted);
    line-height: 1.5;
}

.platform-config-summary {
    margin-top: 14px;
}

.room-platform-admins-panel {
    width: min(1040px, calc(100vw - 32px));
}

.admin-filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 220px)) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 16px;
    padding: 14px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(13, 122, 103, 0.12);
}

.integration-settings-form {
    display: grid;
    gap: 18px;
    margin-top: 14px;
}

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

.integration-config-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(13, 122, 103, 0.1);
}

.integration-config-card h5 {
    margin: 0;
    color: var(--primary-deep);
    font-size: 1.05rem;
}

.integration-config-assistant {
    background:
        radial-gradient(circle at 8% 0%, rgba(13, 122, 103, 0.12), transparent 28%),
        rgba(255, 255, 255, 0.88);
    border-color: rgba(13, 122, 103, 0.18);
}

.integration-config-assistant textarea {
    width: 100%;
    min-height: 108px;
    resize: vertical;
    border: 1px solid rgba(13, 122, 103, 0.16);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    padding: 12px 14px;
    line-height: 1.6;
    outline: none;
}

.integration-config-assistant textarea:focus {
    border-color: rgba(13, 122, 103, 0.42);
    box-shadow: 0 0 0 4px rgba(13, 122, 103, 0.1);
}

.integration-config-assistant .helper-actions {
    align-items: center;
}

.platform-config-panel {
    width: min(760px, calc(100vw - 32px));
}

.platform-config-modal .integration-config-card {
    background: rgba(255, 255, 255, 0.78);
}

.database-readonly-card {
    grid-column: 1 / -1;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(244, 239, 228, 0.72);
}

.checkbox-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.checkbox-field span {
    color: var(--text);
    font-weight: 700;
}

.integration-settings-actions {
    align-items: center;
    justify-content: space-between;
    padding-top: 4px;
}

.integration-settings-actions .helper-text {
    flex: 1 1 360px;
}

.platform-config-test-result {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

.platform-config-test-result.success,
.platform-config-test-result.error {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(248, 250, 252, 0.92);
}

.platform-config-test-result.success {
    color: #166534;
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(240, 253, 244, 0.94);
}

.platform-config-test-result.error {
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(254, 242, 242, 0.94);
}

.platform-config-test-result ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.config-summary-row strong {
    color: var(--primary-deep);
}

.config-summary-row span {
    word-break: break-all;
    color: var(--text-soft);
}

.room-stack-form {
    gap: 18px;
}

.room-wizard-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border-radius: 26px;
    background: rgba(235, 229, 216, 0.72);
    border: 1px solid rgba(13, 122, 103, 0.08);
}

.room-wizard-tab {
    border: none;
    border-radius: 20px;
    padding: 12px 14px;
    background: transparent;
    color: var(--text-soft);
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.room-wizard-tab span {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: inherit;
}

.room-wizard-tab.active {
    color: var(--primary-deep);
    background: #fffaf1;
    box-shadow: 0 12px 28px rgba(22, 34, 31, 0.1);
}

.room-wizard-tab.completed {
    color: #0f7c69;
}

.room-wizard-tab:hover {
    transform: translateY(-1px);
}

.room-wizard-step {
    display: none;
    gap: 18px;
}

.room-wizard-step.active {
    display: grid;
}

.room-wizard-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 8% 0%, rgba(13, 122, 103, 0.12), transparent 28%),
        rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(13, 122, 103, 0.08);
}

.room-wizard-heading h3 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 1.25rem;
}

.room-wizard-heading p {
    margin: 0;
    color: var(--text-soft);
}

.room-wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 4px;
}

.room-list-panel {
    min-width: 0;
}

.room-form-grid {
    gap: 16px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(13, 122, 103, 0.08);
}

.room-form-grid label,
.room-form-block {
    margin: 0;
}

.room-field-wide {
    grid-column: 1 / -1;
}

.room-scene-block {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(13, 122, 103, 0.08);
}

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

.room-gateway-field {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: rgba(244, 239, 228, 0.6);
}

.room-gateway-field label {
    margin: 0;
}

.room-gateway-field .secondary-button {
    min-width: 108px;
    height: 44px;
}

.rule-list {
    display: grid;
    gap: 10px;
}

.rule-row {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr 1fr auto;
    align-items: end;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(13, 122, 103, 0.08);
}

.rule-row button {
    height: 44px;
}

.filter-bar {
    margin: 12px 0 16px;
    flex-wrap: wrap;
}

.filter-bar > * {
    flex: 1 1 150px;
}

.notification-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-summary strong {
    font-size: 1.8rem;
    color: var(--primary-deep);
}

.room-form-block {
    padding: 0 2px;
}

.room-form-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 45;
}

.room-form-modal.open {
    display: block;
}

.room-form-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(22, 34, 31, 0.46);
    backdrop-filter: blur(4px);
}

.room-form-panel {
    position: absolute;
    top: 16px;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: min(980px, calc(100vw - 32px));
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-xl);
    backdrop-filter: blur(18px);
    background: rgba(255, 251, 244, 0.97);
    border: 1px solid var(--border);
    box-shadow: 0 24px 64px rgba(34, 51, 47, 0.2);
}

.room-form-modal-header,
.room-form-modal-actions {
    display: flex;
    gap: 14px;
    justify-content: space-between;
    align-items: flex-start;
}

.room-form-modal-header {
    margin-bottom: 18px;
}

.room-form-modal-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.booking-submit-message {
    flex: 1 1 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-weight: 700;
    line-height: 1.5;
}

.booking-submit-message.error {
    color: #9b1c1c;
    background: rgba(255, 226, 226, 0.92);
    border: 1px solid rgba(220, 38, 38, 0.22);
}

.booking-submit-message.info {
    color: var(--primary-deep);
    background: rgba(13, 122, 103, 0.1);
    border: 1px solid rgba(13, 122, 103, 0.16);
}

.empty-state {
    padding: 24px 8px;
    color: var(--text-soft);
    text-align: center;
}

.admin-only-block.hidden {
    display: none !important;
}

@media (max-width: 1180px) {
    .login-view,
    .app-view,
    .platform-config-shell,
    .platform-config-actions,
    .admin-filter-bar,
    .split-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .page-shell {
        padding: 12px;
    }

    .login-panel,
    .aside-card,
    .content-area,
    .sidebar {
        padding: 18px;
    }

    .form-grid,
    .rule-row,
    .integration-config-grid,
    .platform-config-shell,
    .platform-config-actions,
    .admin-filter-bar {
        grid-template-columns: 1fr;
    }

    .integration-settings-actions {
        align-items: stretch;
    }

    .room-gateway-field {
        grid-template-columns: 1fr;
    }

    .room-gateway-field .secondary-button {
        width: 100%;
    }

    .room-wizard-nav {
        grid-template-columns: 1fr;
    }

    .room-wizard-tab {
        justify-content: flex-start;
    }

    .room-wizard-heading,
    .room-wizard-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .room-wizard-actions .ghost-button,
    .room-wizard-actions .primary-button {
        width: 100%;
    }

    .page-header,
    .section-toolbar,
    .header-actions,
    .rule-header,
    .notification-summary,
    .room-form-modal-header,
    .room-form-modal-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .room-form-panel {
        inset: 10px;
        width: auto;
        padding: 18px;
        transform: none;
        left: 10px;
        right: 10px;
        bottom: 10px;
        top: 10px;
    }

    .occupancy-toolbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .occupancy-toolbar-actions > * {
        flex: 1 1 140px;
    }

    .occupancy-grid {
        grid-template-columns: 208px minmax(920px, 1fr);
        min-width: 1128px;
    }

    .occupancy-room-meta,
    .occupancy-corner {
        padding: 14px;
    }

    .occupancy-slot-time {
        display: none;
    }
}

body.mobile-entry .page-shell {
    padding: 0;
}

body.mobile-entry .login-view {
    min-height: 100vh;
    grid-template-columns: 1fr;
    padding: 14px;
}

body.mobile-entry .login-aside,
body.mobile-entry .dev-tip,
body.mobile-entry .header-hint,
body.mobile-entry #refresh-button {
    display: none !important;
}

body.mobile-entry .login-panel {
    min-height: calc(100vh - 28px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    border-radius: 24px;
}

body.mobile-entry .app-view {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

body.mobile-entry .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 0;
    padding: 12px;
    border-radius: 0 0 22px 22px;
}

body.mobile-entry .sidebar-brand {
    margin-bottom: 10px;
}

body.mobile-entry .sidebar-footer {
    display: none;
}

body.mobile-entry .nav-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

body.mobile-entry .nav-item {
    min-height: 44px;
    padding: 10px 6px;
    text-align: center;
    font-size: 0.82rem;
}

body.mobile-entry .content-area {
    min-height: calc(100vh - 112px);
    padding: 14px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

body.mobile-entry .page-header {
    margin-bottom: 12px;
}

body.mobile-entry .page-header h1 {
    font-size: 1.45rem;
}

body.mobile-entry .booking-filter-bar,
body.mobile-entry .filter-bar {
    grid-template-columns: 1fr;
}

body.mobile-entry .booking-room-card {
    flex-direction: column;
    align-items: stretch;
}

body.mobile-entry .booking-room-card-actions {
    align-items: stretch;
    width: 100%;
}

body.mobile-entry .booking-room-card-actions .primary-button,
body.mobile-entry .booking-room-card-actions .secondary-button {
    width: 100%;
}

body.mobile-entry .room-form-panel {
    inset: 0;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: auto;
    transform: none;
    border-radius: 0;
    padding: 16px;
}

body.mobile-entry .booking-step-card {
    padding: 14px;
}

body.mobile-entry .booking-slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.mobile-entry .room-form-modal-actions {
    position: sticky;
    bottom: -16px;
    margin: 12px -16px -16px;
    padding: 12px 16px 16px;
    background: rgba(255, 251, 244, 0.98);
    border-top: 1px solid var(--border);
}
.reservation-layout {
    grid-template-columns: minmax(520px, 1.15fr) minmax(360px, 0.85fr);
}

.booking-home-panel {
    display: grid;
    gap: 18px;
}

.booking-filter-bar {
    margin: 0;
}

.booking-room-card-list {
    display: grid;
    gap: 14px;
}

.booking-room-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: stretch;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.78);
}

.booking-room-card-main {
    display: grid;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.booking-room-card-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.booking-room-card-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.booking-room-timeline-card {
    margin-top: 8px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(22, 119, 255, 0.12);
    background: linear-gradient(180deg, rgba(247, 250, 255, 0.96), rgba(255, 255, 255, 0.86));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.booking-room-timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.82rem;
}

.booking-room-timeline-head strong {
    color: var(--text);
    font-size: 0.88rem;
}

.booking-room-timeline-track {
    position: relative;
    height: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: repeating-linear-gradient(
        90deg,
        rgba(15, 23, 42, 0.06) 0,
        rgba(15, 23, 42, 0.06) 1px,
        rgba(226, 232, 240, 0.74) 1px,
        rgba(226, 232, 240, 0.74) 6.25%
    );
}

.booking-timeline-window,
.booking-timeline-occupied,
.booking-timeline-now {
    position: absolute;
    top: 0;
    bottom: 0;
}

.booking-timeline-window {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.22), rgba(20, 184, 166, 0.24));
}

.booking-timeline-occupied {
    min-width: 5px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7), 0 6px 14px rgba(239, 68, 68, 0.18);
}

.booking-timeline-occupied.direct {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.booking-timeline-occupied.impact {
    background: linear-gradient(90deg, #f59e0b, #fb923c);
}

.booking-timeline-now {
    width: 2px;
    transform: translateX(-1px);
    background: #0f172a;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}

.booking-room-timeline-axis {
    position: relative;
    height: 16px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.72rem;
}

.booking-room-timeline-axis span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    white-space: nowrap;
}

.booking-room-timeline-axis span:first-child {
    transform: translateX(0);
}

.booking-room-timeline-axis span:last-child {
    transform: translateX(-100%);
}
.booking-room-timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.76rem;
}

.booking-room-timeline-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.booking-room-timeline-legend i {
    width: 22px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
}

.legend-free {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.42), rgba(20, 184, 166, 0.46));
}

.legend-busy {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.booking-modal-panel {
    width: min(860px, calc(100vw - 32px));
}

.selection-card {
    margin-top: 18px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    display: grid;
    gap: 12px;
}

.booking-step-card {
    gap: 16px;
}

.booking-wizard-nav {
    margin-top: 8px;
}

.booking-wizard-step {
    display: none;
}

.booking-wizard-step.active {
    display: grid;
}

.booking-step-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.booking-step-index {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #139c83 100%);
    color: #fff;
    font-weight: 800;
    flex: 0 0 auto;
}

.chip-note {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(13, 122, 103, 0.12);
    color: var(--primary-deep);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 800;
}

.booking-step-head h4 {
    margin-bottom: 4px;
}

.booking-selected-date {
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(13, 122, 103, 0.12), rgba(238, 143, 59, 0.12));
    color: var(--primary-deep);
    font-size: 1.08rem;
    font-weight: 700;
}

.booking-date-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
}

.booking-date-pill {
    padding: 12px 10px;
    border-radius: 16px;
    border: 1px solid rgba(13, 122, 103, 0.12);
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
    display: grid;
    gap: 4px;
    text-align: left;
}

.booking-date-pill span {
    color: var(--text-soft);
    font-size: 0.82rem;
}

.booking-date-pill strong {
    font-size: 0.96rem;
}

.booking-date-pill.active {
    background: linear-gradient(135deg, var(--primary) 0%, #139c83 100%);
    color: #fff;
    box-shadow: 0 14px 28px rgba(13, 122, 103, 0.18);
}

.booking-date-pill.active span {
    color: rgba(255, 255, 255, 0.84);
}

.booking-window-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.7;
}

.booking-slot-summary {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(244, 239, 228, 0.78);
    border: 1px solid rgba(13, 122, 103, 0.08);
}

.booking-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.booking-slot-pill {
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(13, 122, 103, 0.14);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    text-align: center;
    font-weight: 700;
}

.booking-slot-pill.selected {
    background: linear-gradient(135deg, var(--primary) 0%, #139c83 100%);
    color: #fff;
    border-color: transparent;
}

.booking-slot-pill.occupied,
.booking-slot-pill.expired,
.booking-slot-pill.disabled {
    background: rgba(33, 51, 47, 0.08);
    color: var(--text-soft);
    border-style: dashed;
    box-shadow: none;
}

.booking-slot-pill:disabled {
    cursor: not-allowed;
}

.booking-attendee-toolbar {
    align-items: flex-start;
}

.attendee-picker-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.attendee-search-shell {
    position: relative;
}

.attendee-search-input {
    width: 100%;
}

.attendee-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 8;
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding: 10px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(13, 122, 103, 0.12);
    background: rgba(255, 251, 244, 0.98);
    box-shadow: 0 18px 32px rgba(34, 51, 47, 0.14);
}

.attendee-dropdown-state {
    padding: 12px;
    color: var(--text-soft);
    text-align: center;
}

.attendee-option {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(13, 122, 103, 0.12);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    text-align: left;
}

.attendee-option-main {
    display: grid;
    gap: 4px;
}

.attendee-option-main span {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.attendee-option-action {
    color: var(--primary-deep);
    font-weight: 700;
    flex: 0 0 auto;
}

.attendee-option-selected {
    background: rgba(13, 122, 103, 0.1);
}

.helper-text {
    color: var(--text-soft);
    line-height: 1.7;
}

.summary-card {
    display: grid;
    gap: 8px;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(13, 122, 103, 0.12);
    color: var(--primary-deep);
    font-weight: 700;
}

.chip button {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 999px;
    background: rgba(33, 51, 47, 0.12);
    color: var(--text);
    line-height: 1;
}

.helper-list {
    display: grid;
    gap: 10px;
}

.helper-list-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(13, 122, 103, 0.12);
    background: rgba(255, 255, 255, 0.78);
}

.helper-list-item p {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.selectable-item {
    cursor: pointer;
}

.selectable-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.primary-inline {
    padding: 8px 12px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, #139c83 100%);
    color: #fff;
    font-weight: 700;
}

@media (max-width: 1180px) {
    .reservation-layout {
        grid-template-columns: 1fr;
    }

    .booking-date-strip,
    .booking-slot-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .booking-room-card {
        flex-direction: column;
        align-items: stretch;
    }

    .booking-room-card-actions {
        width: 100%;
        align-items: stretch;
    }

    .booking-room-card-actions .primary-button {
        width: 100%;
    }
}
body.drawer-open {
    overflow: hidden;
}

.detail-drawer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 30;
}

.detail-drawer.open {
    display: block;
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(22, 34, 31, 0.46);
    backdrop-filter: blur(4px);
}

.detail-panel {
    position: absolute;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: min(720px, calc(100vw - 32px));
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-xl);
    backdrop-filter: blur(18px);
    background: rgba(255, 251, 244, 0.96);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.detail-panel-header,
.detail-action-bar,
.detail-section-header {
    display: flex;
    gap: 14px;
    justify-content: space-between;
    align-items: flex-start;
}

.detail-subtext {
    margin-top: 10px;
}

.detail-action-bar {
    margin-top: 18px;
    flex-wrap: wrap;
}

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

.detail-card {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--border);
    display: grid;
    gap: 8px;
}

.detail-card.full {
    grid-column: 1 / -1;
}

.detail-label {
    color: var(--text-soft);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.detail-value {
    line-height: 1.7;
    word-break: break-word;
}

.detail-section {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.detail-note {
    color: var(--text-soft);
}

@media (max-width: 720px) {
    .detail-panel {
        inset: 10px;
        width: auto;
        padding: 18px;
    }

    .detail-panel-header,
    .detail-section-header {
        flex-direction: column;
    }

    .detail-summary-grid {
        grid-template-columns: 1fr;
    }
}

body.modal-open {
    overflow: hidden;
}

.success-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60;
}

.success-modal.open {
    display: block;
}

.success-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(22, 34, 31, 0.46);
    backdrop-filter: blur(4px);
}

.success-panel {
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(480px, calc(100vw - 32px));
    padding: 32px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-xl);
    backdrop-filter: blur(18px);
    background: rgba(255, 251, 244, 0.98);
    border: 1px solid var(--border);
    box-shadow: 0 24px 64px rgba(34, 51, 47, 0.2);
    text-align: center;
    animation: slideUp 0.3s ease-out;
}

.group-picker-panel {
    width: min(760px, calc(100vw - 32px));
    text-align: left;
}

.hidden-underlay {
    opacity: 0;
    pointer-events: none;
}

.group-picker-header {
    margin-bottom: 16px;
}

.picker-header {
    align-items: flex-start;
    gap: 16px;
}

.picker-header-copy {
    min-width: 0;
}

.picker-close-button {
    border: none;
    background: rgba(13, 122, 103, 0.1);
    color: var(--primary-deep);
    width: 40px;
    height: 40px;
    border-radius: 999px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.picker-close-button:hover {
    background: rgba(13, 122, 103, 0.16);
}

.org-picker-panel {
    display: flex;
    flex-direction: column;
    max-height: min(88vh, 860px);
}

.org-picker-shell {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
}

.org-picker-sidebar,
.org-picker-content {
    min-height: 0;
    border: 1px solid rgba(13, 122, 103, 0.12);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.75);
}

.org-picker-sidebar {
    overflow-y: auto;
    padding: 10px;
}

.org-picker-content {
    overflow-y: auto;
    padding: 14px;
}

.org-picker-departments,
.org-picker-user-list {
    display: grid;
    gap: 10px;
}

.org-picker-current-path {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: rgba(13, 122, 103, 0.08);
    color: var(--primary-deep);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.5;
}

.org-tree-node {
    display: grid;
    gap: 8px;
}

.org-tree-children {
    display: grid;
    gap: 8px;
    margin-left: 16px;
    padding-left: 8px;
    border-left: 1px dashed rgba(13, 122, 103, 0.14);
}

.org-picker-department-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 12px;
    border-radius: var(--radius-md);
    background: rgba(247, 243, 234, 0.84);
    border: 1px solid transparent;
    cursor: pointer;
}

.org-picker-department-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.org-picker-department-item strong {
    color: var(--text);
    font-size: 0.98rem;
}

.org-picker-department-item span {
    color: var(--text-soft);
    font-size: 0.88rem;
}

.org-picker-department-item.active {
    background: rgba(13, 122, 103, 0.1);
    border-color: rgba(13, 122, 103, 0.22);
}

.org-tree-toggle {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: rgba(13, 122, 103, 0.12);
    color: var(--primary-deep);
    font-size: 1rem;
    line-height: 1;
    flex: 0 0 auto;
}

.org-picker-user-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 15px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(13, 122, 103, 0.12);
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
}

.org-picker-bulk-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(13, 122, 103, 0.16);
    background:
        radial-gradient(circle at 10% 0%, rgba(13, 122, 103, 0.12), transparent 32%),
        rgba(247, 252, 248, 0.96);
}

.org-picker-bulk-action div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.org-picker-bulk-action strong {
    color: var(--primary-deep);
}

.org-picker-bulk-action span {
    color: var(--text-soft);
    font-size: 0.88rem;
}

.native-group-picker-card {
    display: grid;
    gap: 12px;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(13, 122, 103, 0.16);
    background:
        radial-gradient(circle at 10% 0%, rgba(13, 122, 103, 0.12), transparent 32%),
        rgba(255, 255, 255, 0.94);
}

.native-group-picker-card strong {
    color: var(--primary-deep);
    font-size: 1.05rem;
}

.native-group-picker-card p {
    margin: 0;
    color: var(--text-soft);
}

.native-group-picker-card .primary-button {
    justify-self: start;
}

.org-picker-user-card:hover,
.org-picker-department-item:hover {
    background: rgba(255, 250, 243, 0.98);
}

.org-picker-user-card.selected {
    border-color: rgba(13, 122, 103, 0.32);
    background: rgba(13, 122, 103, 0.08);
}

.org-picker-user-card-main,
.org-picker-user-card-meta {
    display: grid;
    gap: 4px;
}

.org-picker-user-card-main strong {
    color: var(--text);
}

.org-picker-user-card-main span,
.org-picker-user-card-meta span {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.org-picker-user-card-meta {
    justify-items: end;
}

.org-picker-user-card-action {
    color: var(--primary-deep) !important;
    font-weight: 700;
}

.picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    margin-top: 16px;
    border-top: 1px solid rgba(33, 51, 47, 0.08);
    background: linear-gradient(180deg, rgba(250, 247, 239, 0.88), rgba(250, 247, 239, 1));
}

.picker-footer-summary {
    color: var(--text-soft);
    font-weight: 600;
}

@media (max-width: 768px) {
    .org-picker-shell {
        grid-template-columns: 1fr;
    }

    .org-picker-sidebar {
        max-height: 180px;
    }

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

    .org-picker-bulk-action {
        align-items: stretch;
        flex-direction: column;
    }

    .picker-footer .primary-button {
        width: 100%;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -12px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success) 0%, #2d9a5f 100%);
    color: #fff;
    font-size: 2.2rem;
    font-weight: 700;
}

.success-panel h3 {
    font-size: 1.5rem;
    color: var(--primary-deep);
    margin-bottom: 20px;
}

.success-content {
    display: grid;
    gap: 12px;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(13, 122, 103, 0.1);
}

.success-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(33, 51, 47, 0.06);
}

.success-row:last-child {
    border-bottom: none;
}

.success-row.full {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.success-label {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.success-value {
    font-weight: 700;
    color: var(--text);
    text-align: right;
}

.success-row.full .success-value {
    text-align: left;
    word-break: break-word;
    line-height: 1.6;
}

.success-actions {
    margin-top: 24px;
}

.success-actions .primary-button {
    width: 100%;
    padding: 14px 24px;
    font-size: 1.05rem;
}

.app-dialog {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.app-dialog.open {
    display: block;
}

.app-dialog-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 48% 32%, rgba(255, 255, 255, 0.2), transparent 28%),
        rgba(18, 28, 26, 0.58);
    backdrop-filter: blur(8px) saturate(0.88);
}

.app-dialog-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(500px, calc(100vw - 32px));
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 18px;
    padding: 28px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: #fffaf1;
    box-shadow:
        0 34px 90px rgba(12, 24, 21, 0.36),
        0 1px 0 rgba(255, 255, 255, 0.88) inset;
    animation: dialogPop 0.22s ease-out;
    overflow: hidden;
}

.app-dialog-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, #d65038, #f2a75f);
}

.app-dialog-panel.info::before {
    background: linear-gradient(90deg, var(--primary), #92c9b6);
}

.app-dialog-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    font-weight: 800;
    font-size: 1.15rem;
    align-self: start;
    box-shadow: 0 10px 24px rgba(22, 34, 31, 0.1);
}

.app-dialog-icon.info {
    color: #064d42;
    background: #d9f0e9;
}

.app-dialog-icon.danger {
    color: #fff;
    background: linear-gradient(135deg, #e55d43, #b93526);
}

.app-dialog-copy {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.app-dialog-copy h3 {
    margin: 0;
    color: #132420;
    font-size: 1.28rem;
    letter-spacing: -0.02em;
}

.app-dialog-copy p {
    margin: 0;
    color: #66746f;
    line-height: 1.65;
    font-size: 0.96rem;
}

.app-dialog-field {
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
}

.app-dialog-field span {
    color: var(--text);
    font-weight: 700;
}

.app-dialog-field textarea {
    width: 100%;
    resize: vertical;
    min-height: 92px;
    border: 1px solid rgba(13, 122, 103, 0.18);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    padding: 12px 14px;
    line-height: 1.6;
    outline: none;
}

.app-dialog-field textarea:focus {
    border-color: rgba(13, 122, 103, 0.42);
    box-shadow: 0 0 0 4px rgba(13, 122, 103, 0.1);
}

.app-dialog-field textarea.input-error {
    border-color: rgba(214, 80, 56, 0.72);
    box-shadow: 0 0 0 4px rgba(214, 80, 56, 0.12);
}

.app-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    grid-column: 1 / -1;
    margin-top: 4px;
    padding-top: 18px;
    border-top: 1px solid rgba(22, 34, 31, 0.08);
}

.app-dialog-actions .ghost-button {
    min-width: 92px;
    border: 1px solid rgba(22, 34, 31, 0.08);
    background: #eef2ef;
    color: #31413d;
    box-shadow: none;
}

.danger-button {
    border: none;
    border-radius: 999px;
    min-width: 112px;
    padding: 12px 22px;
    background: linear-gradient(135deg, #d65038, #b73526);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(183, 53, 38, 0.24);
}

.danger-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(183, 53, 38, 0.28);
}

@media (max-width: 560px) {
    .app-dialog-panel {
        grid-template-columns: 44px 1fr;
        gap: 14px;
        padding: 24px 20px 20px;
        border-radius: 24px;
    }

    .app-dialog-icon {
        width: 42px;
        height: 42px;
    }

    .app-dialog-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .app-dialog-actions .ghost-button,
    .danger-button,
    .app-dialog-actions .primary-button {
        width: 100%;
    }
}

@keyframes dialogPop {
    from {
        opacity: 0;
        transform: translate(-50%, -46%) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}
