/* Škola — stilovi aplikacije. Boje, fontovi i razmaci su tokeni; sve ispod ih koristi. */
:root {
    --ink: #17152e;
    --ink-2: #24213f;
    --ink-3: #2f2b52;
    --ink-text: #c9c6de;
    --ink-muted: #8e8aad;

    --paper: #f6f5fa;
    --card: #ffffff;
    --rule: #e7e4f0;
    --rule-2: #d9d5e6;
    --text: #1d1b33;
    --sub: #6a6782;
    --faint: #9a97ae;

    --violet: #5b34e0;
    --violet-ink: #4523c6;
    --violet-soft: #efeafe;
    --blue-soft: #e5effd;
    --blue: #2558c9;
    --danger: #cc2f3a;
    --danger-ink: #a9222c;
    --danger-soft: #fdecec;
    --good: #1d7a4c;

    --font-display: "Unbounded", "IBM Plex Sans", system-ui, sans-serif;
    --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

    --radius: 11px;
    --sidebar-w: 240px;
    --sidebar-w-collapsed: 76px;

    --bs-body-font-family: var(--font-body);
    --bs-body-color: var(--text);
    --bs-body-bg: var(--paper);
    --bs-body-font-size: 14.5px;
    --bs-link-color-rgb: 91, 52, 224;
    --bs-border-color: var(--rule);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--font-body); font-size: 14.5px; line-height: 1.45; }
