:root {
    --bg: #f3f6f8;
    --surface: #ffffff;
    --surface-alt: #eef4f7;
    --text: #18232c;
    --muted: #5f7280;
    --iwg: #0d8794;
    --iwg-dark: #0a5a64;
    --innercom: #eb6a3d;
    --border: #d5e0e7;
    --danger: #b54848;
    --success: #24845d;
    --shadow: 0 12px 30px rgba(18, 47, 66, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(13, 135, 148, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(235, 106, 61, 0.08), transparent 24%),
        linear-gradient(180deg, #f7fbfd 0%, #edf4f7 100%);
    color: var(--text);
}
a { color: var(--iwg-dark); text-decoration: none; }
small, .muted, .sidebar span, .group { color: var(--muted); }
h1, h2, h3, p { margin-top: 0; }
button, .button-secondary {
    border: 0;
    border-radius: 8px;
    padding: 0.78rem 1rem;
    background: linear-gradient(135deg, var(--iwg) 0%, var(--iwg-dark) 100%);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
.button-secondary {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    color: var(--iwg-dark);
    border: 1px solid var(--border);
}
.button-danger {
    background: linear-gradient(180deg, #fff8f8 0%, #fff 100%);
    color: var(--danger);
    border: 1px solid rgba(181, 72, 72, 0.35);
}
.button-danger:hover {
    background: rgba(181, 72, 72, 0.08);
}
input, select, textarea {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fbfdfe;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: rgba(13, 135, 148, 0.65);
    box-shadow: 0 0 0 4px rgba(13, 135, 148, 0.12);
    background: #fff;
}
label { display: grid; gap: 0.45rem; font-weight: 700; font-size: 0.95rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.95rem 1rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; }
tbody tr:hover { background: rgba(13, 135, 148, 0.04); }

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}
.sidebar {
    background: linear-gradient(180deg, #0d2b36 0%, #123742 100%);
    color: #fff;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.brand-corporate {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: rgba(255,255,255,0.07);
}
.brand-logos {
    display: grid;
    gap: 0.7rem;
    padding: 0.9rem;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}
.brand-logo {
    height: auto;
    display: block;
    justify-self: center;
    max-width: 100%;
}
.brand-logo.innercom {
    width: min(100%, 205px);
    max-height: 76px;
}
.brand-logo.iwg {
    width: min(100%, 168px);
    max-height: 94px;
    border-top: 1px solid #dbe6ec;
    padding-top: 0.7rem;
}
.brand-copy {
    display: grid;
    gap: 0.25rem;
    text-align: center;
}
.brand-copy strong {
    font-size: 1.02rem;
}
.brand-copy span {
    color: #b9ccd6;
}
.language-switcher {
    display: grid;
    gap: 0.45rem;
    padding: 0.85rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
}
.language-switcher > span {
    color: #b9ccd6;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}
.language-switcher > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
}
.language-switcher a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.34rem;
    min-height: 32px;
    padding: 0.7rem 0.45rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    color: #d8e8ef;
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1;
    letter-spacing: 0.01em;
}
.language-flag {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
}
.language-flag-image {
    width: calc(1.36rem + 1px);
    height: calc(0.96rem + 1px);
    object-fit: cover;
    flex: 0 0 calc(1.36rem + 1px);
    display: block;
    border-radius: 3px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 0 0 1px rgba(9, 31, 43, 0.10);
}
.language-code {
    font-size: 0.92rem;
    line-height: 1;
}
.language-switcher a.active,
.language-switcher a:hover {
    background: #ffffff;
    color: var(--iwg-dark);
}
.nav { display: grid; gap: 0.35rem; }
.nav a {
    padding: 0.85rem 0.95rem;
    border-radius: 8px;
    color: #d8e8ef;
}
.nav a.active, .nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar-foot {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: grid;
    gap: 0.25rem;
}
.content {
    padding: 2rem;
    max-width: 1440px;
    width: 100%;
}
.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 1.55rem 1.6rem;
    background: linear-gradient(135deg, rgba(13, 135, 148, 0.12), rgba(235, 106, 61, 0.1));
    border: 1px solid rgba(13, 135, 148, 0.12);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.topbar-copy {
    min-width: 0;
}
.topbar h1 {
    font-size: clamp(1.8rem, 2vw, 2.3rem);
    margin-bottom: 0.45rem;
}
.topbar p {
    max-width: 820px;
    color: #46606f;
    margin: 0;
}
.topbar-user {
    min-width: 240px;
    margin-left: auto;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(13, 135, 148, 0.18);
    border-radius: 8px;
    background: rgba(255,255,255,0.76);
    box-shadow: 0 10px 22px rgba(19, 63, 87, 0.08);
    display: grid;
    gap: 0.2rem;
    text-align: right;
}
.topbar-user strong {
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.2;
}
.topbar-user span {
    color: #5f7684;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}
.auth-wrap {
    min-height: calc(100vh - 170px);
    display: grid;
    justify-items: center;
    align-content: start;
    padding-top: clamp(1rem, 3vh, 2.1rem);
}
.auth-card, .panel, .stat-card, .timeline-card {
    background: var(--surface);
    border: 1px solid rgba(19, 63, 87, 0.1);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.auth-card {
    width: min(760px, 100%);
    padding: 2.2rem;
}
.auth-brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.4rem;
    margin-bottom: 1.35rem;
}
.auth-brand-stack {
    display: grid;
    gap: 1rem;
}
.auth-brand-panel {
    min-width: 330px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%);
}
.auth-brand-logo {
    width: min(100%, 295px);
    max-height: 92px;
    height: auto;
    display: block;
    justify-self: center;
}
.iwg-login-logo {
    width: min(100%, 220px);
    max-height: 118px;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
}
.auth-brand-copy {
    text-align: right;
    padding-top: 0.25rem;
}
.auth-brand-text {
    max-width: 310px;
    color: var(--muted);
    line-height: 1.45;
}
.eyebrow {
    display: inline-block;
    margin-bottom: 0.75rem;
    color: var(--innercom);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
}
.panel {
    padding: 1.3rem;
    margin-bottom: 1.5rem;
}
.workspace-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #ffffff, #f7fbfc);
    border: 1px solid rgba(19, 63, 87, 0.08);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.workspace-banner h2 {
    font-size: 1.8rem;
    margin-bottom: 0.45rem;
}
.workspace-banner p {
    margin: 0;
    color: var(--muted);
    max-width: 780px;
    line-height: 1.5;
}
.panel-head, .hero-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.hero-strip {
    background: linear-gradient(135deg, #ffffff, #f7fbfc);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.4rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.stats-grid, .two-col, .three-col {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-grid.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-grid.four-up { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-col { grid-template-columns: 1fr 1fr 1.2fr; }
.stat-card {
    padding: 1.4rem;
    border-top: 4px solid rgba(13, 135, 148, 0.22);
}
.stat-card.compact {
    padding: 1.1rem 1.2rem;
}
.stat-card span { color: var(--muted); display: block; margin-bottom: 0.4rem; }
.stat-card strong { font-size: 2rem; }
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #edf4f7;
}
.badge.open, .badge.en_rango { color: var(--success); background: rgba(36, 132, 93, 0.12); }
.badge.closed { color: #38526a; background: rgba(56, 82, 106, 0.12); }
.badge.on_hold, .badge.en_riesgo { color: var(--danger); background: rgba(181, 72, 72, 0.12); }
.badge.fuera_de_rango {
    color: #fff;
    background: #b54848;
    box-shadow: 0 6px 16px rgba(181, 72, 72, 0.20);
}
.badge.pendiente { color: #8a6700; background: rgba(200, 151, 0, 0.14); }
.table-wrap { overflow: auto; }
.table-wrap table {
    min-width: 720px;
}
.subsection-grid {
    margin-top: 1rem;
}
.subsection {
    padding: 1rem 0 0;
    border-top: 1px solid var(--border);
}
.inline-metric {
    display: inline-flex;
    min-width: 36px;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-weight: 800;
}
.inline-metric.ok {
    background: rgba(36, 132, 93, 0.12);
    color: var(--success);
}
.inline-metric.danger {
    background: rgba(181, 72, 72, 0.12);
    color: var(--danger);
}
.stack { display: grid; gap: 0.8rem; }
.grid-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.grid-form .full, .actions { grid-column: 1 / -1; }
.inline-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.filter-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr auto;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8fbfd;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.timeline-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.timeline-card {
    padding: 1.1rem;
}
.planner-layout {
    display: grid;
    grid-template-columns: 1.05fr 1.25fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.planner-sections {
    display: grid;
    gap: 1rem;
}
.planner-section {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fbfd;
}
.planner-section h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}
.planner-section p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}
.planner-mode-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
.planner-radio {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}
.planner-radio input {
    width: 18px;
    height: 18px;
    margin: 0;
}
.planner-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}
.planner-summary-card {
    padding: 1rem 1.05rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fbfd;
    min-width: 0;
}
.planner-summary-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
}
.planner-summary-card strong {
    display: block;
    font-size: 1.25rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.planner-status-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border-radius: 999px;
    padding: 0.36rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: normal;
}
.planner-status-pill.ok {
    background: rgba(36, 132, 93, 0.12);
    color: var(--success);
}
.planner-status-pill.warning {
    background: rgba(200, 151, 0, 0.14);
    color: #8a6700;
}
.planner-status-pill.danger {
    background: rgba(181, 72, 72, 0.14);
    color: var(--danger);
}
.planner-status-pill.muted {
    background: #edf4f7;
    color: #5f7485;
}
.planner-actions-list {
    margin: 0;
    padding-left: 1.15rem;
    display: grid;
    gap: 0.55rem;
}
.planner-actions-list li {
    color: var(--text);
}
.planner-helper {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}
.planner-recent-table td small {
    color: var(--muted);
    display: block;
    margin-top: 0.2rem;
}
.planner-recent-table th,
.planner-recent-table td {
    min-width: 120px;
}
.planner-recent-table th:first-child,
.planner-recent-table td:first-child {
    min-width: 180px;
}
.planner-empty {
    margin: 0;
    color: var(--muted);
}
.visual-timeline-panel {
    margin-bottom: 1.5rem;
}
.visual-timeline {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 1fr);
    gap: 1rem;
    overflow-x: auto;
    padding: 0.25rem 0.25rem 0.75rem;
    scroll-snap-type: x proximity;
}
.visual-step {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    min-height: 100%;
    padding: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(180deg, #fbfdfe 0%, #ffffff 100%);
    scroll-snap-align: start;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.visual-step:not(.current):not(.selected):hover,
.visual-step:not(.current):not(.selected):focus-visible {
    border-color: rgba(13, 135, 148, 0.45);
    box-shadow: 0 12px 26px rgba(13, 135, 148, 0.13);
    transform: translateY(-2px);
    background: linear-gradient(180deg, #f5fbfc 0%, #ffffff 100%);
    outline: none;
}
.visual-step:not(.current):not(.selected):hover .visual-step-marker,
.visual-step:not(.current):not(.selected):focus-visible .visual-step-marker {
    background: rgba(13, 135, 148, 0.12);
    color: var(--iwg-dark);
}
.visual-step::after {
    content: "";
    position: absolute;
    top: 1.75rem;
    left: calc(100% - 0.15rem);
    width: 1rem;
    height: 2px;
    background: var(--border);
}
.visual-step:last-child::after {
    display: none;
}
.visual-step-marker {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: #edf4f7;
    color: var(--muted);
}
.visual-step.done .visual-step-marker {
    background: rgba(36, 132, 93, 0.14);
    color: var(--success);
}
.visual-step.risk .visual-step-marker,
.visual-step.blocked .visual-step-marker {
    background: rgba(181, 72, 72, 0.14);
    color: var(--danger);
}
.visual-step.current,
.visual-step.current.selected {
    border-color: rgba(235, 106, 61, 0.55);
    box-shadow: 0 12px 28px rgba(235, 106, 61, 0.12);
}
.visual-step.current .visual-step-marker,
.visual-step.current.selected .visual-step-marker {
    background: var(--innercom);
    color: #fff;
}
.visual-step.selected:not(.current) {
    border-color: rgba(13, 135, 148, 0.45);
    box-shadow: 0 12px 26px rgba(13, 135, 148, 0.13);
    background: linear-gradient(180deg, #f5fbfc 0%, #ffffff 100%);
}
.visual-step.selected:not(.current) .visual-step-marker {
    background: rgba(13, 135, 148, 0.12);
    color: var(--iwg-dark);
}
.visual-step-body {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
    grid-template-rows: minmax(3.2rem, auto) 2rem auto auto auto auto;
    align-content: start;
}
.visual-step-topline,
.visual-step-statusline,
.visual-step-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}
.visual-step-statusline {
    min-height: 2rem;
}
.visual-step h3 {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.25;
    align-self: start;
}
.visual-step-topline {
    min-height: 1.25rem;
    align-self: start;
}
.visual-step-meta {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
    align-self: start;
}
.visual-step-signals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    align-self: start;
}
.mini-signal {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.26rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0;
}
.mini-signal.ready {
    background: rgba(36, 132, 93, 0.12);
    color: var(--success);
}
.mini-signal.pending {
    background: rgba(235, 106, 61, 0.10);
    color: #8f4327;
}
.mini-signal.partial {
    background: rgba(13, 135, 148, 0.10);
    color: var(--iwg-dark);
}
.mini-signal.urgent {
    background: rgba(181, 72, 72, 0.16);
    color: #a1222c;
    box-shadow: inset 0 0 0 1px rgba(181, 72, 72, 0.18);
}
.visual-step-reference,
.visual-step-focus {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.4;
    align-self: start;
}
.visual-step-reference {
    color: var(--muted);
}
.visual-step-focus {
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    background: rgba(235, 106, 61, 0.10);
    color: #8f4327;
    font-weight: 700;
}
.visual-step.blocked .visual-step-focus {
    background: rgba(181, 72, 72, 0.12);
    color: #8f1f2c;
    box-shadow: inset 0 0 0 1px rgba(181, 72, 72, 0.16);
}
.timeline-picker-ready .timeline-editor-grid {
    grid-template-columns: minmax(0, 1fr);
}
.timeline-picker-ready .event-editor-card {
    display: none;
}
.timeline-picker-ready .event-editor-card.active {
    display: block;
}
.event-editor-card {
    scroll-margin-top: 1rem;
    padding: 0;
    overflow: hidden;
}
.event-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.2rem 1.35rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #ffffff 0%, #f7fbfd 100%);
}
.event-editor-head > div {
    min-width: 0;
}
.event-editor-head h3 {
    margin: 0.25rem 0 0;
    font-size: 1.35rem;
    line-height: 1.2;
}
.event-editor-head .group {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(13, 135, 148, 0.08);
    color: var(--iwg-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}
.event-editor-head .field-hint {
    max-width: 430px;
    text-align: right;
}
.event-context-suggestion {
    display: grid;
    gap: 0.35rem;
    padding: 0.95rem 1.35rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fbfeff 0%, #f3fbfc 100%);
}
.event-context-suggestion strong {
    color: var(--iwg-dark);
}
.event-context-suggestion p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}
.event-context-checklist {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--iwg-dark);
    display: grid;
    gap: 0.35rem;
}
.event-context-checklist li {
    line-height: 1.4;
}
.event-warning-note {
    display: grid;
    gap: 0.35rem;
    padding: 0.95rem 1.35rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fff9f6 0%, #fff4ee 100%);
}
.event-warning-note strong {
    color: #9b5a3c;
}
.prediction-urgent-note {
    background: linear-gradient(180deg, #fff7f7 0%, #ffecec 100%);
    border: 1px solid rgba(181, 72, 72, 0.14);
    margin: 0 1.5rem 1.1rem;
    border-radius: 8px;
}
.prediction-urgent-note strong {
    color: #8f1f2c;
}
.event-warning-list {
    margin: 0;
    padding-left: 1.15rem;
    color: #8f4327;
    display: grid;
    gap: 0.35rem;
}
.event-warning-list li {
    line-height: 1.4;
}
.event-editor-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
    padding: 1.25rem 1.35rem;
}
.event-editor-fields {
    display: grid;
    grid-column: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: end;
}
.event-editor-fields .wide {
    grid-column: span 2;
}
.event-editor-fields textarea {
    min-height: 92px;
    resize: vertical;
}
.event-editor-actions {
    display: grid;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-items: end;
    gap: 0.75rem;
}
.event-editor-actions button {
    min-width: 180px;
    min-height: 48px;
}
.event-completion-panel {
    display: grid;
    grid-column: 1;
    gap: 0.9rem;
    justify-items: end;
    padding-top: 0.1rem;
}
.completion-toggle-inline {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid rgba(13, 135, 148, 0.2);
    border-radius: 8px;
    background: #ffffff;
    font-weight: 800;
    color: var(--iwg-dark);
}
.completion-toggle-inline input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
}
.notification-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: start;
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(13, 135, 148, 0.18);
    border-radius: 8px;
    background: linear-gradient(180deg, #fbfeff 0%, #f5fbfc 100%);
}
.notification-fields .field-hint {
    grid-column: 1 / -1;
}
.notification-cc-grid {
    margin-top: 0.55rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.notification-cc-groups {
    display: grid;
    gap: 0.95rem;
    margin-top: 0.55rem;
}
.notification-cc-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.notification-cc-tab {
    min-width: 92px;
    min-height: 38px;
    padding: 0.55rem 0.9rem;
    border: 1px solid rgba(13, 135, 148, 0.18);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    font-weight: 800;
}
.notification-cc-tab.active {
    border-color: rgba(13, 135, 148, 0.45);
    background: rgba(13, 135, 148, 0.08);
    color: var(--iwg-dark);
}
.notification-cc-group {
    display: grid;
    gap: 0.55rem;
}
.notification-cc-group:not(.active) {
    display: none;
}
.notification-cc-group-label {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(13, 135, 148, 0.08);
    color: var(--iwg-dark);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.notification-cc-row {
    padding: 0.7rem 0.85rem;
    font-weight: 600;
    background: #ffffff;
}
.notification-cc-row strong {
    font-size: 0.95rem;
    color: var(--text);
}
.notification-cc-row .field-hint {
    font-size: 0.84rem;
}
.installation-detail-panel {
    display: grid;
    grid-column: 1;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid rgba(13, 135, 148, 0.18);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}
.bom-provider-summary-strip {
    margin-bottom: 1rem;
    padding: 0.95rem 1.05rem;
    border: 1px solid rgba(13, 135, 148, 0.18);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(15, 147, 181, 0.07), rgba(21, 111, 121, 0.04));
}
.bom-provider-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}
.bom-provider-summary-head strong {
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text);
}
.bom-provider-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}
.bom-provider-pill {
    padding: 0.8rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(13, 135, 148, 0.15);
    background: rgba(255, 255, 255, 0.92);
}
.bom-provider-pill-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
}
.bom-provider-pill strong {
    display: block;
    font-size: 0.98rem;
    line-height: 1.3;
    color: var(--text);
    overflow-wrap: anywhere;
}
.bom-provider-pill .mini-signal {
    margin-top: 0.55rem;
}
.bom-editor-layout {
    display: grid;
    grid-column: 1;
    gap: 1rem;
}
.bom-provider-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.bom-provider-card {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid rgba(13, 135, 148, 0.18);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fcfd 100%);
}
.bom-provider-card.secondary {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
}
.bom-provider-card-head {
    display: grid;
    gap: 0.2rem;
}
.bom-provider-card-head strong {
    font-size: 1rem;
}
.bom-provider-card-grid,
.bom-shared-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: end;
}
.bom-provider-card-grid .wide,
.bom-shared-grid .wide {
    grid-column: 1 / -1;
}
.bom-shared-panel {
    margin-top: 0;
}
.link-process-panel {
    margin-top: 0.15rem;
}
.installation-detail-head {
    display: grid;
    gap: 0.2rem;
}
.ooma-detail-panel {
    gap: 1rem;
    background: linear-gradient(180deg, #fbfeff 0%, #f5fbfc 100%);
}
.ooma-detail-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 1rem;
}
.ooma-detail-head-copy {
    display: grid;
    gap: 0.28rem;
}
.ooma-link-button {
    align-self: start;
    min-width: 220px;
    justify-content: center;
}
.ooma-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}
.ooma-summary-pill {
    display: grid;
    gap: 0.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(13, 135, 148, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
}
.ooma-summary-label {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
}
.ooma-summary-pill strong {
    font-size: 0.98rem;
    line-height: 1.3;
    color: var(--text);
}
.ooma-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.installation-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: end;
}
.inline-flag {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 48px;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfdfe;
    font-weight: 700;
}
.inline-flag input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}
.event-upload-inline {
    display: grid;
    grid-column: 1;
    padding: 0.95rem 1rem;
    border: 1px dashed rgba(13, 135, 148, 0.32);
    border-radius: 8px;
    background: #f8fbfd;
}
.event-upload-inline label {
    margin: 0;
}
.event-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
    padding: 1rem 1.35rem 1.25rem;
    border-top: 1px solid var(--border);
    background: #f8fbfd;
}
.event-upload-form label {
    margin: 0;
}
.event-upload-form button {
    min-height: 48px;
}
@media (max-width: 900px) {
    .bom-provider-summary-grid {
        grid-template-columns: 1fr;
    }
}
.event-unlock-form {
    padding: 0 1.35rem 1.25rem;
    display: flex;
    justify-content: flex-end;
}
.card-head {
    display: grid;
    gap: 0.25rem;
    margin-bottom: 0.8rem;
}
.compact-form { margin-bottom: 1rem; }
.admin-form-panel {
    display: grid;
    align-content: start;
    gap: 1rem;
}
.admin-catalog-panel {
    display: grid;
    align-content: start;
    gap: 1rem;
}
.catalog-stack {
    display: grid;
    gap: 1.25rem;
}
.catalog-section {
    padding: 1.45rem;
}
.catalog-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}
.catalog-section-head h2 {
    margin-bottom: 0.35rem;
    font-size: 1.55rem;
}
.catalog-section-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    max-width: 760px;
}
.section-count {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--iwg-dark);
    font-weight: 700;
}
.catalog-section-body {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1.2rem;
    align-items: start;
}
.providers-layout {
    grid-template-columns: 360px minmax(0, 1fr);
}
.catalog-editor-pane {
    padding: 1rem;
    background: linear-gradient(180deg, #f9fcfd 0%, #ffffff 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.catalog-list-pane {
    min-width: 0;
}
.catalog-filter-bar {
    margin-bottom: 0.9rem;
    padding: 0.9rem 1rem;
    background: #f8fbfd;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.catalog-filter-bar label {
    max-width: 280px;
}
.catalog-table strong {
    font-size: 1rem;
}
.table-subtext {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.9rem;
}
.soft-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: var(--surface-alt);
    color: #5a7180;
    font-weight: 700;
}
.soft-chip.wide {
    white-space: normal;
    line-height: 1.25;
}
.catalog-editor {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.section-copy {
    color: var(--muted);
    line-height: 1.45;
    margin-bottom: 1rem;
}
.section-copy.tight {
    margin-top: -0.35rem;
    margin-bottom: 1rem;
}
.catalog-list-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}
.simple-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.55rem;
}
.simple-list li {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
}
.catalog-list {
    gap: 0;
}
.knowledge-layout {
    display: grid;
    grid-template-columns: 430px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}
