@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f4efe6;
    --bg-soft: #fbf8f2;
    --panel: rgba(255, 252, 247, 0.9);
    --panel-strong: #fffdf9;
    --line: #e6dac8;
    --line-strong: #d3c0a3;
    --text: #211c16;
    --muted: #6f6558;
    --brand: #0d7c66;
    --brand-dark: #095847;
    --accent: #f59e0b;
    --danger: #c2410c;
    --ok: #15803d;
    --shadow: 0 18px 40px rgba(51, 40, 20, 0.08);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(13, 124, 102, 0.18), transparent 28%),
        radial-gradient(circle at right 20%, rgba(245, 158, 11, 0.14), transparent 22%),
        linear-gradient(180deg, #f8f4ed 0%, #f4efe6 100%);
}

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

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

.shell {
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 40px;
}

.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    margin-bottom: 20px;
    border: 1px solid rgba(230, 218, 200, 0.8);
    border-radius: 28px;
    background: rgba(255, 251, 245, 0.75);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--brand), #19a686);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
    display: grid;
    place-items: center;
}

.brand-mark span {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.95);
    border-left-color: transparent;
    border-radius: 50%;
    transform: rotate(-35deg);
}

.eyebrow {
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
}

.masthead h1,
.section-head h2,
.section-head h3,
.card-head h3,
.activity-item h3,
.data-card h3 {
    margin: 0;
}

.masthead-actions,
.inline-actions,
.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.status-pill.is-online {
    border-color: rgba(21, 128, 61, 0.25);
    background: rgba(21, 128, 61, 0.08);
}

.status-pill.is-qr {
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.08);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9ca3af;
}

.status-dot.is-online {
    background: var(--ok);
}

.status-dot.is-qr {
    background: var(--accent);
}

.status-dot.is-offline {
    background: var(--danger);
}

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

.sidebar,
.panel,
.inset-panel {
    border: 1px solid rgba(230, 218, 200, 0.9);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.sidebar {
    padding: 18px;
    border-radius: var(--radius-lg);
    align-self: start;
    position: sticky;
    top: 24px;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav-link {
    width: 100%;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    cursor: pointer;
    transition: 180ms ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--text);
    background: linear-gradient(135deg, rgba(13, 124, 102, 0.12), rgba(245, 158, 11, 0.12));
}

.content {
    min-width: 0;
}

.page {
    display: none;
    padding: 24px;
    border-radius: 28px;
}

.page.is-active {
    display: block;
}

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

.section-head.compact {
    margin-bottom: 16px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.hero-card,
.health-card,
.stat-card,
.data-card,
.meeting-card,
.activity-item,
.toolbar,
.callout {
    border: 1px solid rgba(230, 218, 200, 0.95);
    border-radius: var(--radius-md);
    background: var(--panel-strong);
}

.hero-card,
.health-card,
.stat-card,
.data-card,
.meeting-card,
.activity-item,
.toolbar,
.callout,
.inset-panel {
    padding: 18px;
}

.hero-card h3 {
    max-width: 28rem;
    font-size: clamp(1.35rem, 3vw, 2rem);
    line-height: 1.05;
    margin-bottom: 10px;
}

.muted,
.helper,
.helper-inline {
    color: var(--muted);
}

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

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

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

.health-grid,
.card-grid {
    display: grid;
    gap: 14px;
}

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

.metric {
    padding: 14px;
    border-radius: 16px;
    background: rgba(13, 124, 102, 0.06);
}

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

.metric strong {
    font-size: 1.1rem;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.toolbar-summary {
    white-space: nowrap;
    color: var(--muted);
    font-size: 13px;
}

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

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

.data-card.row-card,
.meeting-card,
.activity-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

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

.meeting-date {
    width: 88px;
    min-width: 88px;
    border-radius: 18px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(13, 124, 102, 0.12), rgba(13, 124, 102, 0.04));
    text-align: center;
}

.meeting-date strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
}

.meeting-copy,
.card-copy {
    flex: 1;
    min-width: 0;
}

.meeting-agenda,
.multiline-clamp,
.break-word {
    overflow-wrap: anywhere;
}

.multiline-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tag,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tag-person,
.tag-draft {
    background: rgba(245, 158, 11, 0.12);
    color: #a16207;
}

.tag-group,
.tag-sent,
.badge-ok {
    background: rgba(21, 128, 61, 0.12);
    color: var(--ok);
}

.badge-warn {
    background: rgba(245, 158, 11, 0.12);
    color: #a16207;
}

.badge-error {
    background: rgba(194, 65, 12, 0.12);
    color: var(--danger);
}

.btn,
.icon-btn {
    border: 0;
    cursor: pointer;
    transition: 180ms ease;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
}

.btn:hover,
.icon-btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #14a38a);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}

.btn-secondary {
    color: var(--text);
    background: #f7f1e6;
    border: 1px solid var(--line);
}

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #c2410c, #ea580c);
}

.input,
.textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    padding: 13px 14px;
    outline: none;
}

.input:focus,
.textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(13, 124, 102, 0.12);
}

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

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.field > span,
.checkbox span {
    font-weight: 700;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.check-list {
    display: grid;
    gap: 10px;
    max-height: 260px;
    overflow: auto;
    padding: 4px;
}

.list-check {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.callout {
    margin-bottom: 16px;
}

.explainer-card,
.subtle-callout {
    background: linear-gradient(180deg, rgba(13, 124, 102, 0.08), rgba(255, 253, 249, 0.96));
}

.explainer-card strong,
.subtle-callout strong {
    display: block;
    margin-bottom: 6px;
}

.explainer-card code {
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(13, 124, 102, 0.1);
    color: var(--brand-dark);
    font-family: inherit;
    font-weight: 700;
}

.empty-state {
    padding: 22px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.55);
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(33, 28, 22, 0.4);
    backdrop-filter: blur(6px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border-radius: 28px;
    border: 1px solid rgba(230, 218, 200, 0.95);
    background: #fffdf8;
    box-shadow: 0 30px 70px rgba(33, 28, 22, 0.18);
    padding: 22px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f1eadf;
    font-size: 1.6rem;
    line-height: 1;
}

.qr-card {
    width: min(520px, 100%);
}

.qr-body {
    display: grid;
    gap: 16px;
    justify-items: center;
}

.qr-image {
    display: block;
    width: min(280px, 100%);
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1100;
    display: grid;
    gap: 10px;
}

.toast {
    min-width: 240px;
    max-width: 340px;
    padding: 14px 16px;
    border-radius: 16px;
    box-shadow: 0 14px 32px rgba(33, 28, 22, 0.18);
    color: #fff;
}

.toast-info {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.toast-success {
    background: linear-gradient(135deg, #166534, #16a34a);
}

.toast-error {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
}

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

    .sidebar {
        position: static;
    }

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

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

    .masthead,
    .section-head,
    .toolbar,
    .data-card.row-card,
    .meeting-card,
    .activity-item,
    .card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-grid,
    .health-grid {
        grid-template-columns: 1fr;
    }

    .page {
        padding: 18px;
    }

    .meeting-date {
        width: 100%;
        min-width: 0;
    }

    .toolbar-summary {
        white-space: normal;
    }

    .toast-stack {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .toast {
        min-width: 0;
        max-width: none;
    }
}
