/* ==========================================================================
   FRESH CORNER THEME - Central CSS
   Barvy a tokeny jsou sdílené se všemi částmi aplikace přes theme.css.
   Společné UI vzorce (tlačítka, karty, tabulky, alerty) přes components.css.
   ========================================================================== */
@import url('theme.css');
@import url('components.css');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--fc-bg);
    color: var(--fc-brown);
    min-height: 100vh;
    padding-bottom: 40px;
}

.container { padding: 20px; max-width: 1400px; margin: 0 auto; }

/* Typografie */
h1, h2, h3, h4 { color: var(--fc-brown); font-weight: 900; }
p { color: var(--fc-brown-light); }

/* Společné rozložení a karty */
.page-header, .welcome, .controls, .card, .stat-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--fc-border);
    transition: all 0.2s;
}
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 15px; }
.page-header h1 { font-size: 24px; display: flex; align-items: center; gap: 10px; }

.card:hover, .news-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

/* Oznámení */
.alert { padding: 14px 20px; border-radius: var(--radius); font-weight: 800; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #E8F5D8; color: #4A6313; border-left: 4px solid var(--fc-green); }
.alert-error { background: #fef2f2; color: #991b1b; border-left: 4px solid var(--danger); }

/* Tlačítka */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: var(--radius);
    font-weight: 800; font-size: 14px;
    border: none; cursor: pointer; text-decoration: none;
    transition: all 0.2s; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-small { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }

.btn-primary { background: var(--fc-green); color: var(--fc-brown); box-shadow: 0 4px 15px rgba(155, 195, 40, 0.3); }
.btn-primary:hover { background: var(--fc-green-hover); box-shadow: 0 6px 20px rgba(155, 195, 40, 0.4); }

.btn-secondary { background: var(--white); color: var(--fc-brown); border: 2px solid var(--fc-border); }
.btn-secondary:hover { background: var(--fc-bg); border-color: rgba(70, 40, 20, 0.2); }

.btn-danger { background: var(--danger); color: var(--white); box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: var(--danger-hover); }

.btn-ghost { background: transparent; color: var(--fc-brown-light); }
.btn-ghost:hover { background: rgba(70, 40, 20, 0.05); color: var(--fc-brown); }

/* Formuláře */
.form-grid { display: grid; gap: 16px; }
label { display: block; margin-bottom: 4px; font-weight: 800; color: var(--fc-brown); font-size: 13px; }
input[type="text"], input[type="date"], input[type="time"], input[type="number"], textarea, select {
    width: 100%; padding: 10px 14px;
    border: 2px solid var(--fc-border); border-radius: var(--radius);
    font-size: 14px; background: var(--white); transition: all 0.2s;
    font-family: inherit; color: var(--fc-brown);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--fc-green); box-shadow: 0 0 0 3px rgba(155, 195, 40, 0.2); }

/* Modální okna */
.modal-backdrop { position: fixed; inset: 0; background: rgba(70, 40, 20, 0.6); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 9999; backdrop-filter: blur(4px); }
.modal-backdrop.open { display: flex; }
.modal { width: 100%; max-width: 650px; background: var(--white); border-radius: var(--radius-lg); box-shadow: 0 20px 50px rgba(70, 40, 20, 0.2); max-height: 90vh; display: flex; flex-direction: column; }
.modal-header { padding: 20px; background: var(--fc-bg); border-bottom: 1px solid var(--fc-border); display: flex; align-items: center; justify-content: space-between; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.modal-title { font-weight: 900; font-size: 18px; color: var(--fc-brown); }
.modal-close { background: none; border: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--fc-brown-light); transition: color 0.2s; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Empty States */
.empty-state { text-align: center; padding: 40px 20px; color: var(--fc-brown-light); }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.8; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }

/* Badges / Štítky */
.badge-branch { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #fff; background: var(--fc-brown); }
.dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.9); }
.vacation-badge { background: var(--fc-green); color: var(--fc-brown); padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; display: inline-flex; align-items: center; gap: 4px; }

/* Média (Mobily) */
@media (max-width: 768px) {
    .container { padding: 12px; }
    .page-header { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; justify-content: center; }
    .modal-actions { flex-direction: column; }
}

/* SPECIFICKÉ - Dashboard */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 30px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; border-bottom: 1px solid var(--fc-border); padding-bottom: 15px; }
.card-title { font-size: 18px; font-weight: 900; display: flex; align-items: center; gap: 10px; }
.card-icon { font-size: 24px; }
.stat-value { font-size: 38px; font-weight: 900; color: var(--fc-green); margin-bottom: 4px; line-height: 1; }
.stat-value.brown { color: var(--fc-brown); }
.stat-value.danger { color: var(--danger); }
.stat-label { color: var(--fc-brown-light); font-size: 14px; font-weight: 700; }
.progress-bar { height: 12px; background: var(--fc-bg); border-radius: 6px; overflow: hidden; margin-top: 12px; }
.progress-fill { height: 100%; background: var(--fc-green); transition: width 0.3s; }
.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.next-shift { background: var(--fc-bg); border: 2px solid rgba(155, 195, 40, 0.3); padding: 16px; border-radius: 12px; margin-top: 16px; }
.next-shift.active { background: var(--fc-green); border-color: var(--fc-green); }
.next-shift-date { font-size: 22px; font-weight: 900; margin-bottom: 4px; color: var(--fc-brown); }

