/**
 * TMRU — dizajn sistem (2026)
 * Učitava se posljednji; nadjačava starije stilove.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #eef2f6;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --text: #0f172a;
    --text-secondary: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;

    --primary: #2d9a47;
    --primary-hover: #248a3d;
    --primary-soft: #ecfdf3;
    --primary-ring: rgba(45, 154, 71, 0.18);

    --blue: var(--primary);
    --blue-dark: var(--primary-hover);
    --blue-soft: var(--primary-soft);
    --white: var(--surface);

    --sidebar-bg: #0f172a;
    --sidebar-elevated: #1e293b;
    --sidebar-border: #334155;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #f1f5f9;

    --warn: #b45309;
    --warn-bg: #fffbeb;
    --warn-line: #fde68a;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --ok: #15803d;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.14);

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --sidebar: 232px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* —— App shell —— */
.app {
    max-width: none;
    margin: 0;
    background: var(--bg);
    box-shadow: none;
}

.main {
    background: var(--bg);
}

.view {
    padding: 16px;
}

.view-desc {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 16px;
}

/* —— Buttons —— */
.btn,
.btn-go,
.desk-btn-add,
.imenik-add-btn,
.mob-search .btn-go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn:active,
.btn-go:active,
.desk-btn-add:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
    border-radius: var(--radius-sm);
}

.btn-primary,
.btn-go,
.desk-btn-add,
.imenik-add-btn {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(45, 154, 71, 0.28);
}

.btn-primary:hover,
.btn-go:hover,
.desk-btn-add:hover,
.imenik-add-btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-outline {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--line-strong);
}

.btn-outline:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
    color: var(--text);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: #fee2e2;
}

.btn:disabled,
.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* —— Mobile header —— */
.mob-hdr {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-xs);
    padding: calc(10px + var(--safe-t)) 14px 10px;
}

.mob-menu-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mob-menu-btn:active {
    background: var(--primary-soft);
    color: var(--primary);
}

.mob-page-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.mob-hdr-out,
.mob-sidebar-out,
.desk-logout,
.desk-topbar-logout {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}

.mob-hdr-out:hover,
.mob-sidebar-out:hover,
.desk-logout:hover,
.desk-topbar-logout:hover {
    background: var(--surface-2);
    color: var(--text);
}

/* —— Sidebars —— */
.mob-sidebar,
.desk-sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
}

.mob-sidebar-brand,
.desk-brand {
    border-bottom: 1px solid var(--sidebar-border);
    padding: 20px 18px;
}

.mob-sidebar-brand strong,
.desk-brand strong {
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.mob-sidebar-brand small,
.desk-brand small {
    color: var(--sidebar-text);
    font-size: 12px;
}

.mob-nav-btn,
.desk-nav-btn {
    border-radius: var(--radius);
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--sidebar-text);
    transition: background 0.15s, color 0.15s;
}

.mob-nav-btn:hover,
.mob-nav-btn:active,
.desk-nav-btn:hover {
    background: var(--sidebar-elevated);
    color: var(--sidebar-text-hover);
}

.mob-nav-btn.active,
.desk-nav-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 12px rgba(45, 154, 71, 0.35);
}

.mob-nav-btn.active:hover,
.desk-nav-btn.active:hover {
    background: var(--primary-hover);
    color: #fff;
}

.mob-sidebar-foot {
    border-top: 1px solid var(--sidebar-border);
    padding: 14px;
}

.mob-sidebar-foot .profile-user-link {
    color: var(--sidebar-text-hover);
    border-radius: var(--radius);
    padding: 10px 12px;
}

.mob-sidebar-foot .profile-user-link:hover {
    background: var(--sidebar-elevated);
}

/* —— Desktop topbar —— */
.desk-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px;
    box-shadow: var(--shadow-xs);
    gap: 16px;
}

.desk-page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.desk-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' d='M11 19a8 8 0 100-16 8 8 0 000 16zM21 21l-4.3-4.3'/%3E%3C/svg%3E") 14px center no-repeat;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.desk-search input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.desk-topbar-user {
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: var(--surface-2);
    padding: 4px 12px 4px 4px;
    font-weight: 600;
    font-size: 13px;
}

.desk-topbar-user:hover {
    background: var(--primary-soft);
    border-color: #86efac;
}

