/* ----- LİBRARY.HTML ----- */

.library-page .lib {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 22px;
    align-items: start;
}

@media (max-width: 980px) {
    .library-page .lib {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .library-page .lib-side {
        position: static;
    }
}

.library-page .lib-side {
    align-self: start;
    position: sticky;
    top: 140px;
    z-index: 10;
}

.library-page .lib-side .card {
    padding: 16px
}

.library-page .lib-title {
    font-weight: 800;
    color: #0b2e5c;
    margin-bottom: 10px
}

.library-page .lib-note {
    color: #475569;
    font-size: .95rem;
    margin-bottom: 12px
}

.library-page .lib-search {
    display: flex;
    gap: 8px;
    margin-bottom: 12px
}

.library-page .lib-search input {
    flex: 1;
    min-width: 180px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 12px;
    font: inherit;
    transition: border-color .3s ease, box-shadow .3s ease
}

.library-page .lib-search input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(7, 91, 94, 0.1)
}

.library-page .lib-search button {
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--brand);
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease;
}

.library-page .lib-search button:hover {
    background: #064a4c;
}

/* Search input focus */
.library-page .lib-search input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(7, 91, 94, 0.1);
}

/* Mobile category select */
.library-page .lib-cat-mobile {
    display: none;
    margin-bottom: 20px;
}

.library-page .lib-cat-mobile .category-select {
    width: 100%;
    height: 48px;
    padding: 0 40px 0 16px;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230b2e5c' d='M2 4l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 16px center;
    color: #0b2e5c;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.library-page .lib-cat-mobile .category-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(7, 91, 94, 0.1);
}

/* Desktop/Mobile visibility */
@media (max-width: 768px) {
    .library-page .lib-nav-desktop {
        display: none !important;
    }

    .library-page .lib-cat-mobile {
        display: block;
    }
}

.library-page .lib-filter {
    margin-top: 10px
}

.library-page .lib-filter .lbl {
    font-size: .9rem;
    color: #475569;
    margin-bottom: 8px
}

.library-page .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.library-page .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #e6eef3;
    border-radius: 999px;
    background: #fff;
    color: #0b2e5c;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    transition: all .3s ease
}

.library-page .chip:hover {
    background: #f8fafc;
    border-color: #cbd5e1
}

.library-page .chip input {
    accent-color: var(--brand)
}

.library-page .checks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px
}

.library-page .checks label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .95rem;
    color: #0f172a
}

.library-page .checks input {
    accent-color: var(--brand)
}

.library-page .lib-main {
    align-self: start
}

.library-page .lib-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 30px
}

.library-page .lib-nav button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: all .3s ease
}

.library-page .lib-nav button:hover:not([aria-pressed="true"]) {
    background: #f8fafc;
    border-color: #cbd5e1
}

.library-page .lib-nav button[aria-pressed="true"] {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand)
}

.library-page .lib-count {
    margin-left: auto;
    color: #475569
}

.library-page .docs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px
}

@media (max-width: 1100px) {
    .library-page .docs {
        grid-template-columns: 1fr
    }
}

.library-page .doc {
    display: grid;
    grid-template-columns: 120px 1fr;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .06);
    transition: transform .3s ease, box-shadow .3s ease
}

.library-page .doc+.doc {
    margin-top: 0;
}

.library-page .doc:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .12)
}

.library-page .doc.aside {
    grid-template-columns: 1fr
}

.library-page .doc-left {
    position: relative;
    background: linear-gradient(135deg, #f0f7f8, #e9f0ff);
    display: grid;
    place-items: center;
    border-right: 1px solid #e6eef3
}

.library-page .doc-left .file {
    width: 64px;
    height: 82px;
    border-radius: 10px;
    background: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
    position: relative
}

.library-page .doc-left .file:after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 24px;
    height: 20px;
    border-radius: 0 10px 0 6px;
    background: var(--brand);
    opacity: .12
}

.library-page .doc-left svg {
    width: 28px;
    height: 28px;
    color: var(--brand);
    opacity: .9
}

.library-page .doc-left .type {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #e6eef3;
    background: #fff;
    font-weight: 700;
    font-size: .7rem;
    color: #0b2e5c;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center
}

.library-page .doc-body {
    padding: 12px 14px
}

.library-page .doc-title {
    font-weight: 800;
    color: #0b2e5c;
    margin-bottom: 6px
}

.library-page .doc-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: .92rem;
    margin-bottom: 8px
}

.library-page .doc-meta .dot:before {
    content: "·";
    margin: 0 6px;
    color: #cbd5e1
}

.library-page .doc-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.library-page .btn {
    height: 34px
}

.library-page .status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    margin-left: 6px
}

.library-page .ok {
    background: #e8f7ee;
    color: #065f46;
    border: 1px solid #d2efdd
}

.library-page .off {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca
}

.library-page .doc .mini svg {
    width: 16px;
    height: 16px
}

.library-page .doc-desc {
    font-size: .9rem;
    color: #64748b;
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.library-page .lib-mobile-bar {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.library-page .lib-mobile-bar .btn {
    height: 38px;
}

.library-page .lib-count.desktop {
    display: inline-flex;
}

.library-page .lib-count.mobile {
    display: none;
}

@media (max-width: 720px) {
    .library-page .lib {
        grid-template-columns: 1fr;
    }

    .library-page .lib-side {
        position: relative;
        top: auto;
        z-index: 1;
        display: none;
    }

    .library-page .lib-side.open {
        display: block;
    }

    .library-page .lib-mobile-bar {
        display: flex;
    }

    .library-page .lib-count.desktop {
        display: none;
    }

    .library-page .docs {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .library-page .doc {
        grid-template-columns: 1fr;
    }

    .library-page .doc-left {
        border-right: none;
        border-bottom: 1px solid #e6eef3;
        padding: 10px 0;
    }

    .library-page .doc-body {
        padding: 12px 12px 16px;
    }

    .library-page .doc-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .library-page .lib-search {
        flex-direction: column;
        gap: 6px;
    }

    .library-page .lib-search input,
    .library-page .lib-search button {
        width: 100%;
    }

    .library-page .chips {
        gap: 6px;
    }
}

.library-page .empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 14px;
    text-align: center
}

.library-page .empty-state .empty-icon {
    width: 64px;
    height: 64px;
    color: #94a3b8;
    margin-bottom: 16px
}

.library-page .empty-state p {
    color: #64748b;
    font-size: 1rem;
    font-weight: 600
}