/* Nabava App - Main Stylesheet */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a2332;
    --sidebar-hover: #243044;
    --sidebar-active: #2d6a4f;
    --sidebar-text: #c8d6e5;
    --sidebar-muted: #6b7f99;
    --topbar-height: 56px;
    --primary: #2d6a4f;
    --primary-light: #40916c;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    color: #2c3e50;
    overflow-x: hidden;
}

/* ── Wrapper ─────────────────────────────── */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .4px;
}

.sidebar-brand i { color: #52b788; }

.sidebar-toggle { color: var(--sidebar-text); padding: 0; }

.sidebar-user {
    padding: .9rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    margin-bottom: .5rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .95rem;
    flex-shrink: 0;
}

.user-name { font-size: .875rem; font-weight: 600; color: #e8f0fe; }
.user-role { font-size: .75rem; color: var(--sidebar-muted); }

.sidebar-nav {
    list-style: none;
    padding: 0 .75rem;
    margin: 0;
    flex: 1;
}

.sidebar-nav .nav-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--sidebar-muted);
    padding: 1rem .5rem .35rem;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .5rem .75rem;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .875rem;
    transition: background .15s, color .15s;
    margin-bottom: 2px;
}

.sidebar-nav li a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav li a.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.sidebar-nav li a.btn-sidebar-new {
    background: rgba(45,106,79,.3);
    color: #52b788;
    font-weight: 600;
    margin-top: .25rem;
}

.sidebar-nav li a.btn-sidebar-new:hover {
    background: var(--primary);
    color: #fff;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-footer a {
    color: var(--sidebar-muted);
    text-decoration: none;
    font-size: .875rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    transition: color .15s;
}

.sidebar-footer a:hover { color: #fff; }

/* ── Content ─────────────────────────────── */
#content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Topbar ──────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.topbar-toggle { color: #555; display: none; padding: 0; }
.topbar-title { font-weight: 600; font-size: .95rem; color: #374151; }
.topbar-right { margin-left: auto; }

/* ── Main content ────────────────────────── */
.main-content {
    padding: 1.75rem;
    flex: 1;
}

/* ── Cards ───────────────────────────────── */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
}

/* ── Stat cards ──────────────────────────── */
.stat-card {
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: .85;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: .8rem;
    opacity: .85;
    margin-top: .2rem;
}

.stat-nacrt     { background: linear-gradient(135deg,#6c757d,#868e96); }
.stat-ponuda    { background: linear-gradient(135deg,#f59f00,#fab005); }
.stat-prihvaceno { background: linear-gradient(135deg,#1864ab,#1971c2); }
.stat-isporuceno { background: linear-gradient(135deg,#2b8a3e,#2f9e44); }

/* ── Tables ──────────────────────────────── */
.table { font-size: .875rem; }
.table th { font-weight: 600; color: #4a5568; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background-color: #f8fafc; }

/* ── Badges ──────────────────────────────── */
.badge { font-size: .75rem; font-weight: 600; padding: .35em .65em; }

/* ── Forms ───────────────────────────────── */
.form-label { font-weight: 500; font-size: .875rem; color: #374151; }
.form-control, .form-select { font-size: .875rem; border-color: #d1d5db; }
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(45,106,79,.12);
}

/* ── Buttons ─────────────────────────────── */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
}
.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* ── Status timeline ─────────────────────── */
.status-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    gap: .5rem;
}

.status-step {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: #9ca3af;
}

.status-step.done   { color: #2f9e44; }
.status-step.active { color: #1971c2; font-weight: 700; }

.status-step .step-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
}

.status-step.done .step-dot   { background: #2f9e44; color: #fff; border-color: #2f9e44; }
.status-step.active .step-dot { background: #1971c2; color: #fff; border-color: #1971c2; }

.status-step .step-arrow { color: #d1d5db; margin: 0 .15rem; }

/* ── Quote cards ─────────────────────────── */
.quote-card {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    transition: border-color .15s;
}

.quote-card.selected {
    border-color: #2f9e44;
    background: #f0faf3;
}

.quote-price {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1864ab;
}

/* ── Price chart container ───────────────── */
.chart-container {
    position: relative;
    height: 300px;
}

/* ── Empty state ─────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.empty-state i { font-size: 3rem; margin-bottom: 1rem; display: block; }

/* ── Responsive ──────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    #content {
        margin-left: 0;
    }

    .topbar-toggle { display: block; }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 1029;
    }

    .sidebar-overlay.active { display: block; }
}

@media (max-width: 575.98px) {
    .main-content { padding: 1rem; }
    .stat-card { padding: 1rem; }
    .stat-card .stat-value { font-size: 1.4rem; }
}

/* ── Login page ──────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo i { font-size: 2.5rem; color: var(--primary); }
.login-logo h1 { font-size: 1.5rem; font-weight: 700; margin-top: .5rem; }
.login-logo p { color: #6b7280; font-size: .875rem; }
