/* ═══════════════════════════════════════════
   RSR Portfolio – Modern Design System v3.0
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    --bg: #F8F8F6;
    --surface: #FFFFFF;
    --surface-alt: #F0F0EE;
    --border: #E5E5E3;
    --border-light: #F0F0EE;
    --text: #0F0F0F;
    --text-muted: #888888;
    --text-light: #AAAAAA;
    --text-placeholder: #CCCCCC;
    --accent: #2563EB;
    --accent-light: #DBEAFE;
    --black: #0F0F0F;
    --success: #22C55E;
    --success-light: #DCFCE7;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --purple: #7C3AED;
    --purple-light: #F3E8FF;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.04);
    --shadow: 0 1px 4px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.03);
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-family: var(--font); font-weight: 700; line-height: 1.2; margin: 0; }
.mono { font-family: var(--mono); }
.label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    display: block;
}

/* ── Forms ── */
.form-input, .form-select, input[type="text"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--black);
    box-shadow: 0 0 0 3px rgba(15,15,15,0.06);
}
textarea { resize: none; line-height: 1.5; }
::placeholder { color: var(--text-placeholder); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--black); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.btn-primary:hover { background: #222; }
.btn-secondary { background: var(--surface-alt); color: var(--text-muted); }
.btn-secondary:hover { background: var(--border); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #1d4ed8; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: #fecaca; }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 6px 14px; }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 12px; font-weight: 500; }
.btn-full { width: 100%; }
.btn-nav { 
    flex: 1; padding: 11px 14px; border-radius: var(--radius); border: none; 
    background: var(--surface); color: #666; font-size: 13px; font-weight: 500; 
    box-shadow: var(--shadow-sm); cursor: pointer; font-family: var(--font);
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-nav:hover { background: var(--surface-alt); }
.btn-nav.danger { background: var(--danger-light); color: var(--danger); }

/* ── Cards & Surfaces ── */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: var(--shadow);
}
.card-flat {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* ── Layout ── */
.container-app {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px;
}
.container-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 40px;
}
.container-admin {
    max-width: 900px;
    margin: 0 auto;
    padding: 28px 40px;
}
.two-col {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}

/* ── Hours Control ── */
.hours-control {
    background: var(--surface-alt);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    align-items: center;
}
.hours-value {
    flex: 1;
    text-align: center;
    padding: 6px 0;
}
.hours-value .big {
    font-size: 40px;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--text);
    letter-spacing: -2px;
    line-height: 1;
}
.hours-value .sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.hours-step {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    border: none;
    background: var(--surface);
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    font-size: 20px;
    transition: background 0.15s;
}
.hours-step:hover { background: var(--border-light); }
.hours-presets {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 10px 0;
}
.hours-preset {
    padding: 5px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--mono);
    transition: all 0.15s;
}
.hours-preset.active, .hours-preset:hover {
    background: var(--black);
    color: #fff;
}

/* ── Flag Chips (CN / Přesčas / Víkend) ── */
.flag-chip {
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 400;
    font-family: var(--font);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.flag-chip .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #ddd; transition: 0.15s; flex-shrink: 0;
}
.flag-chip.active { font-weight: 600; }
.flag-chip.active.purple { border-color: var(--purple); color: var(--purple); background: rgba(124,58,237,.06); }
.flag-chip.active.purple .dot { background: var(--purple); }
.flag-chip.active.orange { border-color: var(--warning); color: var(--warning); background: rgba(245,158,11,.06); }
.flag-chip.active.orange .dot { background: var(--warning); }
.flag-chip.active.red { border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,.06); }
.flag-chip.active.red .dot { background: var(--danger); }

/* ── Stats Row ── */
.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}
.stat-row + .stat-row { border-top: 1px solid var(--border-light); }
.stat-bar {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}
.stat-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}
.stat-bar-fill.green { background: var(--success); }
.stat-bar-fill.orange { background: var(--warning); }
.stat-bar-fill.red { background: var(--danger); }

/* ── Header ── */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
}
.app-header .brand { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 2px; }
.app-header .name { font-size: 28px; font-weight: 700; color: var(--text); cursor: pointer; line-height: 1.1; }
.stat-big {
    text-align: right;
}
.stat-big .num {
    font-size: 32px;
    font-weight: 800;
    font-family: var(--mono);
    letter-spacing: -2px;
    color: var(--text);
    line-height: 1;
}
.stat-big .num.accent { color: var(--accent); }
.stat-big .sub { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ── Notification Toast ── */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    background: var(--black);
    color: #fff;
    padding: 12px 28px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(.4,0,.2,1), opacity 0.4s;
    opacity: 0;
    box-shadow: 0 12px 40px rgba(0,0,0,.15);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--black); }

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 24px;
}
.tab-button {
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    background: transparent;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}
.tab-button.active {
    font-weight: 700;
    color: var(--text);
    border-bottom-color: var(--black);
    background: transparent;
}
.tab-button .badge {
    margin-left: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--border);
    color: var(--text-muted);
}
.tab-button.active .badge {
    background: var(--black);
    color: #fff;
}

/* ── Admin header ── */
.admin-header {
    background: var(--surface);
    border-bottom: 1px solid #eee;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-logo .icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--black); display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 13px; font-family: var(--mono);
}

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-light);
}
tbody td {
    padding: 12px 16px;
    font-size: 14px;
    border-top: 1px solid var(--border-light);
}
tbody tr:hover { background: #FAFAF8; }

/* ── Cards List (admin items) ── */
.item-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}
.item-card .avatar {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--surface-alt);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: var(--text); flex-shrink: 0;
}
.item-card .info { flex: 1; min-width: 0; }
.item-card .info .title { font-size: 15px; font-weight: 600; color: var(--text); }
.item-card .info .meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.item-card .actions { display: flex; gap: 6px; }

/* ── Modal ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
    max-height: 90vh;
    overflow-y: auto;
}

/* ── Login ── */
.login-card {
    max-width: 400px;
    margin: 80px auto;
    padding: 32px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .two-col { grid-template-columns: 1fr; }
    .container-wide { padding: 16px; }
    .container-admin { padding: 16px; }
    .app-header .name { font-size: 20px; }
    .stat-big .num { font-size: 24px; }
    .hours-value .big { font-size: 32px; }
    .card { padding: 18px 16px; }
    .admin-header { padding: 12px 16px; }
    .tabs { overflow-x: auto; }
    .tab-button { padding: 8px 14px; font-size: 13px; }
    .hours-step { width: 44px; height: 44px; }
}
@media (max-width: 480px) {
    .flag-chip { padding: 6px 10px; font-size: 12px; }
    .hours-presets { flex-wrap: wrap; }
}

/* ── Utilities ── */
/* .hidden is provided by Tailwind CDN – no override needed */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.overflow-x-auto { overflow-x: auto; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.font-mono { font-family: var(--mono); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