h1, h2, h3, h4 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.app-shell::before { content: ""; position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--ink); z-index: -1; }
.sidebar-collapsed .app-shell::before { width: var(--sidebar-w-collapsed); }
.sidebar-collapsed .app-shell { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

.sidebar { position: sticky; top: 0; height: 100vh; background: var(--ink); color: var(--ink-text); display: flex; flex-direction: column; gap: 22px; padding: 20px 14px 16px; z-index: 60; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px; text-decoration: none; min-width: 0; }
.brand img { width: 24px; height: 36px; object-fit: contain; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 600; color: #fff; font-size: 17px; line-height: 1.1; white-space: nowrap; }
.brand-sub { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); font-weight: 400; margin-top: 3px; }
.nav-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: #77739a; padding: 0 10px 6px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-nav a { display: flex; align-items: center; gap: 12px; color: var(--ink-text); padding: 9px 10px; border-radius: 8px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.side-nav a i { width: 18px; text-align: center; color: #8f8bb0; flex: none; }
.side-nav a:hover { background: var(--ink-2); color: #fff; }
.side-nav a.active { background: var(--ink-3); color: #fff; }
.side-nav a.active i { color: #b9a7ff; }
.side-nav .count { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-muted); }
.nav-add { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 6px; padding: 8px 10px; border: 1px dashed #3a3660; border-radius: 8px; background: none; color: var(--ink-muted); font-weight: 500; text-align: left; white-space: nowrap; }
.nav-add i { width: 18px; text-align: center; flex: none; }
.nav-add:hover { border-color: #6b62a8; color: #fff; background: var(--ink-2); }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }
.collapse-btn { border: 0; background: none; color: var(--ink-muted); display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; font-size: 13px; white-space: nowrap; }
.collapse-btn:hover { background: var(--ink-2); color: #fff; }
.collapse-btn i { width: 18px; text-align: center; transition: transform .2s ease; }
.user-box { border-top: 1px solid var(--ink-2); padding-top: 14px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink-3); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; text-transform: uppercase; }
.user-name { min-width: 0; flex: 1; }
.user-name b { display: block; color: #fff; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.user-name span { font-size: 12px; color: var(--ink-muted); }
.logout-btn { border: 0; background: var(--ink-2); color: var(--ink-text); width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.logout-btn:hover { background: var(--ink-3); color: #fff; }

.sidebar-collapsed .brand-name, .sidebar-collapsed .nav-label, .sidebar-collapsed .side-nav span,
.sidebar-collapsed .user-name, .sidebar-collapsed .collapse-btn span { display: none; }
.sidebar-collapsed .side-nav a, .sidebar-collapsed .collapse-btn, .sidebar-collapsed .nav-add { justify-content: center; }
.sidebar-collapsed .nav-add span { display: none; }
.sidebar-collapsed .brand { justify-content: center; padding: 4px 0; }
.sidebar-collapsed .user-box { flex-direction: column; }
.sidebar-collapsed .collapse-btn i { transform: rotate(180deg); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 40; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--card); border-bottom: 1px solid var(--rule); }
.menu-btn { display: none; border: 0; background: none; width: 38px; height: 38px; border-radius: 8px; color: var(--text); place-items: center; }
.menu-btn:hover { background: var(--paper); }
.content { flex: 1; padding: 26px 28px 40px; display: flex; flex-direction: column; gap: 22px; min-width: 0; width: 100%; max-width: 1400px; }
.browser { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.app-foot { padding: 12px 28px; color: var(--faint); font-size: 12px; border-top: 1px solid var(--rule); background: var(--card); }
.sidebar-scrim { display: none; }

/* ---------- Search ---------- */
.search { position: relative; flex: 1; max-width: 540px; }
.search input { width: 100%; height: 38px; border: 1px solid var(--rule); background: var(--paper); border-radius: 9px; padding: 0 12px 0 36px; font: inherit; color: var(--text); }
.search input::placeholder { color: #8d8aa3; }
.search input:focus { outline: none; border-color: var(--violet); background: #fff; box-shadow: 0 0 0 3px var(--violet-soft); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8d8aa3; font-size: 13px; pointer-events: none; }
.search-results { position: absolute; left: 0; right: 0; top: 44px; background: #fff; border: 1px solid var(--rule); border-radius: 11px; box-shadow: 0 12px 34px rgba(23, 21, 46, .16); padding: 6px; max-height: min(420px, 70vh); overflow: auto; }
.search-head { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); padding: 6px 9px 4px; }
.search-item { display: flex; gap: 11px; align-items: center; padding: 8px 9px; border-radius: 8px; color: var(--text); text-decoration: none; }
.search-item:hover, .search-item.is-active { background: var(--paper); color: var(--text); }
.search-item .si-text { min-width: 0; flex: 1; }
.search-item .si-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item .si-path { font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item .si-date { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); flex: none; }
.search-item mark { background: #fff1b8; color: inherit; border-radius: 2px; padding: 0; }
.search-empty { padding: 14px; color: var(--sub); }

/* ---------- Buttons ---------- */
.sk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--rule-2); background: #fff; color: var(--text); font-weight: 500; white-space: nowrap; text-decoration: none; cursor: pointer; }
.sk-btn:hover { border-color: #bfb9d6; background: #fbfaff; color: var(--text); }
.sk-btn i { font-size: 13px; }
.sk-btn.primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.sk-btn.primary:hover { background: var(--violet-ink); border-color: var(--violet-ink); }
.sk-btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.sk-btn.danger:hover { background: var(--danger-ink); }
.sk-btn:disabled { opacity: .6; cursor: progress; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: #8a87a0; display: inline-grid; place-items: center; font-size: 13px; text-decoration: none; flex: none; }
.icon-btn:hover { background: var(--violet-soft); color: var(--violet); }
.icon-btn.del:hover { background: var(--danger-soft); color: var(--danger); }
.link-btn { border: 0; background: none; padding: 0; color: var(--violet); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* ---------- Page head ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.page-head > div { min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); margin-bottom: 6px; }
.crumbs a { color: var(--sub); text-decoration: none; }
.crumbs a:hover { color: var(--violet); text-decoration: underline; }
.crumbs .sep { font-size: 9px; color: #b1aec4; }
.page-title { font-family: var(--font-display); font-weight: 600; font-size: 25px; margin: 0; letter-spacing: -.01em; line-height: 1.15; overflow-wrap: anywhere; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Drop strip & overlay ---------- */
.drop-strip { border: 1.5px dashed var(--rule-2); border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: center; gap: 14px; color: var(--sub); background: #fbfafd; font-size: 13.5px; }
.drop-strip b { color: var(--text); font-weight: 500; }
.drop-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; flex: none; }
.drop-overlay { position: fixed; inset: 0; z-index: 1080; padding: 18px; background: rgba(23, 21, 46, .35); pointer-events: none; }
.drop-overlay > div { height: 100%; border: 2px dashed var(--violet); border-radius: 18px; background: rgba(239, 234, 254, .95); display: grid; place-items: center; text-align: center; color: var(--violet-ink); }
.drop-overlay i { font-size: 38px; margin-bottom: 12px; }
.drop-overlay b { display: block; font-size: 18px; }
.drop-overlay span { font-size: 14px; color: #5d4e9c; }

/* ---------- Sections ---------- */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.sec-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--sub); }
.sec-tools { display: flex; align-items: center; gap: 8px; }
.view-toggle { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; padding: 2px; background: #fff; }
.view-toggle button { border: 0; background: none; width: 30px; height: 26px; border-radius: 6px; color: var(--sub); }
.view-toggle button.on { background: var(--violet-soft); color: var(--violet); }
.sort-select { height: 32px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; font: inherit; font-size: 13px; color: var(--text); padding: 0 8px; display: none; }

/* ---------- Folders ---------- */
/* Folderi kao lista redova; na širokom ekranu dvije ili tri kolone */
.folder-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 8px 14px; }
.folder-row { display: flex; align-items: center; gap: 12px; padding: 9px 8px 9px 12px; background: #fff; border: 1px solid var(--rule); border-radius: 10px; min-width: 0; position: relative; }
.folder-row:hover { border-color: #c9c1ea; box-shadow: 0 2px 10px rgba(91, 52, 224, .07); }
.folder-ico { width: 32px; height: 32px; border-radius: 8px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; flex: none; font-size: 14px; }
.folder-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.folder-name { font-weight: 500; color: var(--text); text-decoration: none; overflow-wrap: break-word; line-height: 1.3; }
.folder-name::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.folder-row:hover .folder-name { color: var(--violet); }
.folder-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--sub); }
.folder-row .icon-btn { position: relative; z-index: 1; opacity: .4; }
.folder-row .rename-btn { margin-left: 4px; }
.folder-row .rename-btn + .icon-btn { margin-left: -6px; }
.folder-row:hover .icon-btn, .folder-row:focus-within .icon-btn { opacity: 1; }

/* ---------- File list ---------- */
.file-list { background: #fff; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.file-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) 92px 130px 152px; align-items: center; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--rule); min-height: 54px; }
.file-list.has-class .file-row { grid-template-columns: 50px 90px minmax(0, 1fr) 92px 130px 152px; }
.file-row:first-child { border-top: 0; }
.file-row:not(.file-head):hover { background: #fbfaff; }
.file-head { min-height: 38px; padding-block: 4px; background: #faf9fd; }
.sort-btn { border: 0; background: none; padding: 4px 0; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); display: inline-flex; align-items: center; gap: 6px; text-align: left; cursor: pointer; white-space: nowrap; }
.sort-btn:hover { color: var(--text); }
.sort-btn i { font-size: 9px; opacity: .35; }
.sort-btn.on { color: var(--violet); }
.sort-btn.on i { opacity: 1; }
.file-head .head-actions { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); text-align: right; }
.file-name { min-width: 0; font-weight: 500; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.file-name:hover { color: var(--violet); text-decoration: underline; }
.num { font-family: var(--font-mono); font-size: 12.5px; color: var(--sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.file-meta { display: none; font-family: var(--font-mono); font-size: 11.5px; color: var(--sub); }
.file-actions { display: flex; gap: 2px; justify-content: flex-end; }
.file-row:not(:hover):not(:focus-within) .file-actions .icon-btn { opacity: .55; }
.klass { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; padding: 3px 7px; border-radius: 6px; background: #f0eff5; color: #3d3a56; justify-self: start; white-space: nowrap; }
.klass-none { color: var(--faint); }

.chip { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .03em; width: 42px; height: 26px; border-radius: 6px; display: inline-grid; place-items: center; flex: none; }
.chip-doc { background: #e7eefd; color: #2251c4; }
.chip-pdf { background: #fde9e9; color: #b9262f; }
.chip-xls { background: #e2f2e9; color: #186b42; }
.chip-ppt { background: #fdeee3; color: #b14a12; }
.chip-img { background: #f2e9fb; color: #7034ad; }
.chip-code, .chip-other { background: #eceef2; color: #46505c; }
.chip-zip { background: #f9f1d4; color: #7f6000; }

/* Kartice */
.file-list.as-grid { background: none; border: 0; border-radius: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; overflow: visible; }
.file-list.as-grid .file-head { display: none; }
.file-list.as-grid .file-row, .file-list.as-grid.has-class .file-row { grid-template-columns: 1fr; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; padding: 14px; gap: 8px; align-content: start; }
.file-list.as-grid .chip { width: 48px; height: 30px; font-size: 11px; }
.file-list.as-grid .file-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.9em; }
.file-list.as-grid .col-size, .file-list.as-grid .col-date { display: none; }
.file-list.as-grid .file-meta { display: block; }
.file-list.as-grid .klass { order: -1; }
.file-list.as-grid .klass-none { display: none; }
.file-list.as-grid .file-actions { justify-content: flex-start; margin-left: -6px; }
.view-grid .sort-select { display: inline-block; }

/* Prazno stanje */
.empty-state { border: 1.5px dashed var(--rule-2); border-radius: 14px; padding: 48px 20px; text-align: center; display: grid; justify-items: center; gap: 8px; background: #fbfafd; }
.empty-ico { width: 56px; height: 56px; border-radius: 14px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; font-size: 22px; margin-bottom: 6px; }
.empty-state h2 { margin: 0; font-size: 17px; font-weight: 600; }
.empty-state p { margin: 0; color: var(--sub); max-width: 42ch; }
.empty-state .page-actions { margin-top: 10px; justify-content: center; }

/* ---------- Izbor više fajlova ---------- */
.file-check { display: grid; place-items: center; width: 28px; height: 28px; margin-left: -6px; cursor: pointer; }
.file-check input { width: 16px; height: 16px; accent-color: var(--violet); cursor: pointer; margin: 0; }
.file-row.is-selected { background: var(--violet-soft) !important; }
.file-list .file-row { grid-template-columns: 22px 50px minmax(0, 1fr) 92px 130px 152px; }
.file-list.has-class .file-row { grid-template-columns: 22px 50px 90px minmax(0, 1fr) 92px 130px 152px; }
.file-list.as-grid .file-check { position: absolute; top: 10px; right: 10px; margin: 0; }
.file-list.as-grid .file-row { position: relative; }
.selection-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1080; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; background: var(--ink); color: #fff; padding: 8px 8px 8px 16px; border-radius: 12px; box-shadow: 0 16px 40px rgba(23, 21, 46, .35); max-width: calc(100vw - 32px); }
.selection-bar .sel-count { font-weight: 600; margin-right: 6px; white-space: nowrap; }
.selection-bar .sk-btn { height: 34px; background: var(--ink-2); border-color: var(--ink-3); color: #fff; }
.selection-bar .sk-btn:hover { background: var(--ink-3); color: #fff; }
.selection-bar .sk-btn.danger { background: var(--danger); border-color: var(--danger); }
.selection-bar .sk-btn.ghost { background: none; border-color: transparent; color: var(--ink-text); }

/* ---------- Pregled dokumenta ---------- */
.preview-title { display: flex; align-items: center; gap: 12px; font-size: 21px; }
.preview-title .chip { width: 48px; height: 30px; font-size: 11px; }
.preview-box { background: #e9e8ef; border: 1px solid var(--rule); border-radius: 12px; min-height: 60vh; overflow: hidden; display: flex; flex-direction: column; }
.preview-content { flex: 1; min-width: 0; overflow: auto; }
.preview-status { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; color: var(--sub); text-align: center; }
.preview-status.is-error { color: var(--danger-ink); }
.preview-status a { color: var(--violet); font-weight: 500; }
.preview-note { margin: -8px 0 0; }
.preview-docx .docx-wrapper { background: transparent !important; padding: 24px 16px !important; }
.preview-docx .docx-wrapper > section.docx { box-shadow: 0 2px 12px rgba(23, 21, 46, .15) !important; margin-bottom: 24px !important; }
.preview-pptx .preview-content { padding: 16px; display: flex; justify-content: center; overflow: visible; }
.preview-pptx .pptx-preview-wrapper { height: auto !important; overflow: visible !important; background: transparent !important; }
.preview-pptx .pptx-preview-slide-wrapper { margin: 0 auto 16px !important; box-shadow: 0 2px 12px rgba(23, 21, 46, .18); }
.preview-sheet { background: #fff; }
.sheet-tabs { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--rule); background: #faf9fd; overflow-x: auto; flex: none; }
.sheet-tabs button { border: 1px solid transparent; border-bottom: 0; background: none; padding: 7px 14px; border-radius: 8px 8px 0 0; font-size: 13px; color: var(--sub); white-space: nowrap; cursor: pointer; }
.sheet-tabs button[aria-selected="true"] { background: #fff; border-color: var(--rule); color: var(--text); font-weight: 500; margin-bottom: -1px; }
.sheet-scroll { overflow: auto; max-height: 75vh; }
.sheet-scroll table { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.sheet-scroll td { border: 1px solid #e3e1ea; padding: 4px 8px; white-space: nowrap; vertical-align: top; min-width: 48px; }
.sheet-scroll tr:first-child td { background: #f6f5fa; font-weight: 600; position: sticky; top: 0; }

/* ---------- Početna ---------- */
.hello { font-family: var(--font-display); font-size: 25px; font-weight: 600; margin: 0; }
.hello-sub { color: var(--sub); margin: 4px 0 0; }
.section-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.section-card { border: 1px solid var(--rule); background: #fff; border-radius: 14px; padding: 20px; display: grid; gap: 14px; color: var(--text); text-decoration: none; }
.section-card:hover { border-color: #c9c1ea; box-shadow: 0 4px 18px rgba(91, 52, 224, .09); color: var(--text); }
.section-card .sc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.section-card .sc-top > i { color: #a9a5c0; }
.section-card .sc-ico { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; background: var(--violet-soft); color: var(--violet); }
.section-card.tone-1 .sc-ico { background: var(--blue-soft); color: var(--blue); }
.section-card.tone-2 .sc-ico { background: #e2f2e9; color: #186b42; }
.section-card.tone-3 .sc-ico { background: #fdeee3; color: #b14a12; }
.section-card-new { border: 1.5px dashed var(--rule-2); background: #fbfafd; text-align: left; align-content: start; cursor: pointer; font: inherit; }
.section-card-new:hover { border-color: var(--violet); background: #fff; }
.section-card-new .sc-ico { background: #fff; border: 1px dashed var(--rule-2); color: var(--violet); }
.section-card h2 { margin: 0; font-size: 18px; font-weight: 600; }
.section-card p { margin: 2px 0 0; color: var(--sub); font-size: 13.5px; }
.sc-stat { font-family: var(--font-mono); font-size: 12.5px; color: var(--sub); display: flex; gap: 14px; }
.sc-stat b { color: var(--text); font-weight: 500; }
.recent-list .file-row { grid-template-columns: 50px minmax(0, 1fr) 110px 40px; }
.recent-list .file-path { font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Modali (Bootstrap 5) ---------- */
.modal { --bs-modal-border-radius: 14px; --bs-modal-inner-border-radius: 14px; --bs-modal-border-width: 0; --bs-modal-width: 460px; --bs-modal-padding: 8px 22px 18px; --bs-modal-header-padding: 18px 22px 6px; --bs-modal-header-border-width: 0; --bs-modal-footer-border-color: var(--rule); --bs-modal-footer-bg: #fbfafd; }
.modal-backdrop { --bs-backdrop-bg: #17152e; --bs-backdrop-opacity: .45; }
.modal-content { box-shadow: 0 24px 60px rgba(23, 21, 46, .3); overflow: hidden; }
.modal-title { font-size: 16.5px; font-weight: 600; }
.modal-body { color: var(--sub); display: grid; gap: 12px; }
.modal-body strong { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.modal-footer { padding: 14px 22px; gap: 8px; }
.modal-footer > * { margin: 0; }
.warn-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); display: grid; place-items: center; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text); }
.field input { height: 42px; border: 1px solid var(--rule-2); border-radius: 9px; padding: 0 12px; font: inherit; color: var(--text); background: #fff; width: 100%; }
.field input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.field-error { color: var(--danger); font-size: 13px; }
.field-legend { font-size: 13px; font-weight: 500; color: var(--text); margin: 0; float: none; width: auto; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.icon-picker label { cursor: pointer; }
.icon-picker input { position: absolute; opacity: 0; pointer-events: none; }
.icon-picker span { height: 40px; border: 1px solid var(--rule-2); border-radius: 9px; display: grid; place-items: center; color: var(--sub); background: #fff; }
.icon-picker label:hover span { border-color: #bfb9d6; color: var(--text); }
.icon-picker input:checked + span { border-color: var(--violet); background: var(--violet-soft); color: var(--violet); box-shadow: 0 0 0 2px var(--violet-soft); }
.icon-picker input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; color: var(--text); }
.check-row input { margin-top: 4px; accent-color: var(--violet); flex: none; }
.check-row b { font-weight: 500; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--rule); padding-top: 14px; margin-top: 2px; color: var(--text); }
.danger-zone b { font-weight: 500; }
.danger-zone .sk-btn { flex: none; }
.sk-btn.icon-only { width: 38px; padding: 0; }
.hint { font-size: 12.5px; color: var(--sub); }
.folder-tree { border: 1px solid var(--rule); border-radius: 10px; padding: 6px; max-height: 300px; overflow: auto; color: var(--text); }
.folder-tree label { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; cursor: pointer; min-width: 0; }
.folder-tree label:hover { background: var(--paper); }
.folder-tree label:has(input:checked) { background: var(--violet-soft); }
.folder-tree input { accent-color: var(--violet); margin: 0; flex: none; }
.folder-tree .t-ico { color: var(--violet); font-size: 13px; flex: none; }
.folder-tree .t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-tree label.is-current { color: var(--sub); cursor: default; }
.folder-tree label.is-current .t-ico { color: #b3afc7; }
.folder-tree .here { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--sub); text-transform: uppercase; letter-spacing: .05em; flex: none; }

/* ---------- Toast i otpremanje ---------- */
.toast-stack { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1100; display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.sk-toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; box-shadow: 0 12px 30px rgba(23, 21, 46, .3); pointer-events: auto; animation: toast-in .2s ease; }
.sk-toast i { color: #6fe0a6; }
.sk-toast.error i { color: #ff9aa1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.upload-panel { position: fixed; right: 24px; bottom: 24px; width: 340px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 18px 44px rgba(23, 21, 46, .18); z-index: 1090; overflow: hidden; }
.upload-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; font-weight: 600; font-size: 13.5px; border-bottom: 1px solid var(--rule); }
.upload-items { max-height: 300px; overflow: auto; }
.upload-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--rule); }
.upload-item:first-child { border-top: 0; }
.upload-item .file-name { font-size: 13px; }
.upload-item .num { font-size: 11.5px; }
.upload-item .bar { grid-column: 2 / -1; height: 4px; background: #eeecf5; border-radius: 4px; overflow: hidden; }
.upload-item .bar > i { display: block; height: 100%; background: var(--violet); width: 0; transition: width .2s linear; }
.upload-item.done .bar > i { background: var(--good); }
.upload-item.failed .bar > i { background: var(--danger); width: 100% !important; }
.upload-item .err { grid-column: 2 / -1; color: var(--danger); font-size: 12.5px; }
.upload-foot { padding: 10px 14px; border-top: 1px solid var(--rule); display: flex; justify-content: flex-end; }

/* ---------- Prijava ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; background: var(--ink); position: relative; overflow: hidden; }
.login-page::before { content: ""; position: absolute; width: 640px; height: 640px; right: -180px; top: -220px; background: radial-gradient(closest-side, rgba(107, 64, 240, .42), rgba(107, 64, 240, 0)); pointer-events: none; }
.login-page::after { content: ""; position: absolute; width: 540px; height: 540px; left: -200px; bottom: -260px; background: radial-gradient(closest-side, rgba(38, 113, 250, .28), rgba(38, 113, 250, 0)); pointer-events: none; }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 370px; background: #fff; border-radius: 16px; padding: 30px 28px 24px; display: grid; gap: 16px; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.login-card .brand { padding: 0; margin-bottom: 4px; }
.login-card .brand img { width: 28px; height: 42px; }
.login-card .brand-name { color: var(--text); font-size: 20px; }
.login-card .brand-sub { color: var(--sub); }
.login-card .sk-btn { height: 44px; width: 100%; font-size: 15px; }
.alert-error { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; background: var(--danger-soft); color: #9f2029; font-size: 13.5px; }
.alert-error i { margin-top: 3px; }
.login-foot { font-size: 12px; color: var(--sub); text-align: center; }

/* ---------- Telefon i tablet ---------- */
@media (max-width: 860px) {
    .app-shell, .sidebar-collapsed .app-shell { grid-template-columns: minmax(0, 1fr); }
    .app-shell::before { display: none; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar-open .sidebar { transform: none; }
    .sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(23, 21, 46, .45); z-index: 55; }
    .sidebar-collapsed .brand-name, .sidebar-collapsed .nav-label, .sidebar-collapsed .side-nav span, .sidebar-collapsed .user-name, .sidebar-collapsed .nav-add span { display: revert; }
    .sidebar-collapsed .nav-add { justify-content: flex-start; }
    .sidebar-collapsed .side-nav a { justify-content: flex-start; }
    .sidebar-collapsed .user-box { flex-direction: row; }
    .collapse-btn { display: none; }
    .menu-btn { display: grid; }
    .topbar { padding: 0 12px; gap: 8px; }
    .content { padding: 18px 16px 28px; gap: 18px; }
    .app-foot { padding: 12px 16px; }
}
@media (max-width: 680px) {
    .page-title { font-size: 21px; }
    .page-head .page-actions { width: 100%; }
    .page-head .page-actions .sk-btn { flex: 1; }
    .page-head .page-actions .sk-btn.icon-only { flex: none; }
    .drop-strip .long { display: none; }
    .folder-list { grid-template-columns: minmax(0, 1fr); }
    .folder-row { padding: 10px 6px 10px 10px; }
    .folder-row .icon-btn { opacity: 1; }
    .folder-row .row-extra { display: none; }
    .sort-select { display: inline-block; }
    .file-list:not(.as-grid) .file-head { display: none; }
    .file-list:not(.as-grid) .file-row, .file-list:not(.as-grid).has-class .file-row { grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; padding: 12px; }
    .file-list:not(.as-grid) .chip { grid-row: 1 / span 2; align-self: start; }
    .file-list:not(.as-grid) .klass { grid-column: 2; margin-bottom: 2px; }
    .file-list:not(.as-grid) .klass-none { display: none; }
    .file-list:not(.as-grid) .file-name { white-space: normal; grid-column: 2; }
    .file-list:not(.as-grid) .col-size, .file-list:not(.as-grid) .col-date { display: none; }
    .file-list:not(.as-grid) .file-meta { display: block; grid-column: 2; }
    .file-list:not(.as-grid) .file-actions { grid-column: 1 / -1; justify-content: flex-start; margin-top: 6px; padding-left: 56px; }
    .file-list:not(.as-grid) .file-actions .icon-btn { opacity: 1; background: var(--paper); }
    .file-list:not(.as-grid) .file-row { position: relative; }
    .file-list:not(.as-grid) .file-check { position: absolute; top: 10px; right: 8px; margin: 0; }
    .file-list:not(.as-grid) .file-name { padding-right: 28px; }
    .selection-bar { bottom: 12px; width: calc(100vw - 24px); justify-content: flex-start; }
    .selection-bar .sk-btn span { display: none; }
    .recent-list .file-row { grid-template-columns: 44px minmax(0, 1fr) !important; }
    .recent-list .col-date, .recent-list .file-actions { display: none !important; }
    .upload-panel { right: 12px; left: 12px; bottom: 12px; width: auto; max-width: none; }
    .toast-stack { bottom: 16px; }
    .sk-toast { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
