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

:root {
    /* PALETA BOJA - RAFINIRANA */
    --primary: #edbb3d;
    --primary-hover: #dfa81c;
    --primary-subtle: #fffbf0; /* Jako svijetla pozadina za aktivna stanja */
    
    --bg-body: #f8fafc;        /* Slate 50 - Hladna svijetla siva */
    --bg-surface: #ffffff;     /* Čista bijela */
    
    --text-main: #0f172a;      /* Slate 900 - Skoro crna, oštra */
    --text-secondary: #64748b; /* Slate 500 - Meka siva */
    
    --border: #e2e8f0;         /* Slate 200 - Vrlo suptilni rubovi */
    
    /* UI VARIJABLE */
    --radius: 12px;            /* Modernije, veće zaobljenje */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --container-width: 1000px; /* FIKSNA ŠIRINA ZA SVE STRANICE */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif; /* Moderniji font od Intera */
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* --- LAYOUT STRUKTURA --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR - Minimalistički */
.sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed; /* Fiksiran lijevo */
    height: 100vh;
    z-index: 50;
    padding: 24px;
}

.sidebar .brand {
    margin-bottom: 40px;
    padding-left: 12px;
}
.sidebar .brand h2 {
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar .brand h2::before {
    content: '';
    display: block;
    width: 12px; height: 12px;
    background: var(--primary);
    border-radius: 50%;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius);
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.sidebar nav a:hover {
    color: var(--text-main);
    background-color: var(--bg-body);
}

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

.sidebar nav a i {
    width: 24px;
    margin-right: 12px;
    font-size: 1.1em;
    display: flex;
    justify-content: center;
}

/* MAIN CONTENT - Centraliziran */
.main-content {
    flex: 1;
    margin-left: 260px; /* Mjesto za sidebar */
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrira kontejner */
}

/* UNIFORM CONTAINER - Ključ za istu širinu */
.content-wrapper {
    width: 100%;
    max-width: var(--container-width);
}

/* --- HEADER SEKCIJE --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1.2;
}
header p {
    color: var(--text-secondary);
    margin-top: 4px;
}

/* --- CARDS (Lebdeće kartice) --- */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-sm); /* Meka sjena umjesto bordera */
    margin-bottom: 30px;
    border: 1px solid transparent; /* Rezerva */
    transition: box-shadow 0.3s ease;
}
.card:hover {
    box-shadow: var(--shadow-md); /* Malo se podigne na hover */
}

/* --- FORMS & INPUTS --- */
/* Osiguravamo da grid uvijek ima 2 stupca jednake širine */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 24px;
    margin-bottom: 20px;
}

/* Klasa koja rasteže element preko oba stupca */
.full-width {
    grid-column: 1 / -1; /* Ovo znači "od prve do zadnje linije" */
}

/* Fix za mobilne uređaje - da se ne raspadne na mobitelu */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr; /* Na mobitelu sve jedna ispod druge */
    }
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

input, select, textarea, .flatpickr-input {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-body); /* Inputi imaju sivu pozadinu */
    border: 1px solid transparent;    /* Nema bordera dok nije fokus */
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(237, 187, 61, 0.15);
}

/* Custom Select Arrow */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

/* --- BUTTONS --- */
.btn-primary {
    background-color: var(--text-main); /* Crni gumb, jako moderno */
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.2s;
}
.btn-primary:hover {
    background-color: #000;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.btn-primary i { color: var(--primary); } /* Zlatna ikona na crnom gumbu */

.btn-small {
    background: transparent;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: 0.2s;
}
.btn-small:hover {
    border-color: var(--text-main);
    background: var(--bg-body);
}

/* --- TABLES --- */
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    text-align: left;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--bg-body);
}
td {
    padding: 16px;
    border-bottom: 1px solid var(--bg-body);
    color: var(--text-main);
    font-size: 0.95rem;
}
tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-rate { background: #fffbeb; color: #b45309; }
.badge-single { background: #f1f5f9; color: #64748b; }

/* --- UTILS --- */
.installments-box {
    background: var(--bg-body);
    padding: 24px;
    border-radius: var(--radius);
    margin-top: 16px;
    display: none;
}

/* --- TOAST --- */
.toast-container { position: fixed; bottom: 40px; right: 40px; z-index: 999; display: flex; flex-direction: column; gap: 12px; }
.toast {
    background: #fff; color: var(--text-main); padding: 16px 20px;
    border-radius: 12px; box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 12px;
    min-width: 320px; border: 1px solid var(--border);
    transform: translateX(150%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.show { transform: translateX(0); }
.toast i { font-size: 1.2rem; }
.toast.success i { color: #10b981; }
.toast.error i { color: #ef4444; }

/* --- LOGIN PAGE --- */
.login-body {
    display: flex; align-items: center; justify-content: center;
    height: 100vh; background-color: var(--bg-body);
}
.login-container {
    width: 100%; max-width: 420px;
    background: #fff; padding: 48px;
    border-radius: 24px; box-shadow: var(--shadow-lg);
}

/* --- ICON BUTTONS --- */
.btn-icon {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-subtle);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}




/* --- PUBLIC BOOKING PAGE STYLES --- */
body.public-layout {
    background-color: #f8fafc;
    display: block; /* Poništava flex od admina */
}

.public-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px;
}

.public-header {
    text-align: center;
    margin-bottom: 40px;
}

.public-header h1 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 10px;
}

.trip-summary {
    background: #fff;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(237, 187, 61, 0.1);
}

.trip-summary h2 { font-size: 1.5rem; color: var(--text-main); margin-bottom: 5px; }
.trip-summary .date { color: var(--text-secondary); font-weight: 500; font-size: 1.1rem; }
.trip-summary .price { font-size: 1.8rem; font-weight: 700; color: var(--primary); margin-top: 10px; }

.price-breakdown {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px dashed var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.total-label { font-weight: 600; color: var(--text-secondary); }
.total-amount { font-size: 1.4rem; font-weight: 700; color: var(--text-main); }