@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Instrument+Serif:ital@0;1&display=swap");

:root {
    --font-sans: "Space Grotesk", sans-serif;
    --font-serif: "Instrument Serif", serif;
    --bg: #f5efe5;
    --paper: rgba(255, 255, 255, 0.78);
    --card: rgba(255, 255, 255, 0.88);
    --line: rgba(13, 28, 24, 0.12);
    --text: #17201f;
    --muted: #5b6c68;
    --green: #0d7a54;
    --green-deep: #064632;
    --cream: #fdf9f1;
    --gold: #e0b75d;
    --danger: #b64235;
    --shadow: 0 20px 60px rgba(23, 32, 31, 0.08);
    --shell-gap: clamp(1rem, 1.8vw, 1.55rem);
    --section-gap: clamp(1rem, 1.8vw, 1.35rem);
    --panel-padding: clamp(1.2rem, 1.8vw, 1.6rem);
    --panel-radius: 1.65rem;
    --content-width: 1380px;
    --text-xs: 0.78rem;
    --text-sm: 0.88rem;
    --text-base: 0.98rem;
    --text-lg: 1.08rem;
    --text-xl: clamp(1.28rem, 1.2vw, 1.55rem);
    --text-2xl: clamp(1.85rem, 2vw, 2.35rem);
    --text-hero: clamp(2.6rem, 5vw, 5rem);
    --leading-tight: 1.12;
    --leading-copy: 1.6;
    --tracking-tight: -0.025em;
    --tracking-label: 0.12em;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(224, 183, 93, 0.2), transparent 30%),
        radial-gradient(circle at right, rgba(13, 122, 84, 0.16), transparent 35%),
        linear-gradient(180deg, #f9f4ea 0%, #eef5ef 100%);
}

body {
    position: relative;
    font-size: var(--text-base);
    line-height: var(--leading-copy);
    letter-spacing: -0.01em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.page-busy {
    cursor: progress;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
    line-height: 1.45;
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.55;
    pointer-events: none;
}

.orb-a {
    width: 24rem;
    height: 24rem;
    left: -6rem;
    top: -4rem;
    background: rgba(13, 122, 84, 0.18);
}

.orb-b {
    width: 20rem;
    height: 20rem;
    right: -5rem;
    bottom: 10vh;
    background: rgba(224, 183, 93, 0.22);
}

.btn {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.85rem 1.35rem;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: var(--text-base);
    font-weight: 600;
    letter-spacing: -0.01em;
}

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

.btn:disabled {
    cursor: wait;
    opacity: 0.78;
}

.btn.is-loading {
    transform: none;
}

.btn-spinner,
.global-progress-spinner,
.loading-spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    display: inline-block;
    flex: 0 0 auto;
    animation: spin 0.7s linear infinite;
}

.btn-spinner {
    width: 0.95rem;
    height: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.65);
    border-color: var(--line);
    color: var(--text);
}

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

.landing-shell,
.auth-shell {
    width: min(1180px, calc(100vw - 2rem));
    margin: 0 auto;
}

.landing-shell {
    padding: 4rem 0 5rem;
}

.hero {
    display: grid;
    gap: 1.4rem;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(245, 239, 229, 0.78));
    box-shadow: var(--shadow);
    border-radius: 2rem;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(13, 122, 84, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13, 122, 84, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 85%);
}

.eyebrow,
.section-kicker {
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--green);
}

.hero h1,
.auth-copy h1 {
    font-family: var(--font-serif);
    font-size: var(--text-hero);
    line-height: 0.95;
    letter-spacing: -0.035em;
    margin: 0;
    max-width: 12ch;
}