/* SPECIFICKÉ - Moje Směny */
.table-wrap { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--fc-brown); color: var(--white); text-align: left; padding: 14px; font-weight: 900; font-size: 13px; }
tbody tr { transition: background 0.2s; border-bottom: 1px solid var(--fc-border); }
tbody tr:hover { background: var(--fc-bg); }
tbody td { padding: 14px; font-size: 14px; vertical-align: middle; }
.mobile-cards .card { padding: 16px; border-radius: 12px; margin-bottom: 12px; border: 1px solid var(--fc-border); }

/* SPECIFICKÉ - Novinky */
.news-item { background: var(--white); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); border-left: 4px solid var(--fc-green); overflow: hidden; }
.news-title { font-size: 20px; font-weight: 900; margin-bottom: 10px; overflow-wrap: break-word; word-break: break-word; }
.news-meta { display: flex; gap: 10px; font-size: 12px; color: var(--fc-brown-light); margin-bottom: 15px; font-weight: 700; flex-wrap: wrap; }
.news-content { line-height: 1.6; margin-bottom: 15px; overflow-wrap: break-word; word-break: break-word; max-width: 100%; overflow-x: auto; }
.news-content * { box-sizing: border-box !important; max-width: 100% !important; }
.news-content ul, .news-content ol { padding-left: 24px !important; margin-left: 0 !important; margin-bottom: 10px; }
.news-actions { display: flex; gap: 10px; padding-top: 15px; border-top: 1px dashed var(--fc-border); flex-wrap: wrap; }
.action-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--fc-border); background: var(--white); color: var(--fc-brown-light); font-size: 13px; font-weight: 800; cursor: pointer; transition: all .2s; }
.action-btn:hover { background: var(--fc-bg); color: var(--fc-brown); }
.action-btn.liked { background: rgba(155, 195, 40, 0.15); border-color: var(--fc-green); color: #4A6313; }
.comments-section { background: var(--fc-bg); border-radius: 12px; padding: 16px; margin-top: 15px; border: 1px solid var(--fc-border); }
.comment { background: var(--white); border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: 0 2px 5px rgba(70,40,20,0.03); }
.comment-author { font-weight: 800; font-size: 13px; }
.comment-text { font-size: 14px; margin-top: 4px; overflow-wrap: break-word; }

/* ========================================================================
   APP HEADER (MOL DESIGN)
   ======================================================================== */
:root {
    --mol-brown: #462814;
    --mol-green: #9BC328;
}

.app-header {
    background: var(--mol-brown);
    color: white;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-bottom: 3px solid var(--mol-green);
}

@media (min-width: 992px) {
    .app-header {
        position: sticky;
        top: 0;
        z-index: 9998;
        padding: 18px 16px;
    }
}

.app-header .header-content {
    max-width: none !important; 
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    flex-wrap: nowrap !important;
}

@media (min-width: 992px) {
    .app-header .header-content {
        padding: 0 30px;
    }
}

.app-header .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.app-header .header-left h1, .app-header .header-left h2 {
    font-size: 22px;
    margin: 0 0 5px 0;
    font-weight: 900;
    color: white;
}

.app-header .user-info {
    font-size: 13px;
    opacity: 0.9;
}

.app-header .badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    background: var(--mol-green);
    color: var(--mol-brown);
    margin-left: 6px;
}

/* --- Hamburger Menu --- */
.app-header .hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    z-index: 1000;
}
.app-header .hamburger span {
    width: 25px;
    height: 3px;
    background: var(--mol-green);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}
.app-header .hamburger.active span:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
.app-header .hamburger.active span:nth-child(2) { opacity: 0; }
.app-header .hamburger.active span:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }

.close-menu {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: white;
    font-size: 35px;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
}

/* --- Navigace Desktop --- */
.app-header .header-nav {
    display: flex !important;
    gap: 4px;
    align-items: center;
    flex-wrap: nowrap !important;
}

.app-header .nav-group {
    display: flex !important;
    gap: 4px;
    align-items: center;
    padding-right: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}
.app-header .nav-group:last-child {
    border-right: none;
    padding-right: 0;
}

/* --- Tlačítka --- */
.app-header .mbtn {
    padding: 8px 12px !important;
    border: none;
    border-radius: 8px;
    font-size: 12px !important;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    white-space: nowrap;
    box-sizing: border-box;
    color: white !important;
}

.app-header .mbtn-primary {
    background: var(--mol-green) !important;
    color: var(--mol-brown) !important;
}
.app-header .mbtn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.app-header .mbtn-secondary {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}
.app-header .mbtn-secondary:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Aktivní tlačítko svítí MOL zeleně */
.app-header .mbtn-secondary.active {
    background: var(--mol-green) !important;
    color: var(--mol-brown) !important;
    border-color: var(--mol-green) !important;
}

.app-header .mbtn-danger {
    background: #d32f2f !important;
}
.app-header .mbtn-danger:hover {
    background: #e53935 !important;
}

/* --- Navigace Mobil --- */
@media (max-width: 1100px) {
    .app-header .hamburger { display: flex; }
    .app-header .header-top { margin-bottom: 0; }
    
    .app-header .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        bottom: 0;
        width: 300px;
        max-width: 85vw;
        background: var(--mol-brown);
        padding: 70px 15px 30px 15px;
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: -5px 0 20px rgba(0,0,0,0.5);
        flex-direction: column;
        border-left: 3px solid var(--mol-green);
    }
    
    .app-header .header-nav.active { right: 0; }
    .app-header .header-nav.active .close-menu { display: block; }
    
    .app-header .nav-group {
        display: block !important;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 10px 0;
    }
    .app-header .nav-group:last-child { border-bottom: none; }
    
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
    }
    .menu-overlay.active { display: block; }
}