.desk-btn-add {
    border-radius: var(--radius);
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
}

/* —— Cards & panels —— */
.desk-card,
.imenik-shell,
.seme-add-box,
.seme-list-wrap,
.adm-shell,
.notes-wrap,
.profile-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.desk-card-hdr,
.imenik-head,
.seme-list-head,
.adm-head {
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    padding: 14px 18px;
    font-size: 13px;
    color: var(--muted);
}

.desk-card-hdr strong,
.imenik-head-title,
.adm-head-title,
.seme-page-title {
    color: var(--text);
    font-weight: 700;
}

/* —— Filter chips —— */
.filter-chip {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    min-height: 38px;
    transition: all 0.15s ease;
}

.filter-chip:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
}

.filter-chip.active {
    background: var(--primary-soft);
    border-color: #86efac;
    color: var(--primary-hover);
    box-shadow: inset 0 0 0 1px rgba(45, 154, 71, 0.12);
}

.filter-ormar,
.adm-role-select,
.adm-audit-select {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 13px;
    font-family: var(--font);
    background: var(--surface);
    min-height: 38px;
}

.filter-ormar:focus,
.adm-role-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

/* —— Valve / imenik cards —— */
.valve-card,
.imenik-card {
    border-radius: var(--radius-lg);
    border-color: var(--line);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.valve-card:hover,
.imenik-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.valve-card-num,
.imenik-card-lokal {
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary);
}

.valve-pill,
.imenik-pill {
    background: var(--surface-3);
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.valve-card-call,
.imenik-card-call {
    border-radius: var(--radius-pill);
    box-shadow: 0 2px 8px rgba(45, 154, 71, 0.25);
}

/* —— Valve panel tabs —— */
.valve-tabs {
    background: var(--surface-3);
    border-radius: var(--radius);
    padding: 4px;
    gap: 4px;
}

.valve-tab {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    color: var(--muted);
    min-height: 38px;
}

.valve-tab.is-active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.valve-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.valve-compose,
.imenik-form-panel {
    background: var(--surface-2);
}

.valve-compose textarea,
.imenik-form-row input,
.imenik-form-note {
    border-radius: var(--radius);
    border-color: var(--line);
    font-family: var(--font);
}

.valve-compose textarea:focus,
.imenik-form-row input:focus,
.imenik-form-note:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.btn-save-big,
.btn-unos {
    border-radius: var(--radius);
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(45, 154, 71, 0.28);
}

.btn-photo,
.btn-photo-big {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-secondary);
    font-weight: 600;
}

.btn-photo:hover,
.btn-photo-big:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
}

/* —— Admin —— */
.adm-subtabs {
    display: flex;
    gap: 6px;
    padding: 6px;
    background: var(--surface-3);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.adm-subtab {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s;
}

.adm-subtab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.adm-user-row,
.adm-audit-row {
    border-bottom: 1px solid var(--line);
    transition: background 0.1s;
}

.adm-user-row:hover,
.adm-audit-row:hover {
    background: var(--surface-2);
}

.adm-head-search,
.imenik-search,
.unos-filter,
.mob-search input {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    font-family: var(--font);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.adm-head-search:focus,
.imenik-search:focus,
.unos-filter:focus,
.mob-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

/* —— Seme —— */
.seme-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.seme-card:hover {
    box-shadow: var(--shadow-sm);
}

/* —— Seme ventila: široko + scroll —— */
body.tab-seme .main {
    align-items: stretch !important;
}

body.tab-seme #view-seme {
    max-width: none !important;
    width: 100%;
}

.seme-page {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

.seme-page-title {
    font-size: 22px;
    font-weight: 800;
    text-align: left;
}

.seme-add-box .view-desc {
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
}

.seme-add-box {
    text-align: left;
}

.seme-list-wrap {
    text-align: left;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.seme-list-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0;
}

.seme-list-head h3 {
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    font-weight: 700;
}

.seme-head-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.seme-search {
    max-width: 280px;
    min-width: 160px;
    flex: 1;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 14px;
}

.seme-list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 14px 2px 4px 0;
    scrollbar-gutter: stable;
}

.seme-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.seme-card {
    grid-template-columns: 108px 1fr;
    gap: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    width: 100%;
}

.seme-preview {
    width: 108px;
    height: 108px;
    border-radius: var(--radius);
}

.seme-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 6px;
}