.hero-copy {
    max-width: 52rem;
    font-size: var(--text-lg);
    line-height: 1.68;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.status-card,
.feature-card,
.pricing-card,
.auth-card,
.sidebar,
.panel-card,
.metric-card,
.list-card,
.inbox-shell,
.message-pane,
.composer-card,
.billing-card,
.table-card {
    border: 1px solid var(--line);
    background: var(--card);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.status-card {
    width: fit-content;
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    border-radius: 1.2rem;
}

.feature-grid,
.pricing-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.4rem;
}

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

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

.feature-card,
.pricing-card {
    padding: 1.3rem;
    border-radius: 1.4rem;
}

.feature-card h2,
.pricing-tier {
    margin: 0 0 0.45rem;
    font-size: 1rem;
}

.pricing-price {
    font-family: "Instrument Serif", serif;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.mini-list {
    margin: 1rem 0 0;
    padding-left: 1rem;
    color: var(--muted);
    display: grid;
    gap: 0.35rem;
}

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1rem 0;
}

.auth-shell {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1rem;
    align-items: stretch;
}

.auth-copy,
.auth-card {
    padding: 2.2rem;
    border-radius: 1.8rem;
}

.auth-copy {
    background: linear-gradient(135deg, rgba(13, 122, 84, 0.96), rgba(6, 70, 50, 0.92));
    color: #f7fbf8;
    display: grid;
    align-content: space-between;
    min-height: 32rem;
}

.brand-link {
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-copy p,
.auth-switch {
    color: rgba(247, 251, 248, 0.8);
}

.stack-form {
    display: grid;
    gap: 0.9rem;
}

.stack-form label,
.form-grid label {
    display: grid;
    gap: 0.35rem;
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.stack-form label span,
.form-grid label span {
    color: #334542;
}

.stack-form input,
.form-grid input,
.form-grid textarea,
.form-grid select,
.composer textarea {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
    border-radius: 1rem;
    padding: 0.86rem 1rem;
    color: var(--text);
    font-size: var(--text-base);
    font-weight: 500;
}

.form-grid textarea,
.composer textarea {
    min-height: 7rem;
    resize: vertical;
}

.form-message,
.flash-message {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: rgba(13, 122, 84, 0.12);
    color: var(--green-deep);
}

.global-progress {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(13, 122, 84, 0.18);
    background: rgba(253, 249, 241, 0.96);
    box-shadow: 0 16px 40px rgba(23, 32, 31, 0.14);
    color: var(--green-deep);
    backdrop-filter: blur(14px);
}

.loading-card {
    min-height: 10.5rem;
    align-items: center;
}

.loading-inline {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    min-height: 100%;
}

.loading-spinner {
    width: 1.15rem;
    height: 1.15rem;
    color: var(--green);
}

.loading-copy {
    display: grid;
    gap: 0.25rem;
}

.loading-copy h2 {
    margin: 0;
    font-size: 1.05rem;
}

.flash-message.error,
.form-message.error {
    background: rgba(182, 66, 53, 0.12);
    color: var(--danger);
}

.hidden {
    display: none !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

#app-root {
    display: grid;
    grid-template-columns: 304px minmax(0, 1fr);
    gap: var(--shell-gap);
    min-height: 100vh;
    padding: 1rem;
}

.sidebar {
    margin: 0;
    border-radius: 2rem;
    padding: 1.35rem;
    display: grid;
    align-content: start;
    align-self: start;
    gap: 1.15rem;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
}

.brand-block {
    display: flex;
    gap: 0.85rem;
    align-items: center;
}

.brand-mark {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.85rem;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%);
    color: white;
    font-weight: 700;
}

.brand-block small,
.topbar-user small,
.muted {
    color: var(--muted);
    font-size: var(--text-sm);
    line-height: 1.55;
}

.brand-block strong {
    display: block;
    font-size: 1.08rem;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

.sidebar-nav {
    display: grid;
    gap: 0.55rem;
}

.nav-link {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 1.1rem;
    padding: 0.95rem 1rem;
    text-align: left;
    cursor: pointer;
    color: var(--text);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.nav-link:hover {
    transform: translateX(2px);
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(13, 122, 84, 0.08);
}

.nav-link.active {
    background: rgba(13, 122, 84, 0.12);
    border-color: rgba(13, 122, 84, 0.22);
}

.btn-logout {
    margin-top: auto;
}

.dashboard-main {
    padding: 0 0 2.5rem;
    display: grid;
    align-content: start;
    gap: var(--shell-gap);
    min-width: 0;
}

.topbar,
.panel-section,
.dashboard-main > .flash-message {
    width: min(100%, var(--content-width));
    margin-inline: auto;
}

.dashboard-main > .flash-message {
    margin-top: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 1.5rem 1.65rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 1.8rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(253, 249, 241, 0.8));
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.topbar h1 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: var(--text-2xl);
    line-height: 0.98;
    letter-spacing: -0.035em;
    font-weight: 400;
}

.topbar p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: var(--text-sm);
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.pill {
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    background: rgba(13, 122, 84, 0.1);
    color: var(--green-deep);
    border: 1px solid rgba(13, 122, 84, 0.18);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.topbar-user {
    display: grid;
    justify-items: end;
    gap: 0.1rem;
}

.panel-section {
    padding: 0;
    display: grid;
    gap: var(--section-gap);
}

.metric-grid,
.content-grid,
.two-up,
.three-up {
    display: grid;
    gap: var(--section-gap);
}

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

.metric-grid-spacious {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric-card,
.panel-card,
.list-card,
.table-card,
.billing-card {
    padding: var(--panel-padding);
    border-radius: var(--panel-radius);
}

.panel-roomy {
    padding: calc(var(--panel-padding) + 0.1rem);
}

.metric-card,
.panel-card,
.table-card,
.billing-card,
.plan-card {
    display: grid;
    align-content: start;
    gap: 0.95rem;
}

.metric-card {
    min-height: 9.6rem;
}

.metric-card small {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: var(--text-xs);
    font-weight: 700;
}

.metric-card strong {
    display: block;
    font-size: clamp(2rem, 3vw, 2.45rem);
    line-height: 1;
    margin-bottom: 0;
    letter-spacing: -0.035em;
}

.content-grid {
    grid-template-columns: 1.05fr 0.95fr;
}

.two-up {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.three-up {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.overview-widget-grid {
    gap: calc(var(--section-gap) + 0.1rem);
}

.overview-analytics-grid {
    align-items: stretch;
}

.overview-head-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

.overview-chart-card {
    gap: 1.15rem;
}

.overview-line-chart {
    display: grid;
    gap: 0.7rem;
}

.overview-line-chart-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.overview-chart-grid-line {
    stroke: rgba(23, 32, 31, 0.09);
    stroke-width: 1;
}

.overview-chart-grid-label {
    fill: var(--muted);
    font-size: 11px;
}

.overview-area-fill {
    fill: rgba(13, 122, 84, 0.12);
}

.overview-line-path {
    fill: none;
    stroke: var(--green);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.overview-line-point {
    fill: white;
    stroke: var(--green);
    stroke-width: 2;
}

.overview-line-point.is-latest {
    fill: var(--green);
}

.overview-axis-labels {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.overview-mini-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.85rem;
}

.overview-mini-stat {
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(13, 28, 24, 0.08);
    background: rgba(255, 255, 255, 0.6);
}

.overview-mini-stat small,
.overview-detail-list small {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.74rem;
    margin-bottom: 0.35rem;
}

.overview-mini-stat strong,
.overview-detail-list strong {
    display: block;
    font-size: 1.02rem;
}

.overview-donut-layout {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: 1.1rem;
    align-items: center;
}

.overview-donut {
    width: min(220px, 100%);
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-inline: auto;
}

.overview-donut-hole {
    width: 64%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(253, 249, 241, 0.96);
    display: grid;
    place-items: center;
    text-align: center;
    padding: 0.85rem;
    box-shadow: inset 0 0 0 1px rgba(13, 28, 24, 0.08);
}

.overview-donut-hole strong {
    display: block;
    font-size: 1.5rem;
    line-height: 1;
}

.overview-donut-hole span {
    color: var(--muted);
    font-size: 0.82rem;
}

.overview-legend {
    display: grid;
    gap: 0.75rem;
}

.overview-legend-item,
.overview-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.overview-legend-item {
    justify-content: flex-start;
}

.overview-legend-item div {
    display: grid;
    gap: 0.08rem;
}

.overview-legend-item span:last-child {
    color: var(--muted);
    font-size: 0.84rem;
}

.overview-legend-dot {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    flex: 0 0 auto;
}

.overview-bar-list,
.overview-usage-list,
.overview-detail-list {
    display: grid;
    gap: 0.9rem;
}

.overview-bar-row,
.overview-usage-item {
    display: grid;
    gap: 0.45rem;
}

.overview-bar-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: baseline;
}

.overview-bar-head strong {
    font-size: 0.96rem;
}

.overview-bar-head span {
    color: var(--muted);
    font-size: 0.85rem;
    text-align: right;
}

.overview-bar-track {
    height: 0.75rem;
    border-radius: 999px;
    background: rgba(23, 32, 31, 0.08);
    overflow: hidden;
}

.overview-bar-track.is-usage {
    height: 0.6rem;
}

.overview-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--green) 0%, #1ca36e 100%);
}

.overview-detail-list {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.overview-subsection {
    display: grid;
    gap: 0.55rem;
    padding-top: 0.4rem;
}

.overview-subsection h3 {
    margin: 0;
    font-size: 1rem;
}

.overview-source-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.overview-source-badge {
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(13, 28, 24, 0.08);
    background: rgba(255, 255, 255, 0.62);
}

.overview-source-badge strong {
    font-size: 0.88rem;
}

.overview-empty-state {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px dashed rgba(13, 28, 24, 0.16);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.45);
}

.channels-top-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: start;
}

.channels-api-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: start;
}

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

.section-head h2 {
    margin: 0;
    font-size: var(--text-xl);
    line-height: 1.02;
    letter-spacing: -0.03em;
    font-weight: 700;
}

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

.panel-card h2,
.table-card h2,
.billing-card h2,
.plan-card h3,
.sent-detail-card h3 {
    margin: 0;
    font-size: var(--text-xl);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.panel-card p,
.table-card p,
.billing-card p,
.plan-card p,
.metric-card p {
    margin: 0;
    line-height: 1.62;
}

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

.inbox-shell {
    display: grid;
    grid-template-columns: 340px 1fr;
    border-radius: 1.5rem;
    overflow: hidden;
}

.conversation-list {
    background: rgba(255, 255, 255, 0.6);
    border-right: 1px solid var(--line);
    max-height: 70vh;
    overflow-y: auto;
}

.conversation-card {
    width: 100%;
    padding: 1rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.conversation-card.active {
    background: rgba(13, 122, 84, 0.1);
}

.conversation-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.35rem;
}

.conversation-preview {
    color: var(--muted);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.message-pane {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 70vh;
    border-radius: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(253, 249, 241, 0.9)),
        radial-gradient(circle at top right, rgba(224, 183, 93, 0.12), transparent 32%);
}

.message-header,
.composer {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--line);
}

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

.message-stream {
    padding: 1rem 1.2rem;
    overflow-y: auto;
    display: grid;
    gap: 0.8rem;
    align-content: start;
}

.message-bubble {
    max-width: min(72%, 36rem);
    padding: 0.95rem 1rem;
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(23, 32, 31, 0.08);
}

.message-bubble.outbound {
    margin-left: auto;
    background: rgba(13, 122, 84, 0.12);
}

.message-bubble.note {
    background: rgba(224, 183, 93, 0.18);
    border-style: dashed;
}

.bubble-head {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: var(--text-xs);
}

.bubble-meta {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.7rem;
    font-size: var(--text-xs);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(23, 32, 31, 0.08);
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
    font-weight: 700;
}

.status-chip.delivered,
.status-chip.dispatched,
.status-chip.sent,
.status-chip.read {
    background: rgba(13, 122, 84, 0.12);
    color: var(--green-deep);
}

.status-chip.failed {
    background: rgba(182, 66, 53, 0.12);
    color: var(--danger);
}

.message-error {
    margin-top: 0.55rem;
    color: var(--danger);
    font-size: 0.82rem;
}

.composer {
    border-top: 1px solid var(--line);
    border-bottom: 0;
    display: grid;
    gap: 0.8rem;
}

.composer-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

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

.list-table th,
.list-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 0.94rem;
    line-height: 1.55;
    vertical-align: top;
}

.list-table th {
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
    background: rgba(255, 255, 255, 0.38);
}

.list-table tbody tr:last-child td {
    border-bottom: 0;
}

.code-chip {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.74rem;
    line-height: 1.45;
    background: rgba(23, 32, 31, 0.08);
    border-radius: 0.7rem;
    padding: 0.3rem 0.45rem;
    display: inline-block;
    word-break: break-all;
}

.api-block {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 1rem 1.05rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid var(--line);
}

.steps-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.3rem;
    color: var(--muted);
}

.qr-image {
    width: min(100%, 18rem);
    display: block;
    margin-top: 0.75rem;
    border-radius: 1rem;
    border: 1px solid var(--line);
    background: white;
    padding: 0.75rem;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--section-gap);
}

