:root {
    --bg: #f4f8fb;
    --bg-soft: #e9f2f8;
    --card: #ffffff;
    --text: #163047;
    --muted: #506a80;
    --border: #cddce8;
    --primary: #1337d6;
    --primary-dark: #0f2ca8;
    --secondary: #e31e24;
    --danger: #bf3f3f;
    --warning: #d28700;
    --ok: #2a8748;
    --shadow: 0 10px 30px rgba(17, 54, 82, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Avenir Next", "Trebuchet MS", "Lucida Sans", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 0%, #e7f2fb 0%, transparent 35%),
        radial-gradient(circle at 85% 15%, #eef8f1 0%, transparent 32%),
        var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html {
    scroll-behavior: smooth;
}

body.portal-shell {
    background:
        radial-gradient(circle at 10% 5%, #dceeff 0%, transparent 35%),
        radial-gradient(circle at 85% 12%, #e6f5ea 0%, transparent 34%),
        linear-gradient(180deg, #f4f9ff 0%, #eef6fb 50%, #f7fbff 100%);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    background: #ebf3f8;
    border: 1px solid #d6e5f0;
    border-radius: 6px;
    padding: 2px 5px;
    font-family: "Menlo", "Consolas", monospace;
    font-size: 0.9rem;
}

.container {
    width: min(1180px, 92vw);
    margin: 0 auto;
}

.portal-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.portal-bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(8px);
    opacity: 0.33;
    animation: portalFloat 14s ease-in-out infinite;
}

.portal-bg-shape-a {
    width: 360px;
    height: 360px;
    top: -110px;
    right: -70px;
    background: radial-gradient(circle, rgba(23, 90, 173, 0.5), rgba(23, 90, 173, 0.02));
}

.portal-bg-shape-b {
    width: 420px;
    height: 420px;
    left: -160px;
    bottom: -190px;
    background: radial-gradient(circle, rgba(227, 30, 36, 0.36), rgba(227, 30, 36, 0.03));
    animation-delay: -3.4s;
}

.portal-bg-shape-c {
    width: 240px;
    height: 240px;
    left: 36%;
    top: 34%;
    background: radial-gradient(circle, rgba(58, 140, 87, 0.3), rgba(58, 140, 87, 0.03));
    animation-delay: -7s;
}

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid #d5e5f2;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(13px);
    box-shadow: 0 10px 22px rgba(18, 52, 80, 0.08);
}

.portal-topbar-inner {
    min-height: 94px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text);
    text-decoration: none;
}

.portal-brand:hover {
    text-decoration: none;
}

.portal-logo {
    display: block;
    max-height: 62px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 5px 8px rgba(18, 37, 62, 0.14));
}

.portal-brand-text {
    display: grid;
    gap: 0.15rem;
}

.portal-brand-text strong {
    font-size: 1.12rem;
    line-height: 1.1;
}

.portal-brand-text small {
    color: #4d6d83;
    font-size: 0.85rem;
    font-weight: 700;
}

.portal-help-btn {
    font-weight: 700;
    min-width: 186px;
    border-radius: 999px;
    border-color: #9dbdd7;
    background: rgba(255, 255, 255, 0.94);
}

.portal-page {
    padding-top: 1.4rem;
    padding-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

.portal-layout {
    margin: 0;
}

.portal-entry,
.portal-result-shell {
    display: grid;
    gap: 1rem;
    width: min(1060px, 100%);
    margin: 0 auto;
}

.portal-result-shell-split {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    align-items: start;
}

.portal-fade-in {
    animation: portalSceneIn 0.5s ease both;
}

.portal-layout .portal-card {
    animation: portalFadeUp 0.55s ease both;
}

.portal-layout .portal-card:nth-child(2) {
    animation-delay: 0.07s;
}

.portal-layout .portal-card:nth-child(3) {
    animation-delay: 0.14s;
}

.portal-layout .portal-card:nth-child(4) {
    animation-delay: 0.2s;
}

.portal-card {
    border: 1px solid #c8deed;
    box-shadow: 0 18px 42px rgba(16, 56, 88, 0.14);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    padding: 1.2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.portal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 48px rgba(16, 56, 88, 0.18);
    border-color: #b8d3e5;
}

.portal-card h1 {
    margin-bottom: 0.4rem;
}

.portal-hero-banner {
    background: linear-gradient(132deg, #eef6ff 0%, #e7f2ff 46%, #eaf8f3 100%);
    color: #163047;
    border-color: #c2d9ea;
    box-shadow: 0 18px 36px rgba(16, 56, 88, 0.14);
}

.portal-hero-banner .eyebrow,
.portal-hero-banner .lead {
    color: #2d556f;
}

.portal-hero-banner h1 {
    margin-bottom: 0.38rem;
}

.portal-hero-subline {
    margin: 0.2rem 0 0 0;
    color: #204c68;
    font-weight: 600;
    font-size: 0.97rem;
    line-height: 1.45;
}

.portal-hero-privacy-link {
    margin: 0.35rem 0 0 0;
    color: #2b5672;
}

.portal-hero-privacy-link a {
    font-weight: 700;
}

.portal-entry-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
}

.portal-form-card h2,
.portal-side-card h2 {
    margin-bottom: 0.3rem;
}

.portal-form-grid {
    margin-top: 0.55rem;
}

.portal-main-actions {
    margin-top: 0.45rem;
}

.portal-side-card {
    align-content: start;
}

.portal-voucher-card {
    background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
    border-color: #bfd6e8;
}

.portal-voucher-form {
    margin-top: 0.45rem;
    padding-top: 0.55rem;
    border-top: 1px solid #d6e7f3;
}

.portal-voucher-cta {
    margin-top: 0.5rem;
    border: 1px solid #c8deed;
    border-radius: 12px;
    padding: 0.2rem 0.7rem 0.7rem 0.7rem;
    background: linear-gradient(180deg, #f7fbff 0%, #f2f8ff 100%);
}

.portal-voucher-cta-summary {
    list-style: none;
    cursor: pointer;
    font-weight: 800;
    color: #174664;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #9dbfda;
    border-radius: 10px;
    background: #ffffff;
    min-height: 46px;
    padding: 0.52rem 0.78rem;
    margin-top: 0.3rem;
    width: 100%;
    text-align: center;
}

.portal-voucher-cta-summary::-webkit-details-marker {
    display: none;
}

.portal-voucher-cta[open] .portal-voucher-cta-summary {
    margin-bottom: 0.6rem;
    background: #eaf5ff;
}

.portal-security-note {
    margin-top: 0.75rem;
    border: 1px solid #d2e5f2;
    border-radius: 11px;
    padding: 0.72rem 0.78rem;
    background: #f5fbff;
    color: #214b64;
    line-height: 1.42;
}

.portal-extra-note {
    border-style: dashed;
    border-color: #c6dced;
}

.portal-result-card {
    width: min(840px, 100%);
    margin: 0 auto;
}

.portal-result-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    margin-bottom: 0.3rem;
}

.portal-result-head.no-icon {
    grid-template-columns: 1fr;
    gap: 0.2rem;
}

.portal-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    height: 78px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-size: 0.9rem;
    border: 1px solid transparent;
    box-shadow: 0 10px 20px rgba(18, 52, 80, 0.16);
}

.state-ok {
    background: linear-gradient(160deg, #2a8748, #2f9b55);
    color: #fff;
}

.state-pending {
    background: linear-gradient(160deg, #d28700, #e79d18);
    color: #fff;
}

.state-stop {
    background: linear-gradient(160deg, #b43d3d, #cf5050);
    color: #fff;
}

.state-denied {
    background: linear-gradient(160deg, #345d94, #4776b8);
    color: #fff;
}

.portal-result-approved .status-panel {
    background: #eaf8ef;
}

.portal-result-pending .status-panel {
    background: #fff8e4;
}

.portal-result-blocked .status-panel,
.portal-result-denied .status-panel {
    background: #fdeeee;
}

.portal-success-note {
    margin: 0.3rem 0 0.1rem 0;
    color: #1d4560;
    font-weight: 600;
}

.portal-explain-grid {
    display: grid;
    gap: 1rem;
    width: min(920px, 100%);
    margin: 0 auto;
}

.portal-privacy-grid {
    display: grid;
    gap: 1rem;
    width: min(960px, 100%);
    margin: 0 auto;
}

.portal-legal-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.4rem;
    color: #2f526a;
}

.portal-legal-list li {
    line-height: 1.45;
}

.portal-explain-actions {
    justify-content: flex-start;
}

.portal-explain-hero {
    position: relative;
    overflow: hidden;
}

.portal-explain-hero-xl {
    min-height: 200px;
}

.portal-explain-hero::after {
    content: "";
    position: absolute;
    inset: auto -12% -55% auto;
    width: 310px;
    height: 310px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(18, 79, 162, 0.2) 0%, rgba(18, 79, 162, 0) 72%);
    pointer-events: none;
}

.portal-chip-row {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

.portal-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.36rem 0.62rem;
    border-radius: 999px;
    border: 1px solid #bdd6e8;
    background: #f3f9ff;
    color: #25506a;
    font-weight: 700;
    font-size: 0.83rem;
    letter-spacing: 0.01em;
}

.portal-flow-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.6rem;
}

.portal-flow-list li {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    padding: 0.45rem 0.5rem;
    border-radius: 10px;
    background: #f7fbff;
    border: 1px solid #d4e6f3;
}

.portal-flow-list li::before {
    content: counter(portal-steps);
    counter-increment: portal-steps;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #1d47e4, #1437c5);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: 0 5px 12px rgba(20, 55, 197, 0.26);
}

.portal-flow-list {
    counter-reset: portal-steps;
}

.portal-flow-list li strong {
    grid-column: 2;
    display: block;
    color: #173d56;
    margin-bottom: 0.1rem;
}

.portal-flow-list li span {
    grid-column: 2;
    color: #395c74;
}

.portal-note-list {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.portal-note-list p {
    margin: 0;
    border: 1px solid #d5e7f4;
    border-radius: 10px;
    background: #f7fbff;
    padding: 0.62rem 0.7rem;
    line-height: 1.4;
}

.portal-faq {
    display: grid;
    gap: 0.48rem;
}

.portal-faq details {
    border: 1px solid #d2e5f2;
    border-radius: 10px;
    background: #fbfdff;
    padding: 0.3rem 0.7rem;
}

.portal-faq details[open] {
    background: #f5faff;
}

.portal-faq summary {
    cursor: pointer;
    font-weight: 700;
    color: #204b65;
    padding: 0.36rem 0;
}

.portal-faq p {
    margin: 0.1rem 0 0.55rem 0;
    color: #385a73;
}

.portal-voucher-panel {
    margin-top: 1rem;
    background: linear-gradient(180deg, #f6fbff 0%, #f1f8fd 100%);
    border-color: #c8deed;
}

.portal-voucher-panel .voucher-panel-summary {
    background: #ffffff;
    border-color: #aecadf;
    color: #1f4a66;
    font-size: 0.95rem;
}

.portal-footer {
    margin-top: auto;
    border-top: 1px solid #d0e2f1;
    background: linear-gradient(180deg, rgba(248, 252, 255, 0.92) 0%, rgba(241, 248, 253, 0.92) 100%);
    backdrop-filter: blur(7px);
}

.portal-footer-inner {
    min-height: 92px;
    display: grid;
    gap: 0.4rem;
    padding: 0.78rem 0;
    font-size: 0.94rem;
}

.portal-footer-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.portal-footer-title {
    margin: 0;
    font-weight: 800;
    color: #1c425e;
}

.portal-footer-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    color: #385d75;
    font-size: 0.88rem;
    font-weight: 600;
}

.portal-footer-actions a {
    color: #204f7a;
    font-weight: 700;
}

.portal-footer-disclaimer {
    margin: 0;
    color: #4f6d84;
    line-height: 1.35;
}

.portal-footer-disclaimer a {
    color: #1f4f7b;
    font-weight: 700;
}

@keyframes portalFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes portalFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-14px);
    }
}

@keyframes portalSceneIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-layout .portal-card {
        animation: none !important;
    }

    .portal-card {
        transition: none !important;
    }

    .btn,
    input,
    textarea,
    select {
        transition: none !important;
    }

    .portal-bg-shape {
        animation: none !important;
    }

    .portal-fade-in {
        animation: none !important;
    }
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 800;
    font-size: 1.02rem;
    line-height: 1.1;
    color: var(--text);
    text-decoration: none;
    flex: 0 0 auto;
}

