/* ============================================================
   KEPU knjiga — stilovi
   ============================================================ */

:root {
    --bg: #111318;
    --bg-deep: #0C0E12;
    --surface: #171A21;
    --surface-2: #1C212B;
    --surface-3: #232936;
    --border: rgba(255, 255, 255, 0.075);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #E8EBF1;
    --muted: #98A1B1;
    --accent: #10B981;
    --accent-2: #34D399;
    --accent-soft: rgba(16, 185, 129, 0.12);
    --danger: #F87171;
    --danger-soft: rgba(248, 113, 113, 0.12);
    --info: #60A5FA;
    --warn: #FBBF24;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-head: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    color-scheme: dark;
}

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

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background:
        radial-gradient(1100px 600px at 10% -10%, rgba(16, 185, 129, 0.09), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(59, 130, 246, 0.06), transparent 55%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

body.modal-open {
    overflow: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    line-height: 1.25;
    margin: 0;
    letter-spacing: -0.015em;
}

p {
    margin: 0;
}

a {
    color: var(--accent-2);
}

code {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 5px;
    padding: 1px 6px;
    font-size: 0.9em;
}

.muted {
    color: var(--muted);
}

.spacer {
    flex: 1;
}

.nowrap {
    white-space: nowrap;
}

.is-hidden {
    display: none !important;
}

.print-only {
    display: none;
}

/* ---------- Forme ---------- */

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.field > span {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    color: var(--muted);
}

.field > span em {
    font-style: normal;
    font-weight: 500;
    color: rgba(152, 161, 177, 0.75);
}

input,
select,
textarea {
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 13px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea {
    resize: vertical;
    min-height: 64px;
    line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
    color: rgba(152, 161, 177, 0.55);
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(16, 185, 129, 0.65);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    background: var(--surface-3);
}

input[type="date"],
input[type="number"] {
    min-height: 44px;
}

.form-row {
    display: grid;
    gap: 16px;
}

.form-row.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-top: 4px;
}

.form-error {
    padding: 10px 13px;
    border-radius: 9px;
    background: var(--danger-soft);
    border: 1px solid rgba(248, 113, 113, 0.32);
    color: #FCA5A5;
    font-size: 0.86rem;
    line-height: 1.45;
}

.hint {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

.inline-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-form .field {
    flex: 0 1 220px;
}

.inline-form .btn {
    margin-bottom: 1px;
}

/* ---------- Dugmad ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.15s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #10B981, #0EA371);
    color: #05130F;
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #14c98c, #10B981);
}

.btn-secondary {
    background: var(--accent-soft);
    border-color: rgba(16, 185, 129, 0.35);
    color: var(--accent-2);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.2);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.035);
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.075);
    border-color: var(--border-strong);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.16);
    border-color: rgba(248, 113, 113, 0.4);
    color: #FCA5A5;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.24);
}

.btn-danger-ghost {
    background: transparent;
    border-color: rgba(248, 113, 113, 0.28);
    color: var(--danger);
}

.btn-danger-ghost:hover:not(:disabled) {
    background: var(--danger-soft);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 13px;
    font-size: 0.84rem;
    border-radius: 9px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
}

/* ---------- Brend ---------- */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #34D399, #10B981 55%, #0B8F63);
    color: #06130F;
    font-family: var(--font-head);
    font-size: 1.25rem;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.28);
}

.brand-mark-lg {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    font-size: 1.6rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-text strong {
    font-family: var(--font-head);
    font-size: 1.02rem;
    letter-spacing: 0.08em;
}

.brand-text small {
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* ---------- Auth ekran ---------- */

.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    position: relative;
}

.auth-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 26px;
    padding: 64px clamp(32px, 6vw, 96px);
    overflow: hidden;
}

.auth-visual::before {
    content: "";
    position: absolute;
    width: 620px;
    height: 620px;
    left: -220px;
    top: -180px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.16), transparent 65%);
    pointer-events: none;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.auth-brand strong {
    display: block;
    font-family: var(--font-head);
    font-size: 1.12rem;
    letter-spacing: 0.04em;
}

.auth-brand span {
    font-size: 0.8rem;
    color: var(--muted);
}

