/* =========================================
   1. GLOBAL & RESET
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #111;           /* Crna za glavne elemente */
    --accent: #2563eb;         /* Premium plava za akcije */
    --accent-hover: #1d4ed8;
    --bg-body: #f3f4f6;        /* Svetlo siva pozadina */
    --bg-card: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --sidebar-width: 260px;
    --header-height: 70px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden; /* Sprečava horizontalni skrol */
}

a { text-decoration: none; }

/* =========================================
   2. LAYOUT & SIDEBAR (Responsive Fix)
========================================= */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar stilovi */
.admin-sidebar {
    width: var(--sidebar-width);
    background: #0f172a; /* Tamna moderna boja */
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: margin-left 0.3s ease-in-out;
    width: calc(100% - var(--sidebar-width));
}

/* Sidebar Logo */
.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Sidebar Linkovi */
.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
}

.sidebar-menu li a i {
    font-size: 20px;
    margin-right: 12px;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    color: white;
    background: rgba(255,255,255,0.05);
    border-right: 3px solid var(--accent);
}

/* Overlay za mobilni */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 900;
    display: none; /* Sakriveno po defaultu */
    opacity: 0;
    transition: opacity 0.3s;
}
.sidebar-overlay.active { display: block; opacity: 1; }

/* =========================================
   3. STATISTICS CARDS
========================================= */
.stats-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stat-box h3 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

.stat-box p {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

/* =========================================
   4. HEADER & ACTIONS
========================================= */
.mobile-header {
    display: none; /* Samo za mobilni */
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.menu-toggle-btn {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
}

.table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.add-btn {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}
.add-btn:hover { background: #333; }

.search-input {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 250px;
    outline: none;
}
.search-input:focus { border-color: var(--primary); }

/* =========================================
   5. TABLE STYLES
========================================= */
.table-container {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden; /* Zaobljene ivice tabele */
    border: 1px solid var(--border);
}

.cars-table {
    width: 100%;
    border-collapse: collapse;
}

.cars-table th {
    background: #f9fafb;
    padding: 15px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

.cars-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.car-thumb {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
}

/* Buttons inside table */
.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

.btn-edit { background: #eff6ff; color: var(--accent); }
.btn-edit:hover { background: #dbeafe; }

.btn-delete { background: #fef2f2; color: #ef4444; margin-left: 5px; }
.btn-delete:hover { background: #fee2e2; }

/* =========================================
   6. MODAL
========================================= */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal-box {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.modal-header h2 { margin: 0; font-size: 20px; }
.modal-close { font-size: 24px; cursor: pointer; color: #999; }

.modal-row { display: flex; gap: 15px; margin-bottom: 15px; }
.field { flex: 1; }
.field label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: #374151; }
.field input, .field select {
    width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border);
}
.saveBtn {
    width: 100%; padding: 12px; background: var(--primary); color: white;
    border: none; border-radius: 8px; font-weight: 600; cursor: pointer; margin-top: 10px;
}

/* =========================================
   7. MOBILE RESPONSIVE MEDIA QUERIES
========================================= */
@media (max-width: 992px) {
    /* Sakrivamo sidebar van ekrana */
    .admin-sidebar { transform: translateX(-100%); }
    /* Kada dodamo klasu .active, sidebar ulazi */
    .admin-sidebar.active { transform: translateX(0); }
    
    .main-content { margin-left: 0; width: 100%; padding: 20px; }
    
    .mobile-header { display: flex; } /* Prikaži hamburger dugme */
    
    /* Tabela scroll */
    .table-container { overflow-x: auto; }
    .cars-table { min-width: 600px; } /* Da se ne lomi tekst */
    
    .modal-row { flex-direction: column; gap: 10px; }
}


/* --- DODATAK ZA REQUESTS STRANICU --- */

/* Status bedževi */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-seen {
    background: #dcfce7;
    color: #166534;
}
.badge-unseen {
    background: #fee2e2;
    color: #991b1b;
}

/* Filteri iznad tabele */
.filters-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    background: white;
    font-family: inherit;
    color: #374151;
}

/* Stil za sadržaj poruke u modalu */
.message-content-box {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-top: 5px;
    white-space: pre-wrap; /* Čuva prorede */
    color: #374151;
    line-height: 1.6;
}