html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 1em;
    min-height: 100vh;
}

.container {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    min-height: 100vh;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 32px #0002;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px 4px 16px;
    background: #fff;
    border-bottom: 1.5px solid #e3eaf1;
    min-height: 38px;
}

h1 {
    margin: 0;
    color: #1976d2;
    letter-spacing: 1px;
    font-size: 1.5em;
    text-align: left;
    font-weight: 700;
    flex: 1 1 auto;
}

.week-nav {
    display: flex;
    gap: 4px;
    align-items: center;
    margin: 0;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.week-nav button, .admin-btn {
    background: #1976d2;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 0.95em;
    margin: 0 0 0 7px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px #0001;
    font-weight: 500;
    display: inline-block;
}
.week-nav button:hover, .admin-btn:hover {
    background: #1565c0;
    box-shadow: 0 4px 12px #1976d255;
    color: #fff;
    text-decoration: none;
}
.admin-btn.green { background: #388e3c; }
.admin-btn.green:hover { background: #1b5e20; }
.admin-btn.red { background: #e53935; }
.admin-btn.red:hover { background: #b71c1c; }

.no-data {
    text-align: center;
    color: #888;
    font-size: 1.1em;
    margin-top: 24px;
}

.table-responsive {
    overflow: hidden !important;
    flex: 1 1 auto;
    max-height: 100%;
    height: 100%;
}

.modern-table {
    width: 100%;
    height: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    margin: 0 auto;
    box-shadow: 0 1px 8px #0002;
    min-width: 900px;
    font-size: 0.95em;
    table-layout: fixed;
    word-break: break-word;
    overflow: hidden;
}

.modern-table th, .modern-table td {
    padding: 3px 2px;
    text-align: center;
    border-bottom: 1.5px solid #e3eaf1;
    border-right: 1.5px solid #e3eaf1;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    vertical-align: middle;
    line-height: 1.15;
}

.modern-table th {
    background: linear-gradient(90deg, #1976d2 80%, #42a5f5 100%);
    color: #fff;
    font-size: 1em;
    letter-spacing: 1px;
    border-top: 2.5px solid #1976d2;
    padding-top: 6px;
    padding-bottom: 6px;
}

.modern-table th .date {
    font-size: 0.95em;
    color: #bbdefb;
    font-weight: normal;
}

.modern-table th .shift-time {
    font-size: 0.95em;
    color: #fff9c4;
    font-weight: normal;
}

.modern-table td {
    font-size: 0.92em;
    background: #f8f9fa;
    min-width: 60px;
    padding-top: 3px;
    padding-bottom: 3px;
    line-height: 1.15;
}

.modern-table tr:last-child td {
    border-bottom: none;
}

.machine-name {
    font-weight: bold;
    color: #1976d2;
    text-align: left;
    background: #e3f2fd;
    border-left: 4px solid #1976d2;
    font-size: 1em;
    letter-spacing: 0.5px;
    padding-left: 4px;
}

.employee-name {
    color: #222 !important;
    font-weight: bold;
    background: #eee;
    border-radius: 7px;
    display: block;
    font-size: 0.85em;
    padding: 2px 6px;
    margin-bottom: 1px;
    margin-right: 0;
    line-height: 1.1;
    min-width: 0;
    white-space: normal;
    box-shadow: none;
    transition: background 0.2s;
}

.shift-time {
    font-size: 0.85em;
    color: #666;
    margin-top: 1px;
    line-height: 1.1;
}

/* Farebné pozadie pre rannú a poobednú zmenu pre mená pracovníkov */
.employee-name.ranna-zmena {
    background-color: #e1f5fe !important;
    color: #000 !important;
}
.employee-name.poobedna-zmena {
    background-color: #fff3e0 !important;
    color: #000 !important;
}

.modern-table th, .modern-table td {
    border-left: none;
}
.modern-table th:first-child, .modern-table td:first-child {
    border-left: none;
}
.modern-table th:last-child, .modern-table td:last-child {
    border-right: none;
}

.remove-btn {
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-weight: bold;
    margin-left: 3px;
    cursor: pointer;
    vertical-align: middle;
    font-size: 0.9em;
    line-height: 1;
    padding: 0;
}
.remove-btn:hover { background: #b71c1c; }

/* Responzívne úpravy pre menšie obrazovky */
@media (max-width: 1100px) {
    .container { padding: 4px; }
    .header-row { flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px 6px 2px 6px; }
    h1 { font-size: 1.1em; text-align: left; }
    .week-nav { justify-content: flex-start; margin-top: 4px; }
    .modern-table th, .modern-table td { padding: 3px 1px; font-size: 0.85em; }
    .employee-name { font-size: 0.8em; padding: 2px 4px; }
    .modern-table { min-width: 600px; }
}

@media (max-width: 900px) {
    .modern-table { font-size: 0.85em; }
    .container { padding: 2px; }
    h1 { font-size: 0.9em; }
}

@media (min-width: 1500px) {
    body, .modern-table, .container {
        font-size: 0.85em;
    }
    .modern-table th, .modern-table td {
        padding: 3px 2px;
        font-size: 0.85em;
    }
    .employee-name {
        font-size: 0.8em;
        padding: 2px 4px;
    }
    h1 {
        font-size: 1.1em;
    }
    .week-nav button, .admin-btn {
        font-size: 0.9em;
        padding: 5px 10px;
    }
}

@media (min-width: 2200px) {
    body, .modern-table, .container {
        font-size: 0.7em;
    }
    h1 { font-size: 0.95em; }
}

/* Pekný scrollbar pre TV aj desktop */
::-webkit-scrollbar {
    height: 8px;
    background: #e3eaf1;
}
::-webkit-scrollbar-thumb {
    background: #1976d2;
    border-radius: 8px;
}
#night-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh;
    background: #000;
    opacity: 0.98;
    z-index: 99999;
    display: none;
    pointer-events: all;
}
.night-message {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 2px 12px #000;
    user-select: none;
}