.knowledge-layout.viewer-only {
    grid-template-columns: minmax(0, 1fr);
}
.knowledge-editor {
    position: sticky;
    top: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}
.knowledge-content {
    display: grid;
    gap: 1rem;
    min-width: 0;
}
.knowledge-search {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) auto;
    gap: 0.75rem;
    align-items: end;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbfd 100%);
    box-shadow: var(--shadow);
}
.knowledge-category-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}
.knowledge-summary {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    margin-left: auto;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--muted);
}
.knowledge-summary strong {
    color: var(--iwg-dark);
}
.knowledge-grid {
    display: grid;
    gap: 1rem;
}
.knowledge-article {
    position: relative;
    display: grid;
    gap: 1rem;
    padding: 1.35rem 1.45rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.knowledge-article::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--iwg), var(--iwg-dark));
}
.knowledge-article-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}
.knowledge-article-head h3 {
    margin: 0.6rem 0 0;
    font-size: 1.45rem;
    line-height: 1.2;
}
.knowledge-body {
    color: var(--muted);
    line-height: 1.7;
    font-size: 1rem;
}
.translation-panel {
    display: grid;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfdfe;
}
.translation-panel summary {
    cursor: pointer;
    color: var(--iwg-dark);
    font-weight: 800;
}
.translation-panel[open] summary {
    margin-bottom: 0.75rem;
}
.translation-panel label + label {
    margin-top: 0.85rem;
}
.active-chip {
    background: rgba(13, 135, 148, 0.12);
    color: var(--iwg-dark);
}
.catalog-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
}
.catalog-row-main {
    display: grid;
    gap: 0.45rem;
}
.catalog-row-main strong {
    font-size: 1.05rem;
}
.catalog-meta {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    flex-wrap: wrap;
    color: var(--muted);
}
.catalog-meta span:not(.badge) {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--surface-alt);
}
.row-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.row-actions.end {
    justify-content: flex-end;
    flex-wrap: nowrap;
    min-width: max-content;
}
.row-actions > .button-secondary,
.row-actions > form > .button-secondary,
.row-actions > form > .button-danger,
.row-actions > button {
    min-width: 104px;
    justify-content: center;
}
.row-actions.end > .button-secondary,
.row-actions.end > form > .button-secondary,
.row-actions.end > form > .button-danger,
.row-actions.end > button {
    min-width: 44px;
}
.icon-button {
    min-width: 44px !important;
    width: 44px;
    height: 44px;
    padding: 0;
}
.icon-mark {
    font-size: 1.1rem;
    line-height: 1;
}
.row-actions form {
    margin: 0;
    display: inline-flex;
}
.inline-delete-form {
    margin-top: 0.75rem;
}
.inline-delete-form button {
    width: 100%;
}
.selection-list {
    display: grid;
    gap: 0.65rem;
}
.selection-list.single-select {
    margin-top: 0.25rem;
}
.selection-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfdfe;
    font-weight: 700;
}
.selection-row:hover,
.selection-card:hover {
    border-color: rgba(13, 135, 148, 0.3);
    background: #ffffff;
}
.selection-row input[type="checkbox"],
.selection-card input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
}
.field-block {
    display: grid;
    gap: 0.3rem;
}
.field-block h3 {
    margin: 0;
    font-size: 1rem;
}
.field-hint {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
}
.top-gap {
    margin-top: 1rem;
}
.auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem 1.2rem;
    margin-top: 1rem;
}
.email-preview-frame {
    width: 100%;
    min-height: 960px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}
