:root {
    --bg: #0f0f10;
    --bg-soft: rgba(24, 24, 26, 0.84);
    --panel: rgba(22, 22, 24, 0.94);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text: #f2f2f3;
    --muted: #a6a6ab;
    --accent: #d8d8dd;
    --accent-strong: #ffffff;
    --success: #bcbcc2;
    --warning-bg: rgba(255, 180, 90, 0.10);
    --pdf-red: #e14b4b;
    --warning-border: rgba(255, 180, 90, 0.26);
    --folder-orange: #f2a437;
    --folder-orange-bg: rgba(242, 164, 55, 0.14);
    --info-bg: rgba(255, 255, 255, 0.05);
    --info-border: rgba(255, 255, 255, 0.12);
    --shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
    --radius: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --max-width: 1880px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 22%),
        radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.04), transparent 18%),
        linear-gradient(180deg, #0a0a0b 0%, #111113 52%, #0a0a0b 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
    max-width: 100%;
}

button,
input {
    font: inherit;
}

.page-shell {
    width: 80vw;
    max-width: 80vw;
    margin: 0 auto;
    padding: 28px 0 40px;
}

.hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--panel-border);
    border-radius: calc(var(--radius) + 4px);
    background: linear-gradient(145deg, rgba(24, 24, 26, 0.96), rgba(15, 15, 17, 0.92));
    box-shadow: var(--shadow);
}

.hero__content {
    position: relative;
    z-index: 2;
    padding: 40px;
}

.hero__glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(10px);
}

.hero__glow--one {
    top: -60px;
    left: -10px;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.06);
}

.hero__glow--two {
    right: -30px;
    bottom: -40px;
    width: 240px;
    height: 240px;
    background: rgba(255, 255, 255, 0.04);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: var(--accent-strong);
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.hero h1 {
    margin: 18px 0 12px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1;
}

.hero p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.hero p strong {
    color: var(--text);
}

.hero__stats {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 28px;
    align-items: stretch;
}

.hero__stats > * {
    min-width: 0;
    width: 100%;
}

.stat-card {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.stat-card__value {
    display: block;
    font-size: clamp(1rem, 1.35vw, 1.45rem);
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.stat-card__label {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.95rem;
}

.library-card {
    padding: 24px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

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

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.breadcrumbs a {
    color: var(--muted);
    transition: color 0.2s ease;
}

.breadcrumbs a:hover,
.breadcrumbs a[aria-current="page"] {
    color: var(--text);
}

.breadcrumbs__separator {
    width: 16px;
    color: rgba(255, 255, 255, 0.4);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: min(100%, 300px);
    padding: 14px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.search-box:focus-within {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.search-box__icon {
    width: 18px;
    color: var(--muted);
}

.search-box input {
    width: 100%;
    border: 0;
    outline: none;
    color: var(--text);
    background: transparent;
}

.search-box input::placeholder {
    color: rgba(166, 166, 171, 0.78);
}

.notice {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    line-height: 1.6;
}

.notice--warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
}

.notice--info {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: #d7d7dc;
}

.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    color: var(--muted);
}

.results-bar p {
    margin: 0;
}

.results-bar strong {
    color: var(--text);
}

.library-list {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.library-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px 18px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
    transition: border-color 0.18s ease, background 0.18s ease;
}

.library-item:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}

.library-item[hidden] {
    display: none;
}

.library-item__main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.library-item__icon {
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.library-item__icon svg {
    width: 22px;
    height: 22px;
    color: inherit;
    fill: none;
    overflow: visible;
}

.library-item__icon--directory {
    background: var(--folder-orange-bg);
    color: var(--folder-orange);
}

.library-item__icon--file {
    background: rgba(225, 75, 75, 0.12);
    color: var(--pdf-red);
}

.library-item__content {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.library-item__title {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text);
}

.library-item__title:hover {
    color: var(--accent-strong);
}

.library-item__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-top: 0;
    color: var(--muted);
    font-size: 0.86rem;
    white-space: nowrap;
}

.library-item__actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 700;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.primary-button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
}

.primary-button {
    color: #111113;
    background: linear-gradient(135deg, #f1f1f3 0%, #cfcfd4 100%);
}

.primary-button[aria-busy="true"] {
    opacity: 0.72;
    pointer-events: none;
}

.primary-button__icon,
.ghost-button__icon {
    width: 18px;
}

.ghost-button {
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.whatsapp-fab {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 0 18px 0 16px;
    border-radius: 999px;
    color: #04130d;
    background: linear-gradient(135deg, #4ff0a8 0%, #25d366 100%);
    box-shadow: 0 18px 50px rgba(37, 211, 102, 0.26);
    font-weight: 800;
}

.whatsapp-fab:hover {
    transform: translateY(-2px);
}

.whatsapp-fab__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
}

.whatsapp-fab__icon svg {
    width: 18px;
    fill: currentColor;
}

.whatsapp-fab__label {
    white-space: nowrap;
}


@media (min-width: 901px) {
    .library-item__content {
        flex-wrap: nowrap;
    }
}

.empty-state {
    padding: 48px 20px;
    text-align: center;
}

.empty-state__icon {
    width: 68px;
    margin: 0 auto 18px;
    color: var(--accent-strong);
}

.empty-state__icon svg {
    fill: currentColor;
}

.empty-state h2 {
    margin: 0 0 10px;
    font-size: 1.6rem;
}

.empty-state p {
    max-width: 560px;
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.7;
}

.empty-state .primary-button {
    margin-top: 22px;
}

@media (max-width: 900px) {
    .page-shell {
        width: 95vw;
        max-width: none;
        padding-top: 16px;
        padding-bottom: 28px;
    }

    .hero__content,
    .library-card {
        padding: 18px;
    }

    .toolbar,
    .results-bar {
        flex-direction: column;
        align-items: stretch;
    }

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

    .search-box {
        width: 100%;
        min-width: 0;
    }

    .whatsapp-fab {
        right: 16px;
        bottom: 16px;
        min-height: 52px;
        padding: 0 16px 0 14px;
    }
}

@media (max-width: 720px) {
    .library-item {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .library-item__actions {
        justify-content: flex-start;
    }

    .primary-button,
    .ghost-button {
        width: auto;
        min-width: 160px;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: 95vw;
        max-width: none;
        padding-top: 12px;
        padding-bottom: 24px;
    }

    .hero__content,
    .library-card {
        padding: 16px;
    }

    .hero h1 {
        line-height: 1.08;
    }

    .hero p {
        font-size: 0.98rem;
    }

    .library-item {
        padding: 12px;
    }

    .library-item__main {
        align-items: flex-start;
    }

    .library-item__content {
        display: block;
        overflow: visible;
    }

    .library-item__title {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .library-item__meta {
        margin-top: 6px;
        white-space: normal;
        flex-wrap: wrap;
    }

    .library-item__icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .library-item__icon svg {
        width: 20px;
    }

    .library-item__actions {
        width: 100%;
    }

    .primary-button,
    .ghost-button {
        width: 100%;
        min-width: 0;
    }

    .whatsapp-fab__label {
        display: none;
    }
}