.billing-checkout-grid {
    align-items: start;
}

.billing-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid var(--line);
}

.billing-summary-grid small {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--muted);
}

.billing-summary-grid strong {
    display: block;
}

.plan-card {
    padding: var(--panel-padding);
    border-radius: var(--panel-radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
}

.plan-card-current {
    border-color: rgba(13, 122, 84, 0.3);
    box-shadow: inset 0 0 0 1px rgba(13, 122, 84, 0.12);
}

.plan-card h3 {
    margin: 0 0 0.35rem;
}

.plan-card .price {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 0.65rem;
    letter-spacing: -0.03em;
}

.price-suffix {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    margin-left: 0.35rem;
    color: var(--muted);
}

.tag {
    display: inline-flex;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: rgba(13, 122, 84, 0.12);
    color: var(--green-deep);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-tenants-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
    gap: var(--section-gap);
    align-items: start;
}

.admin-tenant-row td {
    transition: background 0.18s ease;
}

.admin-tenant-row.active td {
    background: rgba(13, 122, 84, 0.08);
}

.plan-row td {
    transition: background 0.18s ease;
}

.plan-row.active td {
    background: rgba(13, 122, 84, 0.08);
}

.admin-tenant-row.active td:first-child {
    box-shadow: inset 3px 0 0 var(--green);
}

.admin-tenant-editor {
    position: sticky;
    top: 1rem;
}

.admin-tenant-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--line);
}

