html {
    box-sizing: border-box;
    font-family: Segoe UI, Arial, sans-serif;
    color: #1f2937;
    background: #f3f6fb;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    margin: 0;
}

.app-body {
    background:
        linear-gradient(180deg, #eef5ff 0, #f7f9fc 280px, #f7f9fc 100%);
    min-height: 100vh;
}

.topbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid #d7dde5;
    box-shadow: 0 10px 30px rgba(31, 41, 55, 0.06);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 28px;
}

.topbar .container-fluid {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topbar span {
    color: #687385;
}

.topbar nav {
    display: flex;
    gap: 14px;
}

.topbar a {
    color: #1769aa;
    font-weight: 600;
    text-decoration: none;
}

.page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px;
}

.dashboard-hero {
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #edf7f5 58%, #fff7e8 100%);
    border: 1px solid #d7dde5;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding: 26px;
}

.dashboard-hero h1 {
    font-size: 34px;
    margin-bottom: 8px;
}

.dashboard-hero p {
    max-width: 720px;
}

.eyebrow {
    color: #0f766e;
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.hero-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

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

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

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

h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

h2 {
    font-size: 20px;
}

p {
    color: #5d6878;
}

button {
    border: 0;
    border-radius: 6px;
    background: #1769aa;
    color: #ffffff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    min-width: 112px;
    padding: 10px 16px;
}

.button-link {
    border-radius: 6px;
    background: #1769aa;
    color: #ffffff;
    display: inline-block;
    font-size: 15px;
    font-weight: 600;
    min-width: 112px;
    padding: 10px 16px;
    text-align: center;
    text-decoration: none;
}

.button-link.secondary {
    background: #eef2f6;
    border: 1px solid #c8d0dc;
    color: #1769aa;
}

input[type="text"], input[type="number"] {
    border: 1px solid #c8d0dc;
    border-radius: 6px;
    font: inherit;
    padding: 10px 12px;
    width: 100%;
}

label span {
    display: block;
}

.share-panel {
    background: #ffffff;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    display: grid;
    gap: 18px;
    margin-bottom: 24px;
    padding: 18px;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 180px minmax(240px, 1fr);
    margin-bottom: 14px;
}

.wide-field {
    min-width: 0;
}

.platform-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 16px;
}

.platform-list label {
    align-items: center;
    display: flex;
    gap: 7px;
}

.platform-list span {
    display: inline;
}

.language-panel {
    background: #ffffff;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(31, 41, 55, 0.05);
    padding: 18px;
}

.language-panel p {
    margin-bottom: 0;
}

.language-list {
    margin-top: 14px;
}

.language-settings-list {
    display: grid;
    gap: 8px;
    margin: 16px 0;
}

.language-setting-header,
.language-setting-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(130px, 1.2fr) minmax(130px, 0.9fr) minmax(86px, 0.7fr) minmax(150px, 1fr) minmax(70px, 0.5fr);
}

.language-setting-header {
    color: #687385;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.language-setting-row {
    background: #f8fafc;
    border: 1px solid #e1e7ef;
    border-radius: 8px;
    padding: 10px;
}

.language-toggle,
.language-timer {
    align-items: center;
    display: flex;
    gap: 8px;
    margin: 0;
}

.language-timer input {
    max-width: 92px;
}

.language-run-status {
    border-radius: 999px;
    background: #eef2f6;
    color: #4b5563;
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
    text-transform: uppercase;
    width: fit-content;
}

.language-error {
    grid-column: 1 / -1;
    overflow-wrap: anywhere;
}

.compact {
    margin: 0 0 12px;
}

.below-table {
    margin-top: 14px;
}

.direct-share-actions {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
}

.popup-share-actions {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}

.direct-share-button {
    background: #eef2f6;
    border: 1px solid #c8d0dc;
    color: #1f2937;
    font-size: 12px;
    min-width: 0;
    padding: 7px 9px;
    text-align: center;
    white-space: normal;
    width: 100%;
}

.direct-share-button.direct-share-shared {
    background: #16a34a;
    border-color: #15803d;
    color: #ffffff;
}

.direct-share-button.direct-share-failed {
    background: #dc2626;
    border-color: #b91c1c;
    color: #ffffff;
}

.direct-share-button.direct-share-ready {
    background: #f59e0b;
    border-color: #d97706;
    color: #111827;
}

.cover-status {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    padding: 4px 9px;
}

.cover-status-yes {
    background: #16a34a;
    color: #ffffff;
}

.cover-status-no {
    background: #facc15;
    color: #111827;
}

.cover-action-button {
    background: #eef2f6;
    border: 1px solid #c8d0dc;
    color: #1f2937;
    display: block;
    font-size: 12px;
    padding: 7px 9px;
    width: 100%;
}