.auth-visual h1 {
    position: relative;
    font-size: clamp(2rem, 3.6vw, 3.1rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-lead {
    position: relative;
    color: var(--muted);
    max-width: 480px;
    font-size: 1rem;
}

.auth-points {
    position: relative;
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
    color: #C6CCD8;
}

.auth-points li::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
    flex-shrink: 0;
}

.auth-card {
    align-self: center;
    justify-self: center;
    width: min(500px, calc(100% - 48px));
    margin: 40px 24px;
    padding: 30px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%), var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 11px;
}

.auth-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 9px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.auth-tab.is-active {
    background: var(--surface-3);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 24px;
}

.auth-form h2 {
    font-size: 1.4rem;
}

.auth-form > .muted {
    margin-top: -8px;
    font-size: 0.9rem;
}

.auth-note {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.5;
    margin-top: 2px;
}

.pw-strength {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: -6px;
}

.pw-strength span {
    height: 4px;
    flex: 1;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s ease;
}

.pw-strength em {
    font-style: normal;
    font-size: 0.72rem;
    color: var(--muted);
    margin-left: 6px;
    min-width: 90px;
    text-align: right;
}

.pw-strength.level-1 span:nth-child(1) {
    background: var(--danger);
}

.pw-strength.level-2 span:nth-child(-n + 2) {
    background: var(--warn);
}

.pw-strength.level-3 span:nth-child(-n + 3) {
    background: #A3E635;
}

.pw-strength.level-4 span {
    background: var(--accent);
}

/* ---------- Topbar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(17, 19, 24, 0.86);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1340px;
    margin: 0 auto;
    padding: 13px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.location-switch {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 6px 5px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.location-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.location-switch select {
    width: auto;
    max-width: 230px;
    border: none;
    background: transparent;
    padding: 6px 8px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 7px;
}

.location-switch select:focus {
    box-shadow: none;
    background: rgba(255, 255, 255, 0.05);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-2);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.user-meta strong {
    font-size: 0.86rem;
    font-weight: 600;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta small {
    font-size: 0.72rem;
    color: var(--muted);
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Kontejner ---------- */

.container {
    max-width: 1340px;
    margin: 0 auto;
    padding: 24px;
}

/* ---------- Toolbar / filteri ---------- */

.toolbar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
}

.filters .field {
    flex: 0 0 150px;
}

.filters .field.grow {
    flex: 1 1 230px;
}

.field-sm > span {
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.field-sm input,
.field-sm select {
    padding: 9px 11px;
    font-size: 0.87rem;
    min-height: 40px;
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

.toolbar-actions .btn-primary {
    margin-right: auto;
}

/* ---------- Summary kartice ---------- */

.summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.summary-card {
    position: relative;
    padding: 20px 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 70%), var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.summary-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.summary-label {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.summary-card strong {
    font-family: var(--font-head);
    font-size: 1.48rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.summary-card-accent {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.14), rgba(16, 185, 129, 0.03)), var(--surface);
    border-color: rgba(16, 185, 129, 0.28);
}

.summary-card-accent::before {
    background: var(--accent);
}

.summary-card-accent strong {
    color: var(--accent-2);
}

/* ---------- Tabela ---------- */

.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px 14px;
}

.table-head h2 {
    font-size: 1.06rem;
}

.table-head .muted {
    font-size: 0.82rem;
}

.table-scroll {
    overflow-x: auto;
}

.kepu-table {
    width: 100%;
    min-width: 880px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.kepu-table th {
    padding: 12px 16px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}

.kepu-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.kepu-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.022);
}

.kepu-table tbody tr:last-child td {
    border-bottom: none;
}

.col-ord {
    width: 64px;
    white-space: nowrap;
}

.col-date {
    width: 108px;
}

.col-doc {
    width: 140px;
}

.col-amount {
    width: 150px;
    text-align: right !important;
    white-space: nowrap;
}

.col-actions {
    width: 142px;
    text-align: right !important;
}

.kepu-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.kepu-table td.strong {
    font-weight: 600;
}

.col-desc {
    min-width: 220px;
}

.desc-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--text);
    word-break: break-word;
}

.desc-notes {
    margin-top: 5px;
    padding-left: 16px;
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
    word-break: break-word;
}

.type-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    transform: translateY(-1px);
}

.type-dot.type-expense {
    background: var(--info);
}

.type-dot.type-adjustment {
    background: var(--warn);
}

.row-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 8px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.row-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
}