.brand-label {
    display: block;
    max-width: min(42vw, 520px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-wave {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, #1337d6, #e31e24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

.brand-logo {
    height: 32px !important;
    max-height: 32px !important;
    width: auto !important;
    max-width: 120px !important;
    min-width: 0;
    object-fit: contain;
    object-position: left center;
    display: block;
    flex: 0 0 auto;
    vertical-align: middle;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}

.main-nav a {
    color: var(--text);
    font-weight: 600;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
}

.main-nav a:hover {
    background: var(--bg-soft);
    text-decoration: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 0 0 auto;
}

.user-badge {
    font-size: 0.9rem;
    color: var(--muted);
    white-space: nowrap;
}

.page {
    padding-top: 1.4rem;
    padding-bottom: 2rem;
    flex: 1 0 auto;
}

.hero {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
    color: var(--primary);
    font-weight: 700;
    margin: 0;
}

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

h1 {
    font-size: clamp(1.5rem, 2.4vw, 2.2rem);
    margin-bottom: 0.5rem;
}

.lead {
    font-size: 1.05rem;
    color: #355168;
}

.hero-actions,
.button-row,
.row-actions,
.toolbar,
.button-grid {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.grid {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

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

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

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

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.info-card {
    background: linear-gradient(145deg, #e8f4fb, #f3fbf6);
}

.quick-card {
    display: block;
    color: inherit;
}

.quick-card:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

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

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    color: var(--muted);
}

.page-header {
    margin-bottom: 1rem;
}

.board-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.board-nav-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.board-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f6fbff;
}

.board-nav a {
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    font-weight: 700;
    color: #244f6a;
}

.board-nav a:hover {
    text-decoration: none;
    background: #e9f4fc;
}

.board-nav a.active {
    background: var(--primary);
    color: #fff;
}

.admin-nav {
    background: #f9fcff;
}

.admin-subnav {
    background: #f3f9ff;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

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

.denied-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.voucher-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.audit-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-pill {
    border: 1px solid #cfe0ee;
    border-radius: 12px;
    background: #fafdff;
    padding: 0.65rem 0.75rem;
}

.summary-label {
    display: block;
    color: #517188;
    font-size: 0.82rem;
    margin-bottom: 0.2rem;
}

.summary-value {
    display: block;
    font-weight: 800;
    color: var(--primary);
    font-size: 1.3rem;
}

.summary-value-small {
    font-size: 1rem;
    line-height: 1.2;
}

.dashboard-stats-card {
    overflow: hidden;
}

.dashboard-stats-subline {
    margin-top: -0.2rem;
    margin-bottom: 0.85rem;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.dashboard-stat-card {
    display: block;
    color: inherit;
    background: linear-gradient(180deg, #fbfdff 0%, #f6fbff 100%);
    border: 1px solid #d8e7f3;
    border-radius: 12px;
    padding: 0.72rem 0.78rem;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    position: relative;
    overflow: hidden;
}

.dashboard-stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 4px;
    background: #9ab3c6;
}

.dashboard-stat-card:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(17, 54, 82, 0.11);
    border-color: #bfd4e4;
}

.dashboard-stat-label {
    display: block;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
    color: #4a677c;
    margin-bottom: 0.25rem;
}

.dashboard-stat-value {
    display: block;
    font-size: 1.58rem;
    font-weight: 800;
    color: #173d56;
    line-height: 1.05;
    margin-bottom: 0.18rem;
}

.dashboard-stat-meta {
    display: block;
    font-size: 0.8rem;
    color: #5a778c;
}

.dashboard-stat-card.stat-attention::before {
    background: #d28700;
}

.dashboard-stat-card.stat-success::before {
    background: #2a8748;
}

.dashboard-stat-card.stat-danger::before {
    background: #bf3f3f;
}

.dashboard-stat-card.stat-info::before {
    background: #2f64b8;
}

.dashboard-stat-card.stat-neutral::before {
    background: #6b7f90;
}

.admin-users-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.device-filter-grid {
    align-items: end;
}

.device-filter-actions {
    display: flex;
    gap: 0.55rem;
    align-items: center;
}

.blocked-filter-grid {
    align-items: end;
}

.blocked-filter-actions {
    display: flex;
    gap: 0.55rem;
    align-items: center;
}

.filter-trigger-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 0.3rem;
}

.filter-shell {
    margin-bottom: 0.9rem;
}

.filter-toggle-btn.btn-outline {
    min-width: 0;
    justify-content: center;
    border-color: var(--primary);
    background: linear-gradient(180deg, #1d47e4 0%, var(--primary) 100%);
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(19, 55, 214, 0.2);
}

.filter-toggle-btn.btn-outline:hover {
    background: linear-gradient(180deg, #244ee8 0%, #1230b8 100%);
    color: #ffffff;
    border-color: #1230b8;
}

.filter-toggle-btn.btn-outline.is-active,
.filter-toggle-btn.btn-outline[aria-expanded="true"] {
    background: linear-gradient(180deg, #102baf 0%, #0d2595 100%);
    border-color: #0d2595;
    color: #ffffff;
}

.filter-toggle-panel {
    margin-top: 0.5rem;
    border: 1px solid #dde9f3;
    background: #ffffff;
    border-radius: 10px;
    padding: 0.8rem 0.85rem;
    box-shadow: 0 6px 16px rgba(17, 54, 82, 0.08);
}

.filter-toggle-panel[hidden] {
    display: none !important;
}

.filter-toggle-panel.is-hidden {
    display: none;
}

.blocked-table td {
    min-width: 130px;
}

.devices-table td {
    min-width: 120px;
}

.device-action-panel > summary {
    list-style: none;
    cursor: pointer;
    border: 1px solid #b8cede;
    background: #fff;
    border-radius: 8px;
    padding: 0.38rem 0.55rem;
    font-size: 0.86rem;
    font-weight: 700;
    color: #2a5168;
    display: inline-flex;
    align-items: center;
}

.device-action-panel > summary::-webkit-details-marker {
    display: none;
}

.device-action-panel[open] > summary {
    background: #eaf5fc;
}

.audit-detail-panel > summary {
    list-style: none;
    cursor: pointer;
    border: 1px solid #c6dced;
    border-radius: 8px;
    background: #f6fbff;
    padding: 0.35rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #2a5168;
    display: inline-flex;
}

.audit-detail-panel > summary::-webkit-details-marker {
    display: none;
}

.audit-detail-panel pre {
    margin: 0.55rem 0 0 0;
    padding: 0.6rem;
    border: 1px solid #d7e6f1;
    border-radius: 8px;
    background: #fbfdff;
    font-size: 0.78rem;
    line-height: 1.35;
    overflow-x: auto;
}

.audit-table td {
    min-width: 145px;
}

.audit-table th:last-child,
.audit-table td:last-child {
    min-width: 140px;
}

.audit-time-cell {
    white-space: nowrap;
}

.audit-action-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.24rem 0.62rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.audit-action-success {
    background: #dff4e6;
    color: #1f7a41;
}

.audit-action-danger {
    background: #fde1e1;
    color: #9a3131;
}

.audit-action-info {
    background: #e7edf3;
    color: #3e5a72;
}

.audit-actor-title,
.audit-target-title {
    font-weight: 700;
}

.audit-summary-list {
    margin: 0;
    padding-left: 1rem;
    display: grid;
    gap: 0.2rem;
}

.audit-summary-list-modal {
    gap: 0.35rem;
}

.audit-detail-grid {
    margin-top: 0.55rem;
    display: grid;
    grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
    border: 1px solid #d7e6f1;
    border-radius: 10px;
    overflow: hidden;
}

.audit-detail-key,
.audit-detail-value {
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid #e3edf5;
}

.audit-detail-grid > .audit-detail-key:nth-last-child(2),
.audit-detail-grid > .audit-detail-value:last-child {
    border-bottom: none;
}

.audit-detail-key {
    background: #f6fbff;
    color: #395c76;
    font-size: 0.78rem;
    font-weight: 700;
    border-right: 1px solid #e3edf5;
}

.audit-detail-value {
    font-size: 0.84rem;
    color: #1f3446;
    word-break: break-word;
}

.audit-raw-panel {
    margin-top: 0.6rem;
}

.audit-raw-panel > summary {
    cursor: pointer;
    color: #2a5168;
    font-size: 0.8rem;
    font-weight: 700;
}

.audit-raw-panel pre {
    margin-top: 0.45rem;
}

.user-table td {
    min-width: 120px;
}

.user-name-cell strong {
    display: block;
    margin-bottom: 0.1rem;
}

.user-table td:last-child {
    min-width: 170px;
}

.user-dialog {
    width: min(980px, 96vw);
}

.user-modal-content {
    max-height: 90vh;
    overflow-y: auto;
    padding: 1rem;
    display: grid;
    gap: 0.85rem;
}

.user-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.user-modal-grid .action-danger {
    grid-column: 1 / -1;
}

.user-modal-grid .btn {
    width: 100%;
}

.audit-dialog {
    width: min(1060px, 96vw);
}

.audit-modal-content {
    max-height: 90vh;
    overflow-y: auto;
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
}

.audit-modal-header {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: flex-start;
    border-bottom: 1px solid #deebf5;
    padding-bottom: 0.7rem;
}

.audit-modal-header h3 {
    margin: 0;
}

.audit-modal-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 0.75rem;
}

.audit-modal-card {
    border: 1px solid #d7e6f2;
    border-radius: 10px;
    background: #ffffff;
    padding: 0.75rem;
}

.audit-modal-card h4 {
    margin: 0 0 0.45rem 0;
    font-size: 0.92rem;
    color: #1f4962;
}

.audit-context-grid {
    grid-template-columns: 130px 1fr;
    gap: 0.45rem 0.65rem;
}

.decision-dialog {
    width: min(760px, 94vw);
    border: 1px solid #c8dceb;
    border-radius: 14px;
    padding: 0;
    background: #fff;
    box-shadow: 0 24px 70px rgba(19, 58, 88, 0.25);
}

.device-dialog {
    width: min(920px, 96vw);
}

.device-modal-content {
    max-height: 88vh;
    overflow-y: auto;
}

.device-modal-content .action-group .decision-footer {
    border-top: none;
    padding-top: 0;
    justify-content: flex-start;
}

.device-modal-content .action-group .btn {
    min-width: 180px;
}

.decision-dialog::backdrop {
    background: rgba(14, 33, 49, 0.48);
}

.decision-form {
    padding: 1rem;
    display: grid;
    gap: 0.8rem;
}

.decision-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.decision-header h3 {
    margin: 0;
}

.decision-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    border: 1px solid #d8e8f4;
    background: #f8fcff;
    border-radius: 10px;
    padding: 0.7rem;
    font-size: 0.92rem;
}

.decision-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
    border-top: 1px solid #deebf5;
    padding-top: 0.8rem;
}

.unblock-action-panel > summary {
    border-color: #bcd5e7;
    background: #f7fbff;
}

.unblock-action-panel[open] > summary {
    background: #e4f1fb;
}

.device-action-card {
    margin-top: 0.55rem;
    padding: 0.75rem;
    border: 1px solid #d3e3ef;
    border-radius: 10px;
    background: #f6fbff;
    display: grid;
    gap: 0.7rem;
    min-width: 280px;
}

.device-action-card .btn {
    width: 100%;
}

.action-group {
    border: 1px solid #d7e6f2;
    border-radius: 10px;
    background: #ffffff;
    padding: 0.6rem;
    display: grid;
    gap: 0.45rem;
}

.action-group h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #1f4962;
}

.action-hint {
    margin: 0;
    font-size: 0.86rem;
    color: #45657b;
}

.action-danger {
    border-color: #efc8c8;
    background: #fff8f8;
}

.blocked-modal-content {
    gap: 0.95rem;
}

.blocked-modal-header {
    align-items: flex-start;
}

.blocked-modal-subtitle {
    margin: 0.35rem 0 0 0;
    color: #4d6a80;
    font-size: 0.9rem;
}

.blocked-meta {
    background: linear-gradient(180deg, #f4f9fd 0%, #ffffff 100%);
}

.blocked-modal-group {
    padding: 0.75rem;
    gap: 0.55rem;
    border-color: #d5e5f1;
}

.blocked-modal-group h4 {
    font-size: 0.95rem;
}

.blocked-modal-group-highlight {
    border-color: #c7dff0;
    background: #f7fbff;
}

.blocked-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.blocked-quick-grid form {
    margin: 0;
}

.blocked-quick-btn {
    width: 100%;
    min-width: 0 !important;
}

.blocked-unblock-form {
    gap: 0.55rem;
}

.blocked-open-link {
    max-width: 320px;
}

.blocked-inner-footer {
    justify-content: flex-start;
}

.blocked-modal-footer {
    border-top: 1px solid #dbe9f3;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.compact-toolbar {
    margin-bottom: 0.65rem;
}

.device-activity-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.55rem;
}

.device-activity-list li {
    border: 1px solid #d8e7f2;
    border-radius: 10px;
    background: #fbfdff;
    padding: 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.form-grid {
    display: grid;
    gap: 0.65rem;
}

.form-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.compact {
    gap: 0.45rem;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.inline-form,
.inline-edit {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    flex-wrap: wrap;
}

.stretch-form input[type="number"] {
    width: 84px;
}

label {
    font-weight: 700;
    color: #2a475f;
    font-size: 0.92rem;
}

input,
textarea,
select,
button {
    font-family: inherit;
    font-size: 1rem;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #b7cada;
    background: #fbfdff;
    color: var(--text);
    border-radius: 10px;
    padding: 0.62rem 0.72rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #6fa6ca;
    box-shadow: 0 0 0 3px rgba(29, 84, 132, 0.14);
    background: #ffffff;
}

textarea {
    resize: vertical;
}

.btn {
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
    padding: 0.75rem 1rem;
    transition: transform 0.1s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(17, 54, 82, 0.14);
}

.btn-large {
    padding: 0.95rem 1.2rem;
    font-size: 1.05rem;
}

.btn-small {
    padding: 0.45rem 0.65rem;
    font-size: 0.88rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
}

.btn-secondary:hover {
    background: #b9181d;
}

.btn-outline {
    background: #fff;
    color: var(--text);
    border: 1px solid #abc1d4;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-request-edit {
    background: #ffffff;
    color: #111111;
    border: 1px solid #b3c8d8;
}

.btn-request-edit:hover {
    background: #f6fbff;
    color: #111111;
    border-color: #90b2c9;
}

.btn[disabled] {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(24, 75, 142, 0.22);
}

.flash {
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.9rem;
    font-weight: 600;
}

.flash-success {
    background: #e8f7ec;
    color: #2b6c40;
    border: 1px solid #b8e2c5;
}

.flash-error {
    background: #fdeaea;
    color: #8a2f2f;
    border: 1px solid #f4c0c0;
}

.flash-warning {
    background: #fff4de;
    color: #84520b;
    border: 1px solid #f0d59f;
}

.flash-info {
    background: #e7f2fb;
    color: #1f5a81;
    border: 1px solid #b5d7f2;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.24rem 0.62rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-pending {
    background: #fff3d3;
    color: #8e6500;
}

.badge-approved-temporary,
.badge-approved-permanent {
    background: #dff4e6;
    color: #1f7a41;
}

.badge-denied,
.badge-blocked {
    background: #fde1e1;
    color: #9a3131;
}

.badge-expired {
    background: #e7edf3;
    color: #3e5a72;
}

.badge-voucher-active {
    background: #dff4e6;
    color: #1f7a41;
}

.badge-voucher-redeemed {
    background: #e5f1fb;
    color: #2a5f8a;
}

.badge-voucher-expired {
    background: #eceff4;
    color: #475c73;
}

.badge-voucher-revoked {
    background: #fde1e1;
    color: #9a3131;
}

.badge-backup-success {
    background: #dff4e6;
    color: #1f7a41;
}

.badge-backup-warning {
    background: #fff4de;
    color: #8a5b10;
}

.badge-backup-danger {
    background: #fde1e1;
    color: #9a3131;
}

.badge-neutral {
    background: #edf1f5;
    color: #435a6c;
}

.button-grid form {
    margin: 0;
}

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

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

th,
td {
    border-bottom: 1px solid #dfebf4;
    padding: 0.62rem 0.55rem;
    text-align: left;
    vertical-align: top;
}

th {
    color: #2e4f67;
    background: #f6fafd;
}

tr:hover td {
    background: #fbfdff;
}

.voucher-table td {
    min-width: 130px;
}

.campaign-top-grid {
    grid-template-columns: 1.15fr 1fr;
}

.campaign-create-card,
.campaign-list-card,
.campaign-detail-card {
    overflow: hidden;
}

.campaign-table td {
    min-width: 120px;
}

.campaign-row-selected td {
    background: #edf6ff;
}

.campaign-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.campaign-voucher-table td {
    min-width: 125px;
}

.campaign-voucher-table td:first-child,
.campaign-voucher-table td:nth-child(2) {
    min-width: 180px;
}

.campaign-mail-batch-card {
    margin-top: 0.95rem;
}

.campaign-mail-progress {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 0.72rem;
}

.campaign-mail-progress-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #e4edf4;
    overflow: hidden;
}

.campaign-mail-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2f84b8 0%, #2ba46f 100%);
    transition: width 220ms ease;
}

.campaign-mail-progress-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
    font-size: 0.9rem;
    color: #284c63;
}

.campaign-mail-dialog {
    width: min(860px, 96vw);
}

.campaign-mail-modal-content {
    max-height: 90vh;
    overflow-y: auto;
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
}

.campaign-share-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.voucher-created-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}

.voucher-created-dialog {
    width: min(760px, 95vw);
}

.voucher-created-content {
    max-height: 88vh;
    overflow-y: auto;
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
}

.voucher-ticket-card {
    border: 1px solid #cfe2f1;
    border-radius: 12px;
    background: linear-gradient(160deg, #f8fcff 0%, #ffffff 100%);
    padding: 0.9rem;
}

.voucher-ticket-code code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0.38rem 0.55rem;
}

.voucher-ticket-code {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.voucher-copy-icon {
    height: 34px;
    min-width: 88px;
    padding: 0 0.72rem;
    flex: 0 0 auto;
    border: 1px solid #b7cfdf;
    border-radius: 8px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #35586f;
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
}

.voucher-copy-icon:hover {
    background: #eef6fc;
}

.voucher-ticket-grid {
    margin-top: 0.7rem;
    display: grid;
    grid-template-columns: 165px minmax(0, 1fr);
    gap: 0.4rem 0.65rem;
}

.voucher-ticket-grid span {
    color: #3d5f78;
    font-weight: 700;
}

.voucher-message-card {
    border: 1px solid #d7e6f2;
    border-radius: 10px;
    background: #fbfdff;
    padding: 0.75rem;
    display: grid;
    gap: 0.45rem;
}

.voucher-message-card h4 {
    margin: 0;
    color: #1f4962;
}

.voucher-advanced-panel {
    display: block;
}

.voucher-advanced-panel summary,
.voucher-mail-advanced summary {
    list-style: none;
    cursor: pointer;
    font-weight: 700;
    color: #284d66;
    display: inline-flex;
    align-items: center;
    border: 1px solid #c9dbea;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.38rem 0.68rem;
}

.voucher-advanced-panel summary::-webkit-details-marker,
.voucher-mail-advanced summary::-webkit-details-marker {
    display: none;
}

.voucher-advanced-panel[open] summary,
.voucher-mail-advanced[open] summary {
    margin-bottom: 0.5rem;
    background: #eef6fc;
}

.voucher-message-card textarea {
    font-family: "Menlo", "Consolas", monospace;
    font-size: 0.86rem;
    line-height: 1.42;
    background: #f6fbff;
    min-height: 170px;
}

.voucher-share-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.voucher-share-actions-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.voucher-share-actions .btn {
    width: 100%;
}

.voucher-mail-card input,
.voucher-mail-card textarea {
    width: 100%;
}

.voucher-mail-advanced {
    margin-top: 0.1rem;
}

.voucher-mail-advanced-fields {
    margin-top: 0.5rem;
}

.voucher-mail-actions {
    margin-top: 0.3rem;
    grid-template-columns: minmax(0, 1fr);
}

.voucher-mail-feedback {
    margin: 0.35rem 0 0;
    padding: 0;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.88rem;
    font-weight: 700;
    display: none;
}

.voucher-mail-feedback.is-visible {
    display: block;
    padding: 0.55rem 0.65rem;
}

.voucher-mail-feedback.text-success {
    background: #e8f8ee;
    border-color: #afd9bc;
    color: #1e7b41;
}

.voucher-mail-feedback.text-error {
    background: #fdecec;
    border-color: #efb8b8;
    color: #a33333;
}

.campaign-voucher-table .row-actions form {
    margin: 0;
}

.text-success {
    color: #1e7b41;
}

.text-error {
    color: #a33333;
}

.text-warning {
    color: #8a5b10;
}

.voucher-panel {
    margin-top: 0.95rem;
    border: 1px solid #d2e4f1;
    border-radius: 10px;
    background: #f7fbff;
    padding: 0.2rem 0.7rem 0.7rem 0.7rem;
}

.voucher-panel-summary {
    list-style: none;
    cursor: pointer;
    font-weight: 700;
    color: #2a5168;
    display: inline-flex;
    align-items: center;
    border: 1px solid #bcd5e7;
    border-radius: 8px;
    background: #fff;
    padding: 0.42rem 0.7rem;
    margin-top: 0.3rem;
}

.voucher-panel-summary::-webkit-details-marker {
    display: none;
}

.voucher-panel[open] .voucher-panel-summary {
    background: #eaf5fc;
    margin-bottom: 0.6rem;
}

.voucher-form {
    margin-top: 0.2rem;
}

.voucher-picker {
    margin-top: 1rem;
    border-top: 1px solid #deebf5;
    padding-top: 0.8rem;
}

.voucher-chip-grid {
    margin-top: 0.45rem;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.voucher-chip {
    text-align: left;
    justify-content: flex-start;
    display: grid;
    gap: 0.12rem;
    line-height: 1.25;
}

.auth-layout {
    display: flex;
    justify-content: center;
    margin-top: 0.8rem;
}

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

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

.context-box {
    background: #f1f8fc;
    border: 1px solid #cce3f2;
    border-radius: 10px;
    padding: 0.8rem;
    margin-bottom: 0.9rem;
}

.context-grid {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.32rem 0.7rem;
}

.status-panel {
    border-radius: 10px;
    padding: 0.8rem;
    margin: 0.9rem 0;
    border: 1px solid;
}

.status-approved {
    background: #eaf7ee;
    border-color: #bfe1cb;
}

.status-pending {
    background: #fff8e4;
    border-color: #f1dfaa;
}

.status-blocked,
.status-denied {
    background: #fdeeee;
    border-color: #efc8c8;
}

.status-info {
    background: #edf6fd;
    border-color: #c7dff2;
}

.step-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.35rem;
}

.compact-list {
    margin: 0;
    padding-left: 1rem;
    display: grid;
    gap: 0.2rem;
}

.system-status-kpis {
    margin-top: 0.5rem;
    margin-bottom: 0.55rem;
}

.system-status-main,
.system-status-secondary {
    align-items: start;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.system-status-card h3 {
    margin-top: 0.2rem;
    margin-bottom: 0.65rem;
}

.status-metric-list {
    display: grid;
    gap: 0.65rem;
}

.status-metric-row {
    display: grid;
    gap: 0.3rem;
}

.status-metric-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.93rem;
}

.status-metric-track {
    width: 100%;
    height: 9px;
    background: #e8eff5;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #d6e4ee;
}

.status-metric-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.status-metric-fill.tone-success {
    background: linear-gradient(90deg, #2a8748 0%, #3ebf69 100%);
}

.status-metric-fill.tone-warning {
    background: linear-gradient(90deg, #bd870d 0%, #e2aa2e 100%);
}

.status-metric-fill.tone-danger {
    background: linear-gradient(90deg, #ba4242 0%, #dd6666 100%);
}

.status-metric-fill.tone-info {
    background: linear-gradient(90deg, #276ba8 0%, #3f8fd4 100%);
}

.status-divider {
    margin: 1rem 0;
    border: none;
    border-top: 1px solid #dce8f2;
}

.system-status-dl {
    margin: 0;
    font-size: 0.94rem;
}

.system-status-dl dt {
    color: var(--muted);
}

.resource-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin-bottom: 0.75rem;
}

.resource-mini-tile {
    border: 1px solid #dbe7f1;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: linear-gradient(180deg, #f9fcff 0%, #f3f8fd 100%);
    display: grid;
    gap: 0.2rem;
}

.resource-title {
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
}

.mail-card {
    display: block;
    color: inherit;
}

.mail-card:hover {
    text-decoration: none;
}

.mail-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.mail-subject {
    font-weight: 800;
}

.mail-unread {
    border-left: 5px solid var(--primary);
}

.mail-html {
    background: #fcfeff;
    border: 1px solid #dbeaf5;
    border-radius: 10px;
    padding: 0.8rem;
}

.mail-text {
    background: #f7fafc;
    border: 1px solid #dae8f2;
    border-radius: 10px;
    padding: 0.8rem;
    overflow-x: auto;
    white-space: pre-wrap;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.checkbox-row input {
    width: auto;
}

input[data-device-name-input][readonly] {
    background: #f3f6f9;
    color: var(--muted);
    cursor: not-allowed;
}

.small {
    font-size: 0.86rem;
}

.muted {
    color: var(--muted);
}

.mini-json {
    display: grid;
    gap: 0.15rem;
    font-size: 0.86rem;
}

.footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: #f7fbff;
}

.footer-inner {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
}

.footer-main {
    display: grid;
    gap: 0.28rem;
}

.footer-legal {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    white-space: nowrap;
}

.footer-legal a {
    color: inherit;
    text-decoration: none;
}

.footer-legal a:hover {
    text-decoration: underline;
}

@media (max-width: 1000px) {
    .grid-4,
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .summary-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .campaign-top-grid {
        grid-template-columns: 1fr;
    }

    .portal-entry-grid,
    .portal-result-shell-split {
        grid-template-columns: 1fr;
    }

    .portal-result-card {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .portal-topbar-inner {
        min-height: unset;
        padding: 0.58rem 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 0.55rem;
        row-gap: 0.45rem;
    }

    .portal-logo {
        max-height: 40px;
    }

    .portal-brand-text strong {
        font-size: 0.95rem;
        line-height: 1.05;
    }

    .portal-brand-text small {
        font-size: 0.76rem;
    }

    .portal-brand {
        min-width: 0;
    }

    .portal-state-icon {
        min-width: 62px;
        height: 62px;
        font-size: 0.78rem;
    }

    .portal-result-head {
        grid-template-columns: 1fr;
    }

    .portal-help-btn {
        width: auto;
        min-width: 0;
        white-space: nowrap;
        padding: 0.58rem 0.82rem;
        font-size: 0.9rem;
    }

    .portal-footer-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.7rem 0;
        min-height: unset;
    }

    .brand-logo {
        height: 40px !important;
        max-height: 40px !important;
        width: auto !important;
        max-width: none !important;
    }

    .brand {
        width: 100%;
    }

    .brand-label {
        max-width: 100%;
        font-size: 0.98rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .main-nav {
        width: 100%;
        justify-content: flex-start;
    }

    .board-nav-wrap:not(.admin-nav-wrap) .board-nav {
        gap: 0.4rem;
        padding: 0.45rem;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
    }

    .board-nav-wrap:not(.admin-nav-wrap) .board-nav a {
        text-align: center;
        padding: 0.5rem 0.4rem;
        font-size: 0.84rem;
        min-height: 42px;
        line-height: 1.15;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: normal;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .form-grid.two-col,
    .summary-strip,
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }

    .board-header,
    .section-head,
    .device-activity-list li,
    .decision-header {
        flex-direction: column;
        align-items: stretch;
    }

    .button-row,
    .toolbar,
    .button-grid,
    .row-actions,
    .device-filter-actions,
    .blocked-filter-actions,
    .voucher-created-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .btn,
    .btn-large {
        width: 100%;
    }

    .voucher-created-inline {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .voucher-created-dialog {
        width: min(96vw, 760px);
    }

    .voucher-created-content {
        max-height: 92vh;
        padding: 0.85rem;
        gap: 0.75rem;
    }

    .voucher-ticket-code {
        flex-direction: column;
        align-items: stretch;
    }

    .voucher-ticket-code code {
        width: 100%;
        text-align: center;
        font-size: 1.14rem;
        letter-spacing: 0.04em;
    }

    .voucher-copy-icon {
        width: 100%;
        min-width: 0;
        height: 38px;
    }

    .decision-header [data-close-modal] {
        width: auto;
        align-self: flex-end;
        padding: 0.4rem 0.62rem;
    }

    .voucher-advanced-panel summary,
    .voucher-mail-advanced summary {
        width: 100%;
        justify-content: center;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.8rem 0;
    }

    .footer-legal {
        white-space: normal;
    }

    .decision-meta {
        grid-template-columns: 1fr;
    }

    .blocked-quick-grid {
        grid-template-columns: 1fr;
    }

    .blocked-open-link {
        max-width: none;
    }

    .audit-modal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .audit-modal-grid {
        grid-template-columns: 1fr;
    }

    .audit-context-grid {
        grid-template-columns: 1fr;
    }

    .user-modal-grid {
        grid-template-columns: 1fr;
    }

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

    .audit-detail-key {
        border-right: none;
        border-bottom: 1px solid #e3edf5;
    }

    .voucher-share-actions,
    .voucher-chip-grid,
    .voucher-ticket-grid {
        grid-template-columns: 1fr;
    }

    .campaign-summary,
    .campaign-share-actions {
        grid-template-columns: 1fr;
    }

    .resource-mini-grid {
        grid-template-columns: 1fr;
    }

    .system-status-dl {
        grid-template-columns: 1fr;
    }

    .portal-explain-actions {
        justify-content: stretch;
    }

    .portal-privacy-grid {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .board-nav-wrap:not(.admin-nav-wrap) .board-nav a {
        min-height: 38px;
        font-size: 0.8rem;
    }

    .portal-brand-text small {
        display: none;
    }

    .portal-help-btn {
        font-size: 0.85rem;
        padding: 0.52rem 0.68rem;
    }

    .portal-footer-actions {
        flex-wrap: wrap;
    }

    .portal-hero-privacy-link {
        font-size: 0.84rem;
    }
}