.admin-tenant-meta small {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
}

.admin-tenant-meta strong {
    display: block;
}

.sent-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
    gap: var(--section-gap);
    align-items: stretch;
}

.sent-compose-card {
    gap: 1.2rem;
}

.sent-compose-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.sent-compose-head h3 {
    margin: 0;
}

.sent-compose-form {
    align-items: start;
}

.sent-compose-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.sent-compose-actions p {
    max-width: 40rem;
}

.sent-table-card {
    gap: 1.15rem;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
}

.sent-table-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.sent-table-head h3 {
    margin: 0;
}

.sent-count-tag {
    white-space: nowrap;
}

.sent-toolbar {
    display: flex;
    gap: 0.85rem;
    justify-content: space-between;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.sent-control {
    display: grid;
    gap: 0.35rem;
    flex: 1 1 18rem;
    min-width: 0;
}

.sent-sort-control {
    flex: 0 0 14rem;
}

.sent-control span {
    font-size: 0.82rem;
    color: var(--muted);
}

.sent-control input,
.sent-control select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    padding: 0.8rem 0.9rem;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
}

.sent-table-shell {
    border: 1px solid rgba(13, 28, 24, 0.1);
    border-radius: 1.25rem;
    overflow: auto;
    min-height: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(253, 249, 241, 0.72));
}

