/* ═══════════════════════════════════════════════════
   Vitorlázunk.hu – Modern Marin Design System
   ═══════════════════════════════════════════════════ */
:root {
    --navy: #0A2463;
    --navy-mid: #163a63;
    --navy-light: #1e4f87;
    --sea: #2980b9;
    --sea-light: #5dade2;
    --gold: #c8a84b;
    --gold-light: #f0d080;
    --white: #ffffff;
    --off-white: #f8f9fb;
    --text-dark: #0d2b4e;
    --text-mid: #4a5568;
    --text-muted: #718096;
    --border: #e2e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 50px;
    --shadow: 0 2px 12px rgba(10,36,99,0.08);
    --shadow-md: 0 4px 24px rgba(10,36,99,0.12);
    --c-free: #27ae60;
    --c-pend: #e67e22;
    --c-book: #c0392b;
    --c-blk: #7f8c8d;
    --c-done: #2980b9;
}

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

html { font-size: 16px; }

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--off-white);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Topnav ──────────────────────────────────────────── */
.topnav {
    background: var(--navy);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(10,36,99,0.3);
}
.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 60px;
}
.nav-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--gold-light);
    text-decoration: none;
    margin-right: 16px;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-logo span { color: rgba(255,255,255,0.8); font-weight: 400; font-size: 15px; }
