:root{
    --bg:#06111f;
    --bg2:#0a1830;
    --panel:#10223d;
    --panel2:#0d1c33;
    --text:#f7fbff;
    --muted:#9fb0c5;
    --line:rgba(255,255,255,.10);
    --blue:#2f8cff;
    --blue2:#67b4ff;
    --green:#34d17a;
    --red:#ff667e;
    --yellow:#f5b942;
    --shadow:0 24px 80px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
    margin:0;
    font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    color:var(--text);
    background:
        radial-gradient(circle at 15% 0%,rgba(47,140,255,.18),transparent 30%),
        linear-gradient(180deg,var(--bg),#071527);
    min-height:100vh;
}
a{color:inherit;text-decoration:none}
button,input,select{font:inherit}
.brand{display:flex;align-items:center;gap:10px;font-size:23px;font-weight:900;letter-spacing:-.6px}
.brand-mark{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(135deg,var(--blue),#245bdc);box-shadow:0 12px 30px rgba(47,140,255,.3)}
.brand b{color:var(--blue2)}
.auth-page{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}
.auth-intro{padding:54px clamp(28px,6vw,90px);display:flex;flex-direction:column;justify-content:space-between;border-right:1px solid var(--line)}
.auth-intro h1{font-size:clamp(42px,6vw,72px);line-height:1.02;letter-spacing:-3px;margin:50px 0 20px}
.auth-intro h1 span{color:var(--blue2)}
.auth-intro p{color:var(--muted);font-size:17px;line-height:1.7;max-width:570px}
.auth-points{display:grid;gap:14px;margin-top:32px}
.auth-points div{display:flex;align-items:center;gap:10px;color:#d6e0ec}
.auth-points i{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:rgba(47,140,255,.15);color:var(--blue2);font-style:normal;font-size:12px}
.auth-form-wrap{display:grid;place-items:center;padding:32px}
.auth-card{width:min(100%,570px);padding:34px;border:1px solid var(--line);background:rgba(14,31,55,.88);backdrop-filter:blur(18px);border-radius:24px;box-shadow:var(--shadow)}
.auth-card h2{font-size:32px;letter-spacing:-1.2px;margin:0 0 8px}
.auth-card>p{margin:0 0 26px;color:var(--muted)}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.field{display:grid;gap:8px;margin-bottom:16px}
.field.full{grid-column:1/-1}
.field label{font-size:13px;color:#d9e3ef;font-weight:700}
.field input,.field select{
    width:100%;height:48px;padding:0 14px;border-radius:12px;
    border:1px solid rgba(255,255,255,.11);background:#08172a;color:white;outline:none;
}
.field input:focus,.field select:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(47,140,255,.13)}
.check{display:flex;gap:10px;align-items:flex-start;color:var(--muted);font-size:13px;line-height:1.45;margin:4px 0 20px}
.check input{margin-top:3px}
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:49px;padding:0 20px;border-radius:12px;border:1px solid transparent;font-weight:800;cursor:pointer}
.btn-primary{width:100%;background:linear-gradient(135deg,var(--blue),#246ee8);color:white;box-shadow:0 12px 30px rgba(47,140,255,.25)}
.btn-secondary{border-color:var(--line);background:rgba(255,255,255,.04)}
.auth-foot{text-align:center;margin-top:20px;color:var(--muted);font-size:14px}
.auth-foot a{color:var(--blue2);font-weight:800}
.alert{padding:13px 15px;border-radius:12px;margin-bottom:18px;font-size:14px;line-height:1.5}
.alert-error{background:rgba(255,102,126,.11);border:1px solid rgba(255,102,126,.3);color:#ffc6d0}
.alert-success{background:rgba(52,209,122,.11);border:1px solid rgba(52,209,122,.3);color:#bdf7d5}
.small-note{color:#7f93aa;font-size:12px;line-height:1.5;margin-top:14px}

/* Dashboard */
.app-shell{min-height:100vh;display:grid;grid-template-columns:260px 1fr}
.sidebar{position:fixed;left:0;top:0;bottom:0;width:260px;background:#081527;border-right:1px solid var(--line);padding:24px 18px;display:flex;flex-direction:column;z-index:20}
.side-nav{display:grid;gap:6px;margin-top:34px}
.side-nav a{padding:12px 14px;border-radius:11px;color:#b7c4d4;font-size:14px;font-weight:700;display:flex;align-items:center;gap:11px}
.side-nav a:hover,.side-nav a.active{background:rgba(47,140,255,.13);color:white}
.side-nav span{width:22px;text-align:center}
.side-bottom{margin-top:auto;display:grid;gap:7px}
.company-chip{padding:13px;border:1px solid var(--line);border-radius:13px;background:rgba(255,255,255,.03);margin-bottom:10px}
.company-chip strong{display:block;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.company-chip small{color:var(--muted)}
.main{grid-column:2;padding:28px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:28px}
.topbar h1{margin:0;font-size:29px;letter-spacing:-1px}
.topbar p{margin:5px 0 0;color:var(--muted);font-size:14px}
.userbox{display:flex;align-items:center;gap:11px}
.avatar{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:linear-gradient(135deg,#1c64d8,#2f8cff);font-weight:900}
.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.metric{padding:20px;border-radius:18px;background:linear-gradient(180deg,rgba(16,34,61,.94),rgba(10,25,46,.94));border:1px solid var(--line)}
.metric small{color:var(--muted)}
.metric strong{display:block;font-size:32px;margin:12px 0 6px}
.metric span{font-size:12px;color:#8ea0b6}
.dashboard-grid{display:grid;grid-template-columns:1.25fr .75fr;gap:16px;margin-top:16px}
.panel{padding:22px;border:1px solid var(--line);border-radius:18px;background:rgba(14,30,53,.84)}
.panel h3{margin:0 0 17px;font-size:17px}
.empty{min-height:240px;display:grid;place-items:center;text-align:center;color:var(--muted);border:1px dashed rgba(255,255,255,.12);border-radius:14px;padding:30px}
.trial{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:14px 16px;margin-bottom:18px;border-radius:14px;border:1px solid rgba(245,185,66,.28);background:rgba(245,185,66,.08)}
.trial strong{color:#ffe09a}
.mobile-menu{display:none}

@media(max-width:900px){
    .auth-page{grid-template-columns:1fr}
    .auth-intro{display:none}
    .auth-form-wrap{padding:18px;min-height:100vh}
    .auth-card{padding:25px 19px;border-radius:20px}
    .form-grid{grid-template-columns:1fr}
    .field.full{grid-column:auto}
    .app-shell{display:block}
    .sidebar{transform:translateX(-100%);transition:.2s ease;box-shadow:var(--shadow)}
    .sidebar.open{transform:translateX(0)}
    .main{padding:18px}
    .mobile-menu{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;border:1px solid var(--line);background:rgba(255,255,255,.04);color:white}
    .topbar{align-items:flex-start}
    .topbar-left{display:flex;gap:12px;align-items:center}
    .userbox .user-text{display:none}
    .cards{grid-template-columns:1fr 1fr}
    .dashboard-grid{grid-template-columns:1fr}
}
@media(max-width:520px){
    .cards{grid-template-columns:1fr}
    .topbar h1{font-size:24px}
    .trial{align-items:flex-start;flex-direction:column}
}


/* Postavke tvrtke */
.settings-layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) 320px;
    gap:16px;
    align-items:start;
}
.settings-main{
    padding:24px;
}
.settings-section-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    margin-bottom:20px;
}
.settings-section-head h3,
.logo-panel h3{
    margin:0 0 7px;
    font-size:19px;
}
.settings-section-head p,
.logo-panel p{
    margin:0;
    color:var(--muted);
    font-size:13px;
    line-height:1.55;
}
.settings-grid{
    margin:0;
}
.settings-divider{
    height:1px;
    background:var(--line);
    margin:10px 0 24px;
}
.settings-actions{
    display:flex;
    justify-content:flex-end;
    padding-top:8px;
}
.settings-save{
    width:auto;
    min-width:180px;
}
.logo-panel{
    padding:22px;
    position:sticky;
    top:20px;
}
.logo-preview{
    min-height:190px;
    margin:20px 0 15px;
    border-radius:16px;
    border:1px dashed rgba(255,255,255,.16);
    background:#08172a;
    display:grid;
    place-items:center;
    overflow:hidden;
    padding:18px;
}
.logo-preview img{
    max-width:100%;
    max-height:180px;
    width:auto;
    height:auto;
    object-fit:contain;
}
.logo-placeholder{
    display:grid;
    place-items:center;
    gap:10px;
    color:#7f93aa;
    text-align:center;
}
.logo-placeholder span{
    font-size:42px;
}
.logo-upload{
    width:100%;
}
@media(max-width:1050px){
    .settings-layout{
        grid-template-columns:1fr;
    }
    .logo-panel{
        position:static;
        order:-1;
    }
    .logo-preview{
        min-height:150px;
    }
}
@media(max-width:600px){
    .settings-main,
    .logo-panel{
        padding:18px;
    }
    .settings-actions{
        display:block;
    }
    .settings-save{
        width:100%;
    }
}
.vehicle-layout{
    margin-top:16px;
}
.vehicle-list-panel{
    overflow:hidden;
}
.vehicle-panel-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:20px 22px;
    border-bottom:1px solid var(--line);
}
.vehicle-panel-head h3{
    margin:0 0 5px;
    font-size:19px;
}
.vehicle-panel-head p{
    margin:0;
    color:var(--muted);
    font-size:13px;
}
.vehicle-add-button{
    width:auto;
}
.vehicle-filters{
    display:flex;
    gap:10px;
    align-items:center;
    padding:14px 18px;
    border-bottom:1px solid var(--line);
    background:rgba(255,255,255,.018);
}
.vehicle-filters input,
.vehicle-filters select{
    height:42px;
    border-radius:11px;
    border:1px solid var(--line);
    background:#08172a;
    color:white;
    padding:0 13px;
    outline:none;
}
.vehicle-filters input{
    flex:1;
    min-width:220px;
}
.vehicle-filters select{
    min-width:150px;
}
.vehicle-filters input:focus,
.vehicle-filters select:focus{
    border-color:var(--blue);
    box-shadow:0 0 0 3px rgba(47,140,255,.13);
}
.vehicle-table-wrap{
    overflow:auto;
}
.vehicle-table{
    width:100%;
    min-width:1500px;
    border-collapse:collapse;
}
.vehicle-table th,
.vehicle-table td{
    padding:13px 14px;
    border-bottom:1px solid rgba(255,255,255,.07);
    text-align:left;
    vertical-align:middle;
    font-size:12px;
}
.vehicle-table th{
    position:sticky;
    top:0;
    z-index:2;
    background:#0e2039;
    color:#90a2b8;
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.06em;
}
.vehicle-table td strong{
    font-size:13px;
}
.vehicle-table tbody tr:hover{
    background:rgba(47,140,255,.035);
}
.vehicle-inactive-row{
    opacity:.56;
}
.status-switch{
    width:42px;
    height:24px;
    border:0;
    border-radius:999px;
    background:#34445a;
    padding:3px;
    cursor:pointer;
    transition:.2s;
}
.status-switch span{
    display:block;
    width:18px;
    height:18px;
    border-radius:50%;
    background:white;
    transition:.2s;
}
.status-switch.is-active{
    background:var(--green);
}
.status-switch.is-active span{
    transform:translateX(18px);
}
.vehicle-group{
    display:inline-flex;
    padding:5px 8px;
    border-radius:999px;
    background:rgba(47,140,255,.12);
    color:#a9d2ff;
    font-weight:800;
    white-space:nowrap;
}
.date-badge{
    display:inline-flex;
    padding:6px 8px;
    border-radius:9px;
    font-weight:800;
    white-space:nowrap;
}
.date-neutral{
    background:rgba(255,255,255,.05);
    color:#acb9c9;
}
.date-good{
    background:rgba(52,209,122,.10);
    color:#bdf7d5;
}
.date-warning{
    background:rgba(245,185,66,.12);
    color:#ffe09a;
}
.date-danger{
    background:rgba(255,102,126,.12);
    color:#ffc0cb;
}
.vehicle-note-cell{
    max-width:210px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.vehicle-actions{
    display:flex;
    gap:7px;
}
.vehicle-actions form{
    margin:0;
}
.vehicle-actions .btn{
    min-height:34px;
    padding:0 10px;
    font-size:11px;
    width:auto;
}
.vehicle-delete{
    background:rgba(255,102,126,.10);
    border-color:rgba(255,102,126,.25);
    color:#ffc0cb;
}
.vehicle-empty{
    min-height:320px;
}
.vehicle-modal{
    position:fixed;
    inset:0;
    z-index:100;
    display:none;
    padding:20px;
    overflow:auto;
}
.vehicle-modal.open{
    display:grid;
    place-items:center;
}
.vehicle-modal-backdrop{
    position:fixed;
    inset:0;
    background:rgba(1,7,15,.78);
    backdrop-filter:blur(8px);
}
.vehicle-modal-card{
    position:relative;
    z-index:2;
    width:min(100%,760px);
    max-height:calc(100vh - 40px);
    overflow:auto;
    border-radius:22px;
    border:1px solid var(--line);
    background:#0c1d34;
    box-shadow:0 30px 100px rgba(0,0,0,.55);
    padding:24px;
}
.vehicle-modal-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    margin-bottom:20px;
}
.vehicle-modal-head h2{
    margin:0 0 6px;
    font-size:27px;
}
.vehicle-modal-head p{
    margin:0;
    color:var(--muted);
}
.vehicle-modal-close{
    width:40px;
    height:40px;
    border-radius:11px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.04);
    color:white;
    font-size:25px;
    cursor:pointer;
}
.vehicle-active-check{
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px 14px;
    border:1px solid var(--line);
    border-radius:12px;
    background:rgba(255,255,255,.025);
    margin-bottom:18px;
    font-weight:800;
}
.vehicle-form-grid textarea{
    width:100%;
    border-radius:12px;
    border:1px solid rgba(255,255,255,.11);
    background:#08172a;
    color:white;
    padding:13px 14px;
    resize:vertical;
    outline:none;
}
.vehicle-form-grid textarea:focus{
    border-color:var(--blue);
    box-shadow:0 0 0 3px rgba(47,140,255,.13);
}
.vehicle-modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    padding-top:6px;
}
.vehicle-modal-actions .btn{
    width:auto;
}
.vehicle-save-button{
    min-width:160px;
}
body.modal-open{
    overflow:hidden;
}
@media(max-width:900px){
    .vehicle-metrics{
        grid-template-columns:1fr 1fr;
    }
    .vehicle-panel-head{
        align-items:flex-start;
    }
    .vehicle-filters{
        flex-wrap:wrap;
    }
    .vehicle-filters input{
        flex-basis:100%;
        min-width:0;
    }
}
@media(max-width:600px){
    .vehicle-metrics{
        grid-template-columns:1fr;
    }
    .vehicle-panel-head{
        flex-direction:column;
    }
    .vehicle-add-button{
        width:100%;
    }
    .vehicle-filters{
        display:grid;
        grid-template-columns:1fr;
    }
    .vehicle-filters input,
    .vehicle-filters select,
    .vehicle-filters .btn{
        width:100%;
        min-width:0;
    }
    .vehicle-modal{
        padding:0;
        display:none;
    }
    .vehicle-modal.open{
        display:block;
    }
    .vehicle-modal-card{
        min-height:100vh;
        max-height:none;
        border-radius:0;
        border:0;
        padding:18px;
    }
    .vehicle-form-grid{
        grid-template-columns:1fr;
    }
    .vehicle-form-grid .full{
        grid-column:auto;
    }
    .vehicle-modal-actions{
        display:grid;
        grid-template-columns:1fr;
    }
    .vehicle-modal-actions .btn{
        width:100%;
    }
}