.row-btn.danger:hover {
    background: var(--danger-soft);
    color: #FCA5A5;
}

.prev-row td {
    background: rgba(16, 185, 129, 0.07);
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
    font-weight: 600;
    color: var(--accent-2);
}

.total-row td {
    background: var(--surface-2);
    border-top: 2px solid var(--border-strong);
    font-weight: 700;
}

.total-row td:first-child {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.table-message {
    padding: 48px 20px !important;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.table-message .btn {
    margin-top: 14px;
}

/* ---------- Modali ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 7, 10, 0.72);
    backdrop-filter: blur(5px);
}

.modal-card {
    position: relative;
    width: min(570px, 100%);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: modal-in 0.18s ease;
}

.modal-lg {
    width: min(880px, 100%);
}

.modal-sm {
    width: min(450px, 100%);
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 19px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-head h2 {
    font-size: 1.12rem;
}

.modal-body {
    padding: 22px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.entry-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 5px;
}

.modal-actions-padded {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ---------- Podešavanja ---------- */

.settings-tabs {
    display: flex;
    gap: 2px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
}

.tab-btn {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 13px 14px;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.16s ease, border-color 0.16s ease;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.is-active {
    color: var(--accent-2);
    border-bottom-color: var(--accent);
}

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

.panel-head .muted {
    font-size: 0.88rem;
    max-width: 520px;
}

.locations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.location-card {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 15px 17px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.location-card.is-active {
    border-color: rgba(16, 185, 129, 0.38);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.09), transparent 60%), var(--surface-2);
}

.location-main {
    flex: 1 1 200px;
    min-width: 0;
}

.loc-name {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    font-size: 0.94rem;
}

.loc-meta {
    font-size: 0.79rem;
    color: var(--muted);
    margin-top: 3px;
    word-break: break-word;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(16, 185, 129, 0.32);
    color: var(--accent-2);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.loc-balance {
    font-size: 0.82rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.loc-actions {
    display: flex;
    gap: 6px;
}

.lock-status {
    padding: 14px 16px;
    border-radius: 11px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 0.88rem;
    line-height: 1.55;
}

.lock-status strong {
    color: var(--text);
}

.lock-status.is-locked {
    border-color: rgba(248, 113, 113, 0.32);
    background: rgba(248, 113, 113, 0.07);
}

.lock-status.is-locked strong {
    color: #FCA5A5;
}

/* ---------- Uvoz CSV ---------- */

.file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 32px 20px;
    border: 1.5px dashed var(--border-strong);
    border-radius: 14px;
    background: var(--surface-2);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.16s ease, background 0.16s ease;
}

.file-drop:hover {
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(16, 185, 129, 0.05);
}

.file-drop-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.file-drop input[type="file"] {
    display: none;
}

.mapping-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    min-width: 560px;
}

.preview-table th,
.preview-table td {
    padding: 8px 10px;
    border: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-table th {
    background: var(--surface-2);
    color: var(--muted);
    font-weight: 600;
}

.import-report {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-summary {
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.08);
    font-size: 0.92rem;
    line-height: 1.5;
}

.report-summary strong {
    color: var(--accent-2);
}

.report-errors {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-errors h4 {
    font-size: 0.88rem;
    color: #FCA5A5;
}

.report-errors ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.6;
    max-height: 220px;
    overflow-y: auto;
}

/* ---------- Toast ---------- */

.toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(390px, calc(100vw - 40px));
}

.toast {
    padding: 13px 16px;
    border-radius: 11px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.4);
    font-size: 0.88rem;
    line-height: 1.45;
    animation: toast-in 0.2s ease;
}

.toast--error {
    border-left-color: var(--danger);
}

.toast--info {
    border-left-color: var(--info);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Štampa ---------- */

.print-head,
.print-footer {
    display: none;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 11mm 12mm;
    }

    :root {
        color-scheme: light;
    }

    body {
        background: #ffffff !important;
        color: #111111 !important;
        font-size: 9.5pt;
        line-height: 1.4;
    }

    .no-print,
    .topbar,
    .toolbar,
    .summary,
    .toast-container,
    .modal,
    .auth {
        display: none !important;
    }

    .app {
        display: block !important;
    }

    .container {
        max-width: none;
        padding: 0;
        margin: 0;
    }

    .print-head {
        display: block !important;
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 2px solid #111;
    }

    .print-title {
        display: flex;
        align-items: baseline;
        gap: 14px;
        margin-bottom: 8px;
    }

    .print-title h1 {
        font-size: 17pt;
        letter-spacing: 0.04em;
        color: #111;
    }

    .print-sub {
        font-size: 9pt;
        color: #444;
    }

    .print-info {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2px 24px;
        font-size: 9pt;
        color: #222;
        margin-bottom: 6px;
    }

    .print-info strong {
        font-weight: 600;
    }

    .print-totals-line {
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px dashed #999;
        font-size: 9.5pt;
        font-weight: 600;
        color: #111;
    }

    .table-card {
        background: #fff !important;
        border: 1px solid #bbb !important;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    .table-head {
        display: none;
    }

    .table-scroll {
        overflow: visible;
    }

    .kepu-table {
        min-width: 0;
        width: 100%;
        font-size: 8.6pt;
        color: #111 !important;
    }

    .kepu-table th {
        background: #efefef !important;
        color: #111 !important;
        border: 1px solid #999 !important;
        padding: 5px 6px;
        font-size: 7.6pt;
    }

    .kepu-table td {
        border: 1px solid #c9c9c9 !important;
        color: #111 !important;
        padding: 4px 6px;
        background: #fff !important;
    }

    .kepu-table tbody tr {
        page-break-inside: avoid;
    }

    .desc-notes {
        color: #444 !important;
    }

    .type-dot {
        display: none;
    }

    .prev-row td {
        background: #f2f2f2 !important;
        color: #111 !important;
        font-weight: 700;
    }

    .total-row td {
        background: #e9e9e9 !important;
        border-top: 2px solid #111 !important;
        color: #111 !important;
        font-weight: 700;
    }

    .print-footer {
        display: flex !important;
        justify-content: space-between;
        gap: 24px;
        margin-top: 22px;
        padding-top: 10px;
        border-top: 1px solid #999;
        font-size: 8.6pt;
        color: #222;
        page-break-inside: avoid;
    }
}

/* ---------- Responzivno ---------- */

@media (max-width: 1080px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        padding: 48px 32px 8px;
        gap: 18px;
    }

    .auth-visual h1 {
        font-size: clamp(1.8rem, 5vw, 2.6rem);
    }

    .auth-card {
        margin: 24px auto 48px;
    }

    .topbar-inner {
        align-items: flex-start;
    }
}

