/* Library UI (lib-*) — shared by the Club Desk library (ClubLibrary.razor) and the League Owner
   library (LeagueLibrary.razor). Global so both pages reuse it; selectors are lib- namespaced so
   they never collide. Theme- and accent-aware via design-tokens.css. */

/* ── Tabs ── */
.lib-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--hairline);
    margin: 8px 0 20px;
}

.lib-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--fg-muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: -1px;
}

.lib-tab:disabled { cursor: default; opacity: 0.55; }
.lib-tab .material-symbols-outlined { font-size: 19px; }
.lib-tab--active { color: var(--fg); border-bottom-color: var(--accent-text, var(--accent)); }

.lib-tab__n {
    font-family: var(--type-data, monospace);
    font-size: 12px;
    background: var(--surface-raised);
    border-radius: 999px;
    padding: 1px 8px;
}

.lib-tab__soon {
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--surface-raised);
    border-radius: 999px;
    padding: 2px 7px;
}

/* ── Toolbar + chips ── */
.lib-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.lib-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.lib-chip {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    background: var(--surface);
    color: var(--fg-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.lib-chip--active {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

/* ── Folder grid ── */
.lib-folders {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.lib-folder {
    --tone: #2f6fd6;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.12s, transform 0.12s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lib-folder:hover { border-color: var(--hairline-strong); transform: translateY(-1px); }

.lib-folder__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lib-folder__ic {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--tone) 16%, transparent);
    color: var(--tone);
}

.lib-folder__ic .material-symbols-outlined { font-size: 23px; }

.lib-folder__cnt {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: var(--type-data, monospace);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: var(--fg);
}

.lib-folder__cnt small { font-size: 9px; letter-spacing: 0.08em; color: var(--fg-dim); margin-top: 3px; }
.lib-folder__nm { font-weight: 700; font-size: 16px; color: var(--fg); }
.lib-folder__blurb { font-size: 13px; color: var(--fg-muted); line-height: 1.35; }
.lib-folder__foot { margin-top: auto; }

.lib-tone--blue { --tone: #2f6fd6; }
.lib-tone--orange { --tone: #e2522b; }
.lib-tone--gold { --tone: #c79100; }
.lib-tone--green { --tone: #1f8a4e; }
.lib-tone--red { --tone: #d23b3b; }
.lib-tone--violet { --tone: #6b54c6; }

/* ── Section heading ── */
.lib-section-h {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 26px 0 12px;
}

.lib-section-h h3 { margin: 0; font-size: 16px; }

/* ── File rows ── */
.lib-files { display: flex; flex-direction: column; gap: 8px; }

.lib-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--surface);
}

.lib-file__type {
    flex: none;
    width: 44px;
    text-align: center;
    padding: 5px 0;
    border-radius: 7px;
    font-family: var(--type-data, monospace);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: var(--surface-raised);
    color: var(--fg-muted);
}

.lib-file__type--pdf { background: rgba(210, 59, 59, 0.14); color: #d23b3b; }
.lib-file__type--image { background: rgba(31, 138, 78, 0.14); color: #1f8a4e; }
.lib-file__type--slides { background: rgba(226, 82, 43, 0.14); color: #e2522b; }
.lib-file__type--sheet { background: rgba(31, 138, 78, 0.14); color: #1f8a4e; }
.lib-file__type--doc { background: rgba(47, 111, 214, 0.14); color: #2f6fd6; }
.lib-file__type--video { background: rgba(107, 84, 198, 0.14); color: #6b54c6; }

.lib-file__main { flex: 1; min-width: 0; }
.lib-file__name { font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lib-file__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 3px;
}

.lib-file__sub { font-size: 12px; color: var(--fg-dim); }

.lib-tag {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--surface-raised);
    color: var(--fg-muted);
}

.lib-file__act {
    flex: none;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid transparent;
    background: none;
    color: var(--fg-muted);
    cursor: pointer;
    text-decoration: none;
}

.lib-file__act:hover { background: var(--surface-raised); color: var(--fg); }
.lib-file__act--danger:hover { color: var(--semantic-danger, #d23b3b); }
.lib-file__act .material-symbols-outlined { font-size: 19px; }

/* ── Folder detail ── */
.lib-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--fg-muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 8px;
}

.lib-back .material-symbols-outlined { font-size: 18px; }

.lib-folder-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.lib-folder-title { margin: 0 0 6px; font-size: 26px; }
.lib-folder-blurb { margin: 8px 0 0; color: var(--fg-muted); }
.lib-reqdoc { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 7px 12px; border: 1px solid var(--hairline); border-radius: 8px; color: var(--accent-text, var(--accent)); text-decoration: none; font-weight: 600; font-size: 13px; }
.lib-reqdoc:hover { background: var(--surface-raised); }
.lib-reqdoc .material-symbols-outlined { font-size: 17px; }

.lib-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-fg);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.lib-upload-btn .material-symbols-outlined { font-size: 18px; }

/* Hide the native file input behind the styled label. Global stylesheet, so a plain descendant
   selector (no ::deep, which is scoped-CSS only) hits the InputFile's rendered <input>. */
.lib-upload-btn input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

/* ── Requests: list ── */
.lib-reqs { display: flex; flex-direction: column; gap: 10px; }

.lib-req {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    padding: 14px 16px;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
}

.lib-req:hover { border-color: var(--hairline-strong); }

.lib-req__ic {
    --tone: #2f6fd6;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--tone) 16%, transparent);
    color: var(--tone);
}

.lib-reqkind--esign { --tone: #2f6fd6; }
.lib-reqkind--upload { --tone: #e2522b; }
.lib-reqkind--acknowledge { --tone: #1f8a4e; }

.lib-req__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lib-req__kind { font-family: var(--type-data, monospace); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-dim); }
.lib-req__ttl { font-weight: 700; font-size: 16px; color: var(--fg); }
.lib-req__meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--fg-muted); margin-top: 2px; }
.lib-due--urgent { color: var(--semantic-warning, #c79100); font-weight: 600; }
.lib-req__overdue { color: var(--semantic-danger, #d23b3b); font-weight: 600; }

.lib-req__right { flex: none; width: 180px; display: flex; flex-direction: column; gap: 6px; }
.lib-prog__head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--type-data, monospace); }
.lib-prog__head b { font-size: 17px; color: var(--fg); }
.lib-prog__head small { font-size: 11px; color: var(--fg-dim); }
.lib-prog__track { height: 7px; border-radius: 999px; background: var(--surface-raised); overflow: hidden; }
.lib-prog__fill { display: block; height: 100%; border-radius: 999px; }

/* ── Requests: detail ── */
.lib-reqkind {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-family: var(--type-data, monospace);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
    background: color-mix(in srgb, var(--tone, #2f6fd6) 16%, transparent);
    color: var(--tone, #2f6fd6);
}

.lib-sumrow {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 18px 0;
}

.lib-sumcard {
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--surface);
}

.lib-sumcard .v { font-family: var(--type-data, monospace); font-size: 28px; font-weight: 700; line-height: 1; color: var(--fg); }
.lib-sumcard .v.sm { font-size: 19px; }
.lib-sumcard .v.ok { color: var(--semantic-success, #1f8a4e); }
.lib-sumcard .v.danger { color: var(--semantic-danger, #d23b3b); }
.lib-sumcard .l { font-size: 12px; color: var(--fg-dim); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.04em; }

.lib-segctl { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--surface-raised); margin-bottom: 14px; }

.lib-seg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 7px;
    background: none;
    color: var(--fg-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.lib-seg--active { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.lib-seg .n { font-family: var(--type-data, monospace); font-size: 11px; color: var(--fg-dim); }

.lib-rtable { border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; }

.lib-rtable__head,
.lib-rtable__row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.2fr 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
}

.lib-rtable__head {
    font-family: var(--type-data, monospace);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fg-dim);
    background: var(--surface-raised);
}

.lib-rtable__row { border-top: 1px solid var(--hairline); }

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

.lib-ravatar {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-raised);
    font-family: var(--type-data, monospace);
    font-size: 12px;
    font-weight: 700;
    color: var(--fg-muted);
}

.lib-rplayer__nm { font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-rguardian { color: var(--fg-muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-rwhen { font-family: var(--type-data, monospace); font-size: 13px; color: var(--fg-dim); }

.lib-statpill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.lib-statpill .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lib-statpill--ok { background: rgba(31,138,78,0.14); color: #1f8a4e; }
.lib-statpill--info { background: rgba(47,111,214,0.14); color: #2f6fd6; }
.lib-statpill--warn { background: rgba(199,145,0,0.16); color: #c79100; }
.lib-statpill--danger { background: rgba(210,59,59,0.14); color: #d23b3b; }
