/* ============================================================
   CRM App — Globalni stilovi
   ============================================================ */

:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1e2a3a;
    --sidebar-color: #a8b9cc;
    --sidebar-hover: #ffffff;
    --sidebar-active-bg: rgba(255,255,255,0.1);
    --topbar-height: 52px;
    --primary: #0d6efd;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.9rem;
    background: #f4f6f9;
    margin: 0;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000;
    transition: transform .25s ease;
}

.sidebar-header {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.sidebar-nav {
    flex: 1;
    padding: .75rem 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 1.25rem;
    color: var(--sidebar-color);
    text-decoration: none;
    border-radius: 0;
    transition: background .15s, color .15s;
    font-size: .875rem;
}

.sidebar-nav .nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-hover);
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active-bg);
    color: #fff;
    border-left: 3px solid var(--primary);
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: .5rem 1.25rem;
}

.sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user-name {
    color: #fff;
    font-size: .85rem;
    font-weight: 500;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin .25s ease;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e5e9ef;
    position: sticky;
    top: 0;
    z-index: 900;
}

.page-content {
    padding-top: 1.25rem;
}

/* ── Auth layout ───────────────────────────────────────────── */
.auth-box {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    border: 1px solid #e5e9ef;
    border-radius: .5rem;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e5e9ef;
    font-weight: 600;
    padding: .85rem 1.25rem;
}

/* ── Tabele ─────────────────────────────────────────────────── */
.table th {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    font-weight: 600;
    background: #f8f9fa;
}

/* ── Badge statusi ──────────────────────────────────────────── */
.badge-active    { background: #d1fae5; color: #065f46; }
.badge-inactive  { background: #f3f4f6; color: #374151; }
.badge-prospect  { background: #dbeafe; color: #1e40af; }
.badge-draft     { background: #f3f4f6; color: #374151; }
.badge-sent      { background: #dbeafe; color: #1e40af; }
.badge-paid      { background: #d1fae5; color: #065f46; }
.badge-overdue   { background: #fee2e2; color: #991b1b; }
.badge-cancelled { background: #f3f4f6; color: #6b7280; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}