@media (max-width: 920px) {
    .summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters .field {
        flex: 1 1 150px;
    }

    .filters .field.grow {
        flex-basis: 100%;
    }
}

@media (max-width: 760px) {
    .topbar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 13px 16px;
    }

    .topbar-right {
        justify-content: flex-start;
        gap: 8px;
    }

    .user-chip {
        padding: 0;
    }

    .user-meta small {
        display: none;
    }

    .user-meta strong {
        max-width: 120px;
    }

    .location-switch {
        flex: 1 1 200px;
    }

    .location-switch select {
        max-width: none;
        flex: 1;
    }

    .container {
        padding: 16px;
    }

    .toolbar {
        padding: 15px;
    }

    .toolbar-actions .btn {
        flex: 1 1 auto;
    }

    .toolbar-actions .btn-primary {
        flex-basis: 100%;
        margin-right: 0;
    }

    .modal {
        padding: 10px;
        align-items: flex-end;
    }

    .modal-card {
        max-height: calc(100vh - 20px);
    }

    .modal-head,
    .modal-body,
    .modal-actions-padded {
        padding-left: 18px;
        padding-right: 18px;
    }

    .settings-tabs {
        padding: 0 10px;
    }

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

    .summary {
        gap: 10px;
    }

    .summary-card {
        padding: 16px 17px;
    }

    .summary-card strong {
        font-size: 1.22rem;
    }

    .table-head {
        padding: 15px 16px 11px;
    }

    .location-card {
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .form-row.cols-2 {
        grid-template-columns: 1fr;
    }

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

    .auth-card {
        padding: 22px 18px;
        width: calc(100% - 24px);
        margin: 12px auto 30px;
        border-radius: 18px;
    }

    .auth-visual {
        padding: 32px 20px 4px;
    }

    .auth-points {
        gap: 8px;
    }

    .auth-points li {
        font-size: 0.86rem;
    }

    .toast-container {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
    }
}