.auth-links a {
    font-weight: 700;
}
.auth-panel-narrow {
    max-width: 720px;
}
.expected-origin-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
}
.expected-origin-chip.auto {
    background: rgba(15, 147, 181, 0.08);
    color: var(--iwg-dark);
}
.expected-origin-chip.manual {
    background: rgba(36, 132, 93, 0.10);
    color: var(--success);
}
.country-selector-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
.selection-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfdfe;
    font-weight: 700;
}
.event-permission-card {
    grid-template-columns: 1fr;
    align-items: stretch;
}
.event-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
}
.event-field-permissions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-weight: 600;
    color: var(--muted);
}
.event-field-permissions label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
}
.event-field-permissions input[type="checkbox"] {
    width: 16px;
    height: 16px;
}
.timeline-event-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.timeline-event-grid .event-permission-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
    align-items: stretch;
    padding: 0.85rem;
}
.timeline-event-grid .event-toggle {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.25;
}
.timeline-event-grid .event-toggle span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.timeline-event-grid .event-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
}
.timeline-event-grid .event-field-permissions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 0.6rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
}
.timeline-event-grid .event-field-permissions label {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.2;
    font-weight: 600;
    color: var(--muted);
}
.timeline-event-grid .event-field-permissions input[type="checkbox"] {
    flex: 0 0 auto;
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
}
.timeline-event-grid .event-field-permissions span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.table-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.bom-summary-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.55rem;
}
.bom-summary-title {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}
.bom-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.26rem 0.58rem;
    border-radius: 999px;
    background: rgba(15, 147, 181, 0.08);
    color: var(--iwg-dark);
    font-size: 0.76rem;
    font-weight: 700;
}
.bom-summary-chip.undefined {
    background: rgba(235, 106, 61, 0.08);
    color: #8f4327;
}
.bom-summary-chip.defined {
    background: rgba(36, 132, 93, 0.10);
    color: var(--success);
}
.expected-source-chip.auto {
    background: rgba(15, 147, 181, 0.08);
    color: var(--iwg-dark);
}
.expected-source-chip.manual {
    background: rgba(36, 132, 93, 0.10);
    color: var(--success);
}
.tight-grid {
    margin-bottom: 0.85rem;
}
.permission-note {
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--iwg);
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fbfd 0%, #ffffff 100%);
    color: var(--muted);
    line-height: 1.5;
}
.permission-note strong {
    color: var(--text);
}
.permission-group-list {
    display: grid;
    gap: 1rem;
}
.users-top-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.users-top-grid > .panel,
.roles-workspace > .panel {
    min-width: 0;
}
.users-table-wrap {
    max-height: 780px;
    overflow: auto;
}
.users-table {
    width: 100%;
    table-layout: fixed;
    min-width: 0 !important;
}
.users-table th,
.users-table td {
    vertical-align: top;
    padding: 0.8rem 0.75rem;
    font-size: 0.94rem;
}
.users-table th {
    font-size: 0.78rem;
    line-height: 1.2;
}
.users-table th:nth-child(1),
.users-table td:nth-child(1) {
    width: 19%;
}
.users-table th:nth-child(2),
.users-table td:nth-child(2) {
    width: 25%;
}
.users-table th:nth-child(3),
.users-table td:nth-child(3) {
    width: 23%;
}
.users-table th:nth-child(4),
.users-table td:nth-child(4),
.users-table th:nth-child(5),
.users-table td:nth-child(5) {
    width: 9%;
}
.users-table th:nth-child(6),
.users-table td:nth-child(6) {
    width: 15%;
}
.users-table td {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.users-table .muted {
    display: block;
    margin-top: 0.15rem;
}
.users-top-grid .panel {
    overflow: hidden;
}
.roles-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.roles-sidebar {
    align-self: start;
}
.roles-main {
    min-width: 0;
}
.preset-picker {
    display: grid;
    gap: 0.55rem;
    margin-bottom: 0.5rem;
}
.preset-hint {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}
.permission-group {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(180deg, #fbfdfe 0%, #ffffff 100%);
    padding: 1rem;
}
.roles-main .permission-group {
    padding: 1rem 1.1rem;
}
.permission-group-head {
    margin-bottom: 0.85rem;
}
.permission-group-head h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}
.permission-group-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}
.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
.roles-main .timeline-event-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.8rem;
}
.roles-main .timeline-event-grid .event-permission-card {
    padding: 0.8rem;
}
.roles-main .timeline-event-grid .event-field-permissions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem 0.6rem;
}
.roles-main .timeline-event-grid .event-field-permissions label {
    font-size: 0.76rem;
}
.roles-sidebar .table-wrap {
    max-height: 520px;
    overflow: auto;
}
.json-preview {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
}
.detail-list {
    margin: 0;
    display: grid;
    gap: 0.75rem;
}
.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.detail-list dt {
    color: var(--muted);
    font-weight: 700;
}
.detail-list dd {
    margin: 0;
    text-align: right;
    font-weight: 700;
}
.context-provider-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.2rem;
}
.context-provider-card {
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    box-shadow: var(--shadow);
}
.context-provider-card span {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.context-provider-card strong {
    display: block;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.35;
}
.context-provider-card.undefined {
    background: #fbfcfd;
}
.context-provider-card.undefined strong {
    color: #6f8593;
}
.context-provider-card.defined {
    border-color: rgba(15, 147, 181, 0.22);
}
.context-provider-card.voice-cloud {
    border-color: rgba(21, 111, 121, 0.26);
    background: linear-gradient(180deg, #f5fbfb 0%, #ffffff 100%);
}
.context-provider-card.voice-cloud strong {
    color: var(--innercom);
}
.providers li span { max-width: 55%; text-align: right; }
.check, .check-grid { font-weight: 400; }
.inline-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.8rem;
}
.check input { width: auto; margin-right: 0.45rem; }
.alert {
    padding: 0.9rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 700;
}
.alert.success { background: rgba(36, 132, 93, 0.1); color: var(--success); }
.alert.error { background: rgba(181, 72, 72, 0.1); color: var(--danger); }

@media (max-width: 1100px) {
    .three-col, .two-col, .timeline-grid, .stats-grid, .grid-form, .filter-grid, .country-selector-grid, .catalog-section-body, .providers-layout, .permission-grid, .knowledge-layout, .knowledge-search, .users-top-grid, .roles-workspace, .planner-layout, .planner-summary-grid, .planner-mode-row {
        grid-template-columns: 1fr;
    }
    .context-provider-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .installation-detail-grid {
        grid-template-columns: 1fr;
    }
    .ooma-detail-head {
        grid-template-columns: 1fr;
    }
    .ooma-link-button {
        min-width: 0;
        width: 100%;
    }
    .ooma-summary-strip,
    .ooma-detail-grid {
        grid-template-columns: 1fr;
    }
    .bom-provider-columns,
    .bom-provider-card-grid,
    .bom-shared-grid {
        grid-template-columns: 1fr;
    }
    .knowledge-editor {
        position: static;
    }
    .event-editor-form,
    .event-upload-form {
        grid-template-columns: 1fr;
    }
    .event-editor-fields,
    .event-upload-inline,
    .event-editor-actions {
        grid-column: auto;
        grid-row: auto;
    }
    .notification-fields,
    .notification-cc-grid {
        grid-template-columns: 1fr;
    }
    .notification-cc-tabs {
        width: 100%;
    }
    .notification-cc-tab {
        flex: 1 1 0;
    }
    .event-editor-actions button,
    .event-upload-form button {
        width: 100%;
    }
    .event-editor-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .roles-main .timeline-event-grid .event-field-permissions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
    .context-provider-summary {
        grid-template-columns: 1fr;
    }
    .sidebar {
        gap: 1rem;
    }
    .content {
        padding: 1rem;
    }
    .topbar,
    .panel-head, .hero-strip, .inline-form, .workspace-banner {
        flex-direction: column;
        align-items: stretch;
    }
    .topbar-user {
        min-width: 0;
        width: 100%;
        margin-left: 0;
        text-align: left;
    }
    .catalog-row {
        grid-template-columns: 1fr;
    }
    .knowledge-article-head,
    .knowledge-category-strip {
        flex-direction: column;
        align-items: flex-start;
    }
    .knowledge-summary {
        margin-left: 0;
    }
    .auth-brand {
        flex-direction: column;
        align-items: flex-start;
    }
    .auth-brand-panel {
        min-width: 0;
        width: 100%;
    }
    .auth-brand-logo,
    .iwg-login-logo {
        width: min(100%, 280px);
    }
    .auth-brand-copy {
        text-align: left;
    }
    .event-editor-head {
        flex-direction: column;
        gap: 0.75rem;
    }
    .event-editor-head .field-hint {
        max-width: none;
        text-align: left;
    }
    .event-editor-fields {
        grid-template-columns: 1fr;
    }
    .event-editor-fields .wide {
        grid-column: auto;
    }
}