.sent-table {
    table-layout: fixed;
}

.sent-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    background: rgba(247, 250, 247, 0.94);
    backdrop-filter: blur(12px);
}

.sent-table th:nth-child(1) {
    width: 15%;
}

.sent-table th:nth-child(2) {
    width: 24%;
}

.sent-table th:nth-child(3) {
    width: 33%;
}

.sent-table th:nth-child(4) {
    width: 12%;
}

.sent-table th:nth-child(5) {
    width: 16%;
}

.sent-row {
    cursor: pointer;
    outline: none;
}

.sent-row td {
    background: transparent;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.sent-row td:first-child {
    border-left: 3px solid transparent;
}

.sent-row:hover td,
.sent-row:focus td {
    background: rgba(13, 122, 84, 0.05);
}

.sent-row.active td {
    background: rgba(13, 122, 84, 0.1);
}

.sent-row.active td:first-child {
    border-left-color: var(--green);
}

.sent-cell-sent {
    white-space: nowrap;
}

.sent-date {
    font-weight: 600;
}

.sent-time,
.sent-recipient-name,
.sent-recipient-channel,
.sent-status-note,
.sent-open-hint {
    color: var(--muted);
    font-size: 0.8rem;
}

.sent-recipient {
    display: grid;
    gap: 0.22rem;
}

.sent-cell-message {
    min-width: 0;
}

.sent-message-stack {
    display: grid;
    gap: 0.45rem;
}

.message-preview-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
    max-width: none;
    white-space: normal;
    padding: 0.8rem 0.9rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(13, 28, 24, 0.08);
}

