:root {
    color-scheme: dark;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    --page: #0f141c;
    --sidebar: #121925;
    --card: #181f2b;
    --card-hover: #1d2634;
    --border: #2a3444;
    --text: #eef3f9;
    --muted: #94a2b6;
    --subtle: #6f7d91;
    --accent: #5f9df7;
    --accent-soft: #1d3556;
    --online: #72dfa0;
    --online-bg: #153d29;
}


* {
    box-sizing: border-box;
}


body {
    margin: 0;
    min-height: 100vh;
    background: var(--page);
    color: var(--text);
}


a {
    color: inherit;
}


/* -------------------------------------------------
   MAIN LAYOUT
   Desktop intentionally mirrors the mobile layout.
------------------------------------------------- */

.layout {
    min-height: 100vh;
}


.sidebar {
    position: sticky;
    top: 0;
    z-index: 10;

    background: var(--sidebar);

    border-right: 0;
    border-bottom: 1px solid var(--border);

    padding: 12px;
}


.nav-inner {
    width: min(920px, 100%);
    margin: 0 auto;
}


.brand {
    padding: 4px 8px 12px;

    font-size: 1.25rem;
    font-weight: 700;
}


.brand span {
    margin-right: 7px;
}


nav {
    display: flex;
    gap: 5px;

    overflow-x: auto;

    scrollbar-width: thin;
}


.nav-link {
    flex: 0 0 auto;

    display: block;

    padding: 9px 11px;

    border-radius: 9px;

    color: var(--muted);

    text-decoration: none;
}


.nav-link:hover {
    color: var(--text);
    background: var(--card);
}


.nav-link.active {
    color: var(--text);
    background: var(--accent-soft);
}


.main {
    min-width: 0;
}


.topbar {
    width: min(920px, 100%);
    margin: 0 auto;

    padding: 20px 18px 16px;

    border-bottom: 1px solid var(--border);
}


.topbar h1 {
    margin: 0;

    font-size: 1.7rem;
}


.topbar p {
    margin: 6px 0 0;

    color: var(--muted);
}


.content {
    width: min(920px, 100%);
    margin: 0 auto;

    padding: 18px 18px 40px;
}


/* -------------------------------------------------
   DASHBOARD
------------------------------------------------- */

.card-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(210px, 1fr));

    gap: 16px;
}


.dashboard-card {
    display: block;

    min-height: 185px;

    padding: 18px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--card);
    color: var(--text);

    text-decoration: none;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}


.dashboard-card[href="#"] {
    cursor: default;
}


.dashboard-card:not([href="#"]):hover {
    background: var(--card-hover);
    border-color: #3b4a60;

    transform: translateY(-1px);
}


.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}


.card-heading h2 {
    margin: 0;

    font-size: 1rem;
    font-weight: 600;
}


.status {
    padding: 4px 8px;

    border-radius: 999px;

    color: var(--online);
    background: var(--online-bg);

    font-size: 0.7rem;
}


.count {
    margin-top: 26px;

    font-size: 2.65rem;
    font-weight: 700;
    line-height: 1;
}


.count-label {
    margin-top: 6px;

    color: var(--muted);
}


.path {
    margin-top: 23px;

    color: var(--subtle);

    font-family: monospace;
    font-size: 0.8rem;

    overflow-wrap: anywhere;
}


/* -------------------------------------------------
   GENERIC LISTS / INBOX
------------------------------------------------- */

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 16px;
}


.section-heading h2 {
    margin: 0;

    font-size: 1.1rem;
}


.section-heading span {
    color: var(--muted);
}


.item-list {
    display: grid;

    gap: 10px;
}


.inbox-item {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr) auto;

    gap: 18px;

    align-items: center;

    padding: 16px 18px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--card);
}


.item-name {
    overflow-wrap: anywhere;

    font-weight: 600;
}


.item-details {
    margin-top: 6px;

    color: var(--muted);

    font-size: 0.88rem;
}


.item-time {
    color: var(--subtle);

    font-size: 0.82rem;

    white-space: nowrap;
}


.library-link {
    color: var(--text);

    text-decoration: none;
}


.library-link:hover {
    background: var(--card-hover);

    border-color: #3b4a60;
}


.inbox-match {
    margin-top: 10px;

    color: var(--online);

    font-size: 0.9rem;
    font-weight: 600;

    overflow-wrap: anywhere;
}


.inbox-match-path {
    margin-top: 4px;

    color: var(--subtle);

    font-family: monospace;
    font-size: 0.78rem;

    overflow-wrap: anywhere;
}


.inbox-waiting {
    margin-top: 10px;

    color: var(--muted);

    font-size: 0.88rem;
}


.inbox-unmatched {
    margin-top: 10px;

    color: var(--muted);

    font-size: 0.88rem;
}


/* -------------------------------------------------
   EMPTY STATE
------------------------------------------------- */

.empty-state {
    padding: 70px 24px;

    border: 1px dashed var(--border);
    border-radius: 14px;

    text-align: center;
}