.popup-share-button {
    background: #0f766e;
    border: 1px solid #0d6b64;
    border-radius: 6px;
    color: #ffffff;
    display: block;
    font-size: 12px;
    font-weight: 700;
    min-width: 0;
    padding: 7px 9px;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    width: 100%;
}

.popup-share-button:hover {
    background: #115e59;
    color: #ffffff;
}

.section-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.section-heading a {
    color: #1769aa;
    font-weight: 600;
    text-decoration: none;
}

.muted {
    color: #687385;
    font-size: 13px;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

button:disabled {
    background: #9ca8b8;
    cursor: default;
}

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

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

.stat {
    background: #ffffff;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(31, 41, 55, 0.06);
    padding: 16px;
}

.stat-primary {
    background: #0f766e;
    border-color: #0f766e;
}

.stat-primary span,
.stat-primary strong {
    color: #ffffff;
}

.stat span {
    color: #687385;
    display: block;
    font-size: 13px;
    margin-bottom: 8px;
}

.stat strong {
    display: block;
    font-size: 20px;
}

.alert {
    background: #fff4e5;
    border: 1px solid #f2c178;
    border-radius: 8px;
    color: #724600;
    margin-bottom: 22px;
    padding: 14px 16px;
}

.operation-overlay {
    align-items: center;
    background: rgba(15, 23, 42, 0.56);
    bottom: 0;
    display: none;
    justify-content: center;
    left: 0;
    padding: 24px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 2000;
}

.operation-overlay.is-active {
    display: flex;
}

.operation-progress {
    background: #ffffff;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
    max-width: 520px;
    padding: 22px;
    width: min(520px, 100%);
}

.operation-progress strong,
.operation-progress span {
    display: block;
}

.operation-progress strong {
    font-size: 20px;
    margin-bottom: 6px;
}

.operation-progress span {
    color: #5d6878;
    margin-bottom: 18px;
}

.progress {
    height: 24px;
    width: 100%;
}

.progress-wrap {
    background: #f59e0b;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    background:
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.22) 0, rgba(255, 255, 255, 0.22) 10px, rgba(255, 255, 255, 0) 10px, rgba(255, 255, 255, 0) 20px),
        linear-gradient(90deg, #1769aa, #0f766e);
    border-radius: 6px;
    left: 0;
    position: absolute;
    top: 0;
    transition: width 24s cubic-bezier(0.18, 0.84, 0.38, 1);
    width: 0%;
}

.operation-overlay.is-active .progress-bar {
    width: 92%;
}

.operation-overlay.is-finishing .progress-bar {
    transition-duration: 300ms;
    width: 100%;
}

body.operation-busy {
    overflow: hidden;
}

.dashboard-section {
    margin-bottom: 26px;
}

.dashboard-table {
    background: #ffffff;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(31, 41, 55, 0.05);
}

.dashboard-table table {
    border: 0;
}

.platform-pill,
.status-pill {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
    text-transform: uppercase;
}

.platform-pill {
    background: #e7f0ff;
    color: #175ea8;
}

.status-pill {
    background: #eef2f6;
    color: #4b5563;
}

.status-shared {
    background: #dcfce7;
    color: #166534;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #d7dde5;
    table-layout: fixed;
}

th, td {
    border-bottom: 1px solid #e5e9ef;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eef2f6;
    font-size: 13px;
}

.feed-url {
    max-width: 460px;
    overflow-wrap: anywhere;
}

.error {
    color: #a33b28;
}

.error-cell {
    max-width: 360px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.error-detail {
    background: #ffffff;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 14px;
}

.error-detail-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 8px;
}

.error-detail-header strong {
    color: #a33b28;
    text-transform: capitalize;
}

.error-detail-header span {
    color: #687385;
    font-size: 13px;
}

.error-detail-title {
    font-weight: 700;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.error-detail pre {
    background: #fff7f4;
    border: 1px solid #f0c9bd;
    border-radius: 6px;
    color: #7a2d1f;
    font-family: Consolas, Menlo, monospace;
    font-size: 13px;
    line-height: 1.45;
    margin: 12px 0 0;
    max-height: 360px;
    overflow: auto;
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.empty-state {
    background: #ffffff;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    color: #687385;
    padding: 14px 16px;
}

.pager {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 12px;
}

.pager a,
.pager-disabled {
    border: 1px solid #c8d0dc;
    border-radius: 6px;
    font-weight: 700;
    padding: 7px 11px;
    text-decoration: none;
}

.pager a {
    background: #ffffff;
    color: #1769aa;
}

.pager-disabled {
    background: #eef2f6;
    color: #8a96a8;
}

@media (max-width: 760px) {
    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

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

    .topbar .container-fluid {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-hero,
    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-hero h1 {
        font-size: 28px;
    }

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

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

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

    .language-setting-header {
        display: none;
    }

    .language-setting-row {
        align-items: stretch;
        grid-template-columns: 1fr;
    }
}

@media (min-width: 761px) and (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