.seme-meta {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.seme-card-actions .btn-seme-view,
.seme-card-actions .btn-seme-dl {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.seme-empty {
    padding: 32px 16px;
    font-size: 14px;
}

/* Draft slike — scroll kad ih ima puno */
.valve-compose-photos .note-photos {
    max-height: min(340px, 42vh);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 2px 4px 2px 0;
    scrollbar-gutter: stable;
}

.note-photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
}

.note-photo-thumb {
    border-radius: var(--radius);
}

@media (min-width: 900px) {
    body.tab-seme .main .view.active#view-seme {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    body.tab-seme .seme-page {
        flex: 1;
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
        gap: 20px;
        align-items: stretch;
        overflow: hidden;
    }

    body.tab-seme .seme-add-box {
        margin-bottom: 0;
        height: fit-content;
        max-height: 100%;
        overflow-y: auto;
    }

    body.tab-seme .seme-list-wrap {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        max-height: none;
    }

    body.tab-seme .seme-list-scroll {
        max-height: none;
    }
}

@media (max-width: 899px) {
    .seme-page-title {
        text-align: center;
    }

    .seme-add-box .view-desc {
        text-align: center;
    }

    .seme-add-box {
        text-align: center;
    }

    .seme-list-head {
        flex-direction: column;
        align-items: stretch;
    }

    .seme-search {
        max-width: none;
        width: 100%;
    }

    .seme-list-scroll {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    body.tab-seme .main {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .seme-card {
        grid-template-columns: 80px 1fr;
        gap: 12px;
        padding: 12px;
    }

    .seme-preview {
        width: 80px;
        height: 80px;
    }
}


.seme-card-openable {
    cursor: pointer;
}

.seme-card-openable:hover .seme-name {
    color: var(--primary);
}

.seme-preview-pdf {
    flex-direction: column;
    gap: 4px;
    background: linear-gradient(145deg, #fef2f2, #fff7ed);
}

.seme-pdf-open {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.2;
    padding: 0 4px;
    text-align: center;
}

.seme-hint {
    margin: 0 0 12px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.doc-viewer-open-tab,
.doc-viewer-dl {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
}

.doc-viewer-box {
    width: min(1100px, 100%);
    max-height: calc(100dvh - 24px);
    border-radius: var(--radius-lg);
}

.doc-viewer-frame {
    min-height: 70vh;
}


.btn-seme {
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
    border: 1px dashed #86efac !important;
    border-radius: var(--radius) !important;
    font-weight: 600 !important;
}

.btn-seme-save {
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(45, 154, 71, 0.25);
}

.btn-seme-view,
.btn-seme-dl {
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* —— Forms & modals —— */
.form-overlay,
.adm-edit-overlay,
.confirm-overlay {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.form-modal,
.adm-edit-box,
.confirm-box {
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
}

.form-modal-hdr,
.adm-edit-head {
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}

.form-group input,
.form-group textarea {
    border-radius: var(--radius);
    border-color: var(--line);
    font-family: var(--font);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.panel-close,
.photo-lightbox-close,
.doc-viewer-close {
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    transition: background 0.15s, color 0.15s;
}

.panel-close:hover {
    background: var(--surface-3);
    color: var(--text);
}

/* —— Notes —— */
.notes-area {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    padding: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.notes-area:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

/* —— FAB —— */
.mob-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 28px;
    font-weight: 300;
    border: none;
    box-shadow: 0 6px 20px rgba(45, 154, 71, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}

.mob-fab:active {
    transform: scale(0.94);
}

/* —— Badges —— */
.badge,
.imenik-head-count,
.adm-head-count {
    background: #f59e0b;
    color: #fff;
    font-weight: 700;
    border-radius: var(--radius-pill);
}

.imenik-head-count,
.adm-head-count {
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    padding: 3px 10px;
}

/* —— Empty / loading —— */
.valve-list-empty,
.imenik-empty,
.empty {
    color: var(--muted);
    font-weight: 600;
}

.global-loading-box {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.global-loading-spinner {
    border-color: var(--line);
    border-top-color: var(--primary);
}

/* —— Unos cards —— */
.unos-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-xs);
}

.unos-card.mine {
    border-color: #bbf7d0;
    background: #f6fff8;
}

.unos-action-btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-family: var(--font);
}

/* —— Profile page —— */
.profile-page {
    background: var(--bg);
    font-family: var(--font);
}

.profile-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

.profile-hdr h1 {
    font-weight: 800;
}

.profile-back {
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-weight: 600;
}

/* —— Login (kad se učita theme.css) —— */
.login-page {
    font-family: var(--font);
}

.login-box {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.login-box input {
    border-radius: var(--radius);
    background: var(--surface-2);
}

.login-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.login-box button[type="submit"] {
    border-radius: var(--radius);
    background: var(--primary);
    box-shadow: 0 4px 14px rgba(45, 154, 71, 0.3);
    font-weight: 700;
}

.login-box button[type="submit"]:hover {
    background: var(--primary-hover);
}

/* —— Mobile tweaks —— */
@media (max-width: 899px) {
    .app {
        background: var(--bg);
    }

    .main {
        padding-bottom: calc(20px + var(--safe-b));
    }

    .view {
        padding: 14px;
    }

    .mob-search input {
        border-radius: var(--radius);
        font-weight: 500;
        background-color: var(--surface);
    }

    .mob-search .btn-go {
        border-radius: var(--radius);
        padding: 12px 16px;
    }

    .valve-panel {
        background: var(--bg);
    }
}

@media (min-width: 900px) {
    .main {
        padding: 14px 16px;
        background: var(--bg);
    }

    .desk-card,
    .imenik-page .imenik-shell,
    .seme-page,
    .adm-page .adm-shell {
        border-radius: var(--radius-lg);
    }
}

/* —— Upozorenja & istorija —— */
.warn-banner,
.valve-warn-banner {
    border-radius: var(--radius);
    border: 1px solid var(--warn-line);
    background: var(--warn-bg);
    color: var(--warn);
    font-weight: 600;
    padding: 12px 14px;
}

.unos-card-head {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.unos-icon-btn {
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
}

.unos-icon-btn:hover {
    background: var(--surface-2);
}

.unos-edit-input {
    border-radius: var(--radius);
    border-color: var(--line);
    font-family: var(--font);
}

/* —— Sidebar backdrop —— */
.mob-sidebar-backdrop {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* —— Avatari —— */
.profile-avatar,
.profile-avatar-lg,
.desk-topbar-avatar,
.mob-hdr-avatar {
    border-radius: 50%;
    border: 2px solid var(--line);
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
}

/* —— Confirm dialog —— */
.confirm-box h3 {
    font-weight: 700;
    color: var(--text);
}

.confirm-btns {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* —— Desktop valve panel —— */
@media (min-width: 900px) {
    .valve-panel {
        background: var(--surface);
        border-left: 1px solid var(--line);
        box-shadow: -8px 0 32px rgba(15, 23, 42, 0.06);
    }

    .desk-sidebar {
        box-shadow: 2px 0 16px rgba(0, 0, 0, 0.12);
    }
}

/* —— Upload progress —— */
.upload-feedback,
.seme-upload-feedback {
    margin-top: 14px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.upload-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.upload-progress-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    min-width: 0;
}

.upload-progress-pct {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.upload-progress-detail {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    word-break: break-word;
}

.upload-progress-track,
.seme-upload-track {
    height: 10px;
    background: var(--line);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.upload-progress-track.indeterminate .upload-progress-bar,
.seme-upload-track.indeterminate .seme-upload-bar {
    width: 40% !important;
    animation: upload-indeterminate 1s ease-in-out infinite;
}

.upload-progress-track.processing .upload-progress-bar,
.seme-upload-track.processing .seme-upload-bar {
    animation: upload-pulse 1.2s ease-in-out infinite;
}

.upload-progress-bar,
.seme-upload-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    border-radius: var(--radius-pill);
    transition: width 0.12s linear;
}

.upload-progress-bar.success,
.upload-progress-track.success .upload-progress-bar,
.seme-upload-bar.success,
.seme-upload-track.success .seme-upload-bar {
    background: linear-gradient(90deg, #22c55e, var(--ok));
    animation: none;
}

@keyframes upload-indeterminate {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

@keyframes upload-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.72; }
}

@media (prefers-reduced-motion: no-preference) {
    .mob-sidebar {
        transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .valve-card,
    .imenik-card,
    .seme-card {
        transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
    }
}