.empty-icon {
    font-size: 2.8rem;
}


.empty-state h2 {
    margin: 14px 0 7px;

    font-size: 1.15rem;
}


.empty-state p {
    margin: 0;

    color: var(--muted);
}


/* -------------------------------------------------
   SEARCH
------------------------------------------------- */

.search-label {
    display: block;

    margin-bottom: 8px;

    color: var(--muted);

    font-size: 0.88rem;
}


.search-input {
    width: 100%;

    margin-bottom: 18px;

    padding: 12px 14px;

    border: 1px solid var(--border);
    border-radius: 10px;

    outline: none;

    background: var(--card);
    color: var(--text);

    font: inherit;
}


.search-input::placeholder {
    color: var(--subtle);
}


.search-input:focus {
    border-color: var(--accent);
}


.search-empty {
    margin-top: 18px;
}


/* -------------------------------------------------
   TRASH
------------------------------------------------- */

.trash-notice {
    margin-bottom: 18px;

    padding: 13px 15px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--card);
    color: var(--muted);

    font-size: 0.9rem;
}


/* -------------------------------------------------
   TV LIBRARY
------------------------------------------------- */

.show-toolbar {
    margin-bottom: 18px;
}


.back-link {
    color: var(--muted);

    text-decoration: none;
}


.back-link:hover {
    color: var(--text);
}


.season-list {
    display: grid;

    gap: 14px;
}


.season-block {
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--card);
}


.season-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 15px 18px;

    cursor: pointer;

    font-weight: 600;

    list-style: none;
}


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


.season-summary::before {
    content: "▸";

    margin-right: 10px;

    color: var(--muted);
}


.season-block[open] .season-summary::before {
    content: "▾";
}


.season-count {
    margin-left: auto;

    color: var(--muted);

    font-size: 0.85rem;
    font-weight: 400;
}


.season-episodes {
    border-top: 1px solid var(--border);
}


.episode-row {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr) auto;

    gap: 18px;

    align-items: center;

    padding: 13px 18px;

    border-bottom: 1px solid var(--border);
}


.episode-row:last-child {
    border-bottom: 0;
}


.season-empty {
    padding: 15px 18px;

    color: var(--muted);
}


/* -------------------------------------------------
   REVIEW
------------------------------------------------- */

.review-card {
    width: min(620px, 100%);

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--card);

    padding: 22px;
}


.review-section + .review-section {
    margin-top: 22px;
}


.preview-label {
    color: var(--muted);

    font-size: 0.82rem;
    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: 0.05em;
}


.review-filename {
    margin-top: 7px;

    font-size: 1rem;
    line-height: 1.5;

    overflow-wrap: anywhere;
}


.review-filename.proposed {
    font-weight: 600;
}


.review-value {
    margin-top: 7px;

    font-size: 1rem;
}


.review-path {
    margin-top: 7px;

    color: var(--muted);

    font-family: monospace;
    line-height: 1.5;

    overflow-wrap: anywhere;
}


.review-arrow {
    margin: 22px 0;

    color: var(--muted);

    font-size: 1.5rem;
}


.review-meta {
    margin-top: 22px;

    color: var(--muted);

    font-size: 0.9rem;
}


.review-notice {
    margin-top: 22px;

    padding-top: 18px;

    border-top: 1px solid var(--border);

    color: var(--muted);

    font-size: 0.9rem;
}


.preview-error,
.preview-unmatched {
    margin-top: 20px;

    padding: 14px 16px;

    border: 1px solid var(--border);
    border-radius: 10px;
}


.import-form {
    margin-top: 22px;
}


.import-button {
    padding: 11px 18px;

    border: 1px solid #4f6f9f;
    border-radius: 9px;

    background: #315d94;
    color: #fff;

    font: inherit;
    font-weight: 600;

    cursor: pointer;
}


.import-button:hover {
    background: #3b6ca8;
}


/* -------------------------------------------------
   FOOTER
------------------------------------------------- */

footer {
    width: min(920px, 100%);

    margin: 0 auto;

    padding: 10px 18px 24px;

    color: var(--subtle);

    font-size: 0.8rem;

    text-align: center;
}


.footer-link {
    margin-top: 7px;
}


.footer-link a {
    color: var(--muted);

    text-decoration: none;
}


.footer-link a:hover {
    color: var(--text);

    text-decoration: underline;
}


/* -------------------------------------------------
   MOBILE
------------------------------------------------- */

@media (max-width: 720px) {
    .sidebar {
        padding: 12px;
    }

    .topbar {
        padding: 20px 18px 16px;
    }

    .content {
        padding: 18px;
    }

    .inbox-item {
        grid-template-columns: 1fr;

        gap: 9px;
    }

    .item-time {
        white-space: normal;
    }

    .episode-row {
        grid-template-columns: 1fr;

        gap: 7px;
    }

    .season-summary {
        align-items: flex-start;
    }

    .review-card {
        width: 100%;
    }
}