.nav-links { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.nav-link {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: all 0.18s;
    white-space: nowrap;
    border: 1px solid transparent;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-link.active { color: #fff; background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.25); }
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.role-badge {
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    background: rgba(200,168,75,0.2);
    border: 1px solid rgba(200,168,75,0.4);
    color: var(--gold-light);
    letter-spacing: 0.5px;
}
.nav-user-btn {
    padding: 6px 13px;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.18s;
}
.nav-user-btn:hover { background: rgba(255,255,255,0.2); }

/* ── Main & Footer ───────────────────────────────────── */
.main-content { flex: 1; max-width: 1280px; width: 100%; margin: 0 auto; padding: 28px 20px; }
.site-footer {
    background: var(--navy);
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    margin-top: auto;
}
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 14px 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: var(--radius-pill);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
    border: none;
    white-space: nowrap;
}
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(10,36,99,0.25); }
.btn-primary:hover { background: var(--navy-light); transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--navy); font-weight: 600; }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-dark); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-ghost { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 6px 13px; border-radius: var(--radius-pill); font-size: 13px; cursor: pointer; }
.btn-ghost:hover { background: rgba(255,255,255,0.2); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-block { width: 100%; }
.d-inline { display: inline; }

/* ── Cards ───────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.card-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--navy);
}
.card-navy { background: var(--navy); color: #fff; }
.card-navy .card-title { color: var(--gold-light); }

/* ── Stat Cards ──────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-value { font-family: 'Cormorant Garamond', serif; font-size: 34px; font-weight: 600; color: var(--navy); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-card.gold .stat-value { color: var(--gold); }
.stat-card.red .stat-value { color: #c0392b; }
.stat-card.green .stat-value { color: #27ae60; }

/* ── Grid ────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-gap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }

/* ── Page Header ─────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-title { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 600; color: var(--navy); }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

/* ── Status Badges ───────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 11px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-free { background: rgba(39,174,96,.12); color: #1e8449; border: 1px solid rgba(39,174,96,.3); }
.badge-free::before { background: #27ae60; }
.badge-pend { background: rgba(230,126,34,.12); color: #a04000; border: 1px solid rgba(230,126,34,.3); }
.badge-pend::before { background: #e67e22; }
.badge-book { background: rgba(192,57,43,.1); color: #922b21; border: 1px solid rgba(192,57,43,.25); }
.badge-book::before { background: #c0392b; }
.badge-blk { background: rgba(127,140,141,.1); color: #5d6d7e; border: 1px solid rgba(127,140,141,.25); }
.badge-blk::before { background: #7f8c8d; }
.badge-done { background: rgba(41,128,185,.1); color: #1a5276; border: 1px solid rgba(41,128,185,.25); }
.badge-done::before { background: #2980b9; }
.badge-lezart { background: rgba(94,129,172,.1); color: #34495e; border: 1px solid rgba(94,129,172,.25); }
.badge-lezart::before { background: #5e81ac; }

/* ── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.form-control:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10,36,99,0.1); }
.form-control::placeholder { color: #aaa; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-check { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); }
.form-check:last-child { border-bottom: none; }
.form-check label { font-size: 13px; cursor: pointer; flex: 1; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--navy); cursor: pointer; flex-shrink: 0; }
.text-danger { color: #c0392b; font-size: 12px; margin-top: 4px; display: block; }

/* ── Tables ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; padding: 10px 12px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 12px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: var(--off-white); }
.data-table tr:last-child td { border-bottom: none; }

/* ── Alerts ──────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.alert-success { background: rgba(39,174,96,.1); border: 1px solid rgba(39,174,96,.3); color: #1e8449; }
.alert-danger { background: rgba(192,57,43,.1); border: 1px solid rgba(192,57,43,.25); color: #922b21; }
.alert-warning { background: rgba(230,126,34,.1); border: 1px solid rgba(230,126,34,.3); color: #a04000; }
.alert-info { background: rgba(41,128,185,.1); border: 1px solid rgba(41,128,185,.25); color: #1a5276; }
.alert-close { background: none; border: none; font-size: 18px; cursor: pointer; color: inherit; opacity: 0.6; padding: 0 4px; }
.alert-close:hover { opacity: 1; }

/* ── Calendar ────────────────────────────────────────── */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-month-label { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 600; color: var(--navy); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 6px 0; text-transform: uppercase; }
.cal-day {
    border-radius: var(--radius-sm);
    min-height: 54px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.15s;
    border: 1.5px solid transparent;
    position: relative;
    font-size: 13px;
}
.cal-day:hover:not(.cal-empty) { border-color: var(--navy); }
.cal-day.cal-empty { cursor: default; }
.cal-day .cn { font-size: 14px; font-weight: 500; }
.cal-day .cp { font-size: 9px; margin-top: 2px; }
.cal-day .cd { width: 5px; height: 5px; border-radius: 50%; margin-top: 2px; }
.cal-day.free { background: rgba(39,174,96,.1); border-color: rgba(39,174,96,.2); }
.cal-day.free .cd { background: #27ae60; } .cal-day.free .cp { color: #1e8449; }
.cal-day.pend { background: rgba(230,126,34,.12); border-color: rgba(230,126,34,.25); }
.cal-day.pend .cd { background: #e67e22; }
.cal-day.book { background: rgba(192,57,43,.1); border-color: rgba(192,57,43,.2); }
.cal-day.book .cd { background: #c0392b; }
.cal-day.blk { background: rgba(127,140,141,.1); border-color: rgba(127,140,141,.2); }
.cal-day.blk .cd { background: #7f8c8d; }
.cal-day.today { box-shadow: 0 0 0 2px var(--gold); }
.cal-day.selected { box-shadow: 0 0 0 2px var(--navy); }
.cal-day.wknd .cn { color: var(--navy); font-weight: 600; }
.cal-legend { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.cal-leg-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }
.cal-leg-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── Signature Canvas ────────────────────────────────── */
.sig-canvas {
    width: 100%;
    display: block;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background: #fafafa;
    cursor: crosshair;
    touch-action: none;
}
.sig-canvas.signed { border-style: solid; border-color: var(--navy); }
.sig-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.signer-block { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; background: var(--off-white); }
.signer-label { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 500; margin-bottom: 8px; color: var(--navy); }

/* ── Closure status box ──────────────────────────────── */
.closure-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: #fff; margin-bottom: 20px; }
.closure-title { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.closure-step { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.closure-step:last-child { border-bottom: none; }
.cs-check { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; border: 2px solid; }
.cs-check.done { background: rgba(39,174,96,.15); border-color: #27ae60; color: #1e8449; }
.cs-check.wait { background: #f0f0f0; border-color: #ccc; color: #999; }
.cs-check.req { background: rgba(192,57,43,.12); border-color: #c0392b; color: #922b21; }
.cs-text { flex: 1; font-size: 13px; font-weight: 500; }
.cs-sub { font-size: 11px; color: var(--text-muted); font-weight: 400; }

/* ── Photo upload grid ───────────────────────────────── */
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.photo-slot {
    border: 2px dashed var(--border); border-radius: var(--radius-sm);
    aspect-ratio: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; cursor: pointer;
    transition: all 0.15s; font-size: 24px; color: var(--text-muted);
    background: var(--off-white);
}
.photo-slot:hover { border-color: var(--navy); background: rgba(10,36,99,0.04); }
.photo-slot.filled { border-style: solid; border-color: #27ae60; background: rgba(39,174,96,.06); }
.photo-slot .ps-label { font-size: 10px; margin-top: 4px; color: var(--text-muted); }

/* ── Experience section ──────────────────────────────── */
.exp-cat { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; background: var(--off-white); }
.exp-cat-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; color: var(--navy); }

/* ── Navbar injury badge ─────────────────────────────── */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #c0392b; color: #fff; font-size: 10px; font-weight: 700; margin-left: 4px; vertical-align: middle; }

/* ── Responsiveness ──────────────────────────────────── */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .main-content { padding: 16px 14px; }
    .page-title { font-size: 22px; }
    .nav-links { gap: 0; }
    .nav-link { padding: 5px 10px; font-size: 12px; }
    .photo-grid { grid-template-columns: repeat(3, 1fr); }
    .data-table th, .data-table td { padding: 8px 8px; font-size: 12px; }
}
@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
    .nav-right .role-badge { display: none; }
}
