/* ============================================================
   CarShare SK – hlavný stylesheet
   Estetika: industriálna, tmavá, monospace akcenty
   ============================================================ */

:root {
    --bg:        #0d0f12;
    --bg2:       #151820;
    --bg3:       #1c2028;
    --border:    #2a2f3a;
    --border2:   #363d4d;
    --accent:    #4ade80;   /* neon zelená – auto/ekológia */
    --accent2:   #22d3ee;   /* cyan */
    --accent3:   #f59e0b;   /* amber – upozornenia */
    --text:      #e2e8f0;
    --text2:     #94a3b8;
    --text3:     #64748b;
    --danger:    #f87171;
    --success:   #4ade80;
    --radius:    6px;
    --radius-lg: 12px;
    --shadow:    0 4px 24px rgba(0,0,0,.5);
    --font-head: 'Syne', sans-serif;
    --font-mono: 'DM Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── NAVBAR ─────────────────────────────────────────────── */
.navbar {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.brand-icon { font-size: 1.4rem; }

.nav-links {
    display: flex;
    list-style: none;
    gap: .25rem;
    flex: 1;
}

.nav-links a {
    color: var(--text2);
    text-decoration: none;
    padding: .35rem .75rem;
    border-radius: var(--radius);
    font-size: .85rem;
    transition: all .15s;
    border: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
    background: rgba(74,222,128,.08);
    border-color: rgba(74,222,128,.2);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.user-name { color: var(--text2); font-size: .85rem; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.25rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all .15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #0d0f12;
    border-color: var(--accent);
}
.btn-primary:hover { background: #22c55e; border-color: #22c55e; }

.btn-outline {
    background: transparent;
    color: var(--text2);
    border-color: var(--border2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover { background: rgba(248,113,113,.1); }

.btn-sm { padding: .3rem .75rem; font-size: .8rem; }

/* ── MAIN ────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-family: var(--font-head);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.02em;
}

.page-title span {
    color: var(--accent);
}

/* ── CARDS ───────────────────────────────────────────────── */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.card-title {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 1rem;
}

/* ── STATS GRID ──────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: border-color .2s;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent);
}

.stat-card:nth-child(2)::before { background: var(--accent2); }
.stat-card:nth-child(3)::before { background: var(--accent3); }
.stat-card:nth-child(4)::before { background: var(--danger); }

.stat-card:hover { border-color: var(--border2); }

.stat-label {
    font-size: .75rem;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: .4rem;
}

.stat-value {
    font-family: var(--font-head);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.stat-sub {
    font-size: .75rem;
    color: var(--text3);
    margin-top: .3rem;
}

/* ── TABLE ───────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg2);
}

thead th {
    background: var(--bg3);
    color: var(--text3);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: .75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg3); }

tbody td {
    padding: .7rem 1rem;
    color: var(--text);
    font-size: .85rem;
}

.badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .05em;
}

.badge-green  { background: rgba(74,222,128,.15); color: var(--accent); border: 1px solid rgba(74,222,128,.3); }
.badge-blue   { background: rgba(34,211,238,.15); color: var(--accent2); border: 1px solid rgba(34,211,238,.3); }
.badge-amber  { background: rgba(245,158,11,.15); color: var(--accent3); border: 1px solid rgba(245,158,11,.3); }
.badge-red    { background: rgba(248,113,113,.15); color: var(--danger); border: 1px solid rgba(248,113,113,.3); }
.badge-gray   { background: rgba(148,163,184,.1); color: var(--text2); border: 1px solid var(--border2); }

/* ── FILTERS ─────────────────────────────────────────────── */
.filter-bar {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.filter-label {
    font-size: .72rem;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* ── FORMS ───────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: 1rem;
}

label {
    font-size: .8rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .06em;
}

input, select, textarea {
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: .9rem;
    padding: .6rem .9rem;
    outline: none;
    transition: border-color .15s;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(74,222,128,.1);
}

select option { background: var(--bg3); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

/* ── ALERTS ──────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .875rem;
    border: 1px solid;
}

.alert-success { background: rgba(74,222,128,.1); border-color: rgba(74,222,128,.3); color: var(--success); }
.alert-danger  { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.3); color: var(--danger); }
.alert-info    { background: rgba(34,211,238,.1); border-color: rgba(34,211,238,.3); color: var(--accent2); }

/* ── LOGIN PAGE ──────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 30% 40%, rgba(74,222,128,.06) 0%, transparent 60%),
        radial-gradient(ellipse 40% 60% at 80% 70%, rgba(34,211,238,.04) 0%, transparent 60%);
    pointer-events: none;
}

.login-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: var(--shadow);
}

.login-logo {
    font-family: var(--font-head);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    text-align: center;
    margin-bottom: .5rem;
    letter-spacing: -.03em;
}

.login-sub {
    text-align: center;
    color: var(--text3);
    font-size: .8rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: .1em;
}

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text3);
    font-size: 1.3rem;
    cursor: pointer;
    padding: .2rem .5rem;
    border-radius: var(--radius);
    transition: color .15s;
}

.modal-close:hover { color: var(--danger); }

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: .4rem;
    justify-content: center;
    padding: 1rem 0 .5rem;
}

.page-link {
    padding: .35rem .7rem;
    border-radius: var(--radius);
    border: 1px solid var(--border2);
    color: var(--text2);
    text-decoration: none;
    font-size: .82rem;
    transition: all .15s;
}

.page-link:hover, .page-link.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(74,222,128,.08);
}

/* ── FOOTER ──────────────────────────────────────────────── */
.footer {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 1rem 2rem;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text3);
    font-size: .78rem;
}

/* ── UTILITIES ───────────────────────────────────────────── */
.flex { display: flex; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.text-right { text-align: right; }
.text-muted { color: var(--text3); }
.text-accent { color: var(--accent); }
.text-sm { font-size: .8rem; }
.actions { display: flex; gap: .4rem; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .nav-links { display: none; }
    .main-content { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .filter-bar { flex-direction: column; }
}

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card, .stat-card, .table-wrap {
    animation: fadeIn .3s ease both;
}