.sent-attachment-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0.35rem;
    border-radius: 999px;
    font-size: 1rem;
    line-height: 1;
    font-weight: 600;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.68);
}

.sent-attachment-flag.checked {
    color: var(--green-deep);
    background: rgba(13, 122, 84, 0.1);
    border-color: rgba(13, 122, 84, 0.18);
}

.sent-attachment-flag.unchecked {
    color: var(--muted);
}

.sent-status-stack {
    display: grid;
    gap: 0.35rem;
}

.sent-empty-row td {
    padding: 2.4rem 1rem;
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.6);
}

.sent-detail-panel {
    min-width: 0;
}

.sent-detail-card {
    position: sticky;
    top: 1rem;
}

.sent-detail-card h3 {
    margin: 0;
}

.sent-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sent-detail-meta small {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
}

.sent-detail-meta strong {
    display: block;
}

.sent-message-full {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    white-space: pre-wrap;
    line-height: 1.6;
    word-break: break-word;
}

@media (max-width: 1040px) {
    #app-root {
        grid-template-columns: 1fr;
        padding: 0.85rem;
    }

    .sidebar {
        position: static;
        max-height: none;
    }

    .dashboard-main {
        padding: 0 0 2rem;
    }

    .content-grid,
    .inbox-shell,
    .auth-shell,
    .admin-tenants-layout,
    .sent-layout {
        grid-template-columns: 1fr;
    }

    .overview-donut-layout {
        grid-template-columns: 1fr;
    }

    .admin-tenant-editor,
    .sent-detail-card {
        position: static;
    }
}

@media (max-width: 720px) {
    .landing-shell,
    .auth-shell {
        width: min(100vw - 1rem, 100%);
    }

    .hero,
    .auth-copy,
    .auth-card,
    .sidebar {
        padding-left: 1rem;
        padding-right: 1rem;
    }

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

    .sent-sort-control {
        flex-basis: 100%;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
    }

    .message-bubble {
        max-width: 100%;
    }
}
