/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, 'Open Sans', sans-serif;
}

body {
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Login form */ 
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-form {  
    background: #fff;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 380px;
    border: 1px solid #ddd;
}

.login-form h1 {
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
    text-align: center;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

.input-group .login-input {
    margin-bottom: 0;
    padding-right: 40px;
}

.login-input {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    color: #333;
    transition: all 0.3s ease;
}

.login-input:focus {
    border-color: #4d90fe;
    box-shadow: 0 0 0 3px rgba(77, 144, 254, 0.2);
    outline: none;
}

.login-button {
    width: 100%;
    padding: 15px;
    background: #4d90fe;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(77, 144, 254, 0.3);
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 5px;
    font-size: 18px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.password-toggle:hover {
    opacity: 1;
    color: #333;
}

/* Message styles */
.message {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    color: #333;
}

.message.success {
    background-color: rgba(37, 165, 101, 0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.message.error {
    background-color: rgba(212, 47, 69, 0.2);
    color: #f44336;
    border: 1px solid #f44336;
}

.message.info {
    background-color: rgba(77, 144, 254, 0.2);
    color: #4d90fe;
    border: 1px solid #4d90fe;
}

/* Styl pro zprávy s novými řádky */
.message pre {
    white-space: pre-wrap; /* Zajistí zalamování řádků */
    word-wrap: break-word; /* Zajistí zalamování dlouhých slov */
}

/* Menu styles */
.menu-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    z-index: 1000;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.5rem;
    transition: all 0.3s ease;
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Styl pro selected-machine_plan */
.selected-machine_plan {
    width: 100%;
    padding: 1rem;
    
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
}

/* Zajištění správného odsazení obsahu pod fixed menu */
 

.menu.active {
    display: flex;
    flex-direction: column;
    background: rgba(248, 249, 250, 0.98);
    backdrop-filter: blur(15px);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 8px 8px;
    max-height: 80vh;
    overflow-y: auto;
}

.menu-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    gap: 0.25rem;
}
 
.menu-button {
    min-width: 4rem;
    height: 8px; 
    padding: 0.2rem 0.8rem;
    background: #4d90fe;
    color: white; /* Bílá na modrém je čitelná */
    border: none;
    border-radius: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 600; /* Tučnější text pro lepší čitelnost */
    text-shadow: 0 1px 2px rgba(0,0,0,0.3); /* Stín pro lepší čitelnost */
    -webkit-border-radius: 14px;
    -moz-border-radius: 14px;
    -ms-border-radius: 14px;
    -o-border-radius: 14px;
}

.menu-button:hover {
    background: #3a7bd5;
}

.menu-button.active {
    background: #2a5db5;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.menu-button.btn-admin {
    background-color: #2567a5;
    border-radius: 10px;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    -ms-border-radius: 10px;
    -o-border-radius: 10px;
}

.menu-button.btn-admin:hover {
    background-color: #1c1faf;
    border-radius: 14px;
    -webkit-border-radius: 14px;
    -moz-border-radius: 14px;
    -ms-border-radius: 14px;
    -o-border-radius: 14px;
}
.menu-button.btn-admin:active {
    background-color: #1c1faf;
    border-radius: 5px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    -ms-border-radius: 5px;
    -o-border-radius: 5px;
}
 .zaobliroh {
    border-radius: 15px;
    -webkit-border-radius: 15px;
    -moz-border-radius: 15px;
    -ms-border-radius: 15px;
    -o-border-radius: 15px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.menu-button.logout-button {
    background: #d42f45;
    margin-left: auto !important;
    margin-right: 0;
    font-weight:normal;
}

 .jmeno-button {
    background: #ffffff;
    color:#000000;
   text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.jmeno-button:hover {
    background: #ffffff;
    color:#000000;
    text-decoration: none;
    animation-name: otoc_jmeno;
    animation-duration: 1s;
}
.menu-button.logout-button:hover {
    background: #b82638;
}

@keyframes otoc_jmeno {
    0% { transform: rotate(0deg); 
        -webkit-transform: rotate(0deg); 
         -moz-transform: rotate(0deg); 
          -ms-transform: rotate(0deg); 
           -o-transform: rotate(0deg); }
    10% { transform: rotate(-20deg); 
        -webkit-transform: rotate(-20deg); 
         -moz-transform: rotate(-20deg); 
          -ms-transform: rotate(-20deg); 
           -o-transform: rotate(-20deg); }
    50% { transform: rotate(0deg); 
        -webkit-transform: rotate(0deg);
         -moz-transform: rotate(0deg);
          -ms-transform: rotate(0deg);
           -o-transform: rotate(0deg); }
   25% { transform: rotate(20deg);
         -webkit-transform: rotate(20deg);
          -moz-transform: rotate(20deg); 
          -ms-transform: rotate(20deg);
           -o-transform: rotate(20deg); }
    75% { transform: rotate(20deg); 
        -webkit-transform: rotate(-20deg);
         -moz-transform: rotate(-20deg);
          -ms-transform: rotate(-20deg);
           -o-transform: rotate(-20deg); }
    100% { transform: rotate(0deg); 
        -webkit-transform: rotate(0deg); 
         -moz-transform: rotate(0deg); 
          -ms-transform: rotate(0deg); 
           -o-transform: rotate(0deg); }
  }

.menu-button.tiskstroju {
    background-color: #8B4513; /* Hnědá barva */
}

.menu-button.tiskstroju:hover {
    background-color: #A0522D; /* Světlejší hnědá barva při najetí myší */
}

/* Hamburger menu */
.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 15px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: transform 0.3s ease;
}

/* Správa strojů */
.machine-container {
    max-width: 800px;
    margin: 80px auto 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    background: #4d90fe;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-button:hover {
    background: #3a7bd5;
}

.tab-button.active {
    background: #2a5db5;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tab-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
}

.tab-content.hidden {
    display: none;
}

.machine-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.machine-input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
}

.machine-button, .add-field-button {
    padding: 10px;
    background: #4d90fe;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.machine-button:hover, .add-field-button:hover {
    background: #3a7bd5;
}

.add-field-button {
    background: #25a565;
}

.add-field-button:hover {
    background: #1f8a54;
}

.field-group {
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.field-group .form-input {
    flex: 1;
}

.field-group .btn-delete {
    padding: 10px;
    background: #d42f45;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.field-group .btn-delete:hover {
    background: #b82638;
}

/* Checkbox skupiny */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #333;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4d90fe;
}

/* Formuláře a tlačítka */
.form-row {
    margin-bottom: 15px;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #666;
}

.form-input, .fixed-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    color: #333;
    transition: all 0.3s ease;
}

.form-input:focus, .fixed-textarea:focus {
    border-color: #4d90fe;
    box-shadow: 0 0 0 3px rgba(77, 144, 254, 0.2);
    outline: none;
    background-color: #f9f9f9;
}

.fixed-textarea {
    resize: vertical;
    min-height: 80px;
    background-color: #fff;
    color: #333;
}

.table-textarea {
    width: 100%;
    min-height: 50px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    background-color: #fff;
    color: #333;
}

.table-textarea:focus {
    border-color: #4d90fe;
    box-shadow: 0 0 0 2px rgba(77, 144, 254, 0.2);
    outline: none;
    background-color: #f9f9f9;
}

/* Tlačítka */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-edit {
    background: #4d90fe;
    color: white;
}

.btn-edit:hover {
    background: #3a7bd5;
}

.btn-delete {
    background: #d42f45;
    color: white;
}

.btn-delete:hover {
    background: #b82638;
}

.btn-back {
    background: #555;
    color: white;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 20px;
}

.btn-back:hover {
    background: #444;
}

.btn-group {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-success {
    background-color: #25a565;
    color: white;
}
.btn-warning {
    background-color: #ff9800;
    color: white;
}
.btn-warning:hover {
    background-color: #af6b05;
    color: white;
}
.btn-success:hover {
    background-color: #1f8a54;
}

.btn-primary {
    background-color: #4d90fe;
    color: white;
}

.btn-primary:hover {
    background-color: #3a7bd5;
}

.btn-danger {
    background-color: #d42f45;
    color: white;
}

.btn-danger:hover {
    background-color: #b82638;
}

/* Nový styl pro tlačítko Přeskočit */
.btn-skip {
    background-color: #8B4513; /* Hnědá barva */
    color: white;
}

.btn-skip:hover {
    background-color: #A0522D; /* Světlejší hnědá barva při najetí myší */
}

/* Admin container */
.admin-container {
    margin-top: 80px;
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
}

/* HLAVNÍ TABULKY - TMAVÝ REŽIM */
.data-table {
    width: 100%; /* Ensure the table spans the full width */
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed; /* Force fixed column widths */
    background-color: #fff;
    color: #333;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    font-size: 10px;
}
 
/* Záhlaví tabulky */
.data-table thead {
    background-color: #f1f1f1;
    position: sticky;
    top: 0;
    z-index: 10; 
     font-size: 10px;
} 

.data-table th {
    background-color: #f1f1f1;
    padding: 16px;
    text-align: left;
    font-weight: 500;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #ddd;
     font-size: 10px;
}

/* Řádky a buňky */
.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #2c2828;
    transition: background-color 0.2s;
     font-size: 10px;
}

.data-table tbody tr:hover:not(.add-record-row) {
    background-color: #f9f9f9;
     font-size: 10px;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
     font-size: 10px;
}

/* Zmenšení rozestupů mezi řádky v tabulkách */
.data-table tbody tr {
    line-height: 1; /* Ještě menší výška řádků */
    padding: 0; /* Odstranění vnitřního odsazení */
}
 
.data-table td, 
.data-table th {
    padding: 1px; /* Ještě menší vnější odsazení buněk */
    font-size: 10px; /* Zmenšení velikosti písma */
}

/* SPECIFICKÉ ŠÍŘKY PRO SLOUPCE ZAKÁZKA A SAP */
.data-table .column-zakazka {
    width: 65px !important;
    min-width: 65px !important;
    max-width: 65px !important;
    padding: 2px 4px !important;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
}

.data-table .column-sap {
    width: 85px !important;
    min-width: 85px !important;
    max-width: 85px !important;
    padding: 2px 4px !important;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 65px !important;
    min-width: 65px !important;
    max-width: 65px !important;
    padding: 2px 4px !important;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    width: 85px !important;
    min-width: 85px !important;
    max-width: 85px !important;
    padding: 2px 4px !important;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
}

/* Vstupní prvky v tmavém režimu */
.data-table input,
.data-table textarea,
.data-table select {
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    width: 100%;
    transition: all 0.3s ease;
       font-size: 10px; /* Zmenšení velikosti písma */
}

/* SPECIFICKÉ ŠÍŘKY PRO SLOUPCE - POUŽÍVÁ CSS TŘÍDY MÍSTO nth-child */
.data-table .column-zakazka input,
.data-table .column-zakazka .cell-input {
    width: 57px !important;
    max-width: 57px !important;
    min-width: 57px !important;
    box-sizing: border-box !important;
}

.data-table .column-sap input,
.data-table .column-sap .cell-input {
    width: 77px !important;
    max-width: 77px !important;
    min-width: 77px !important;
    box-sizing: border-box !important;
}

/* SPECIFICKÉ ŠÍŘKY PRO SLOUPCE - PŘEPÍŠE width: 100% */
.data-table td:nth-child(2) input {
    width: 57px !important;
    max-width: 57px !important;
    min-width: 57px !important;
}

.data-table td:nth-child(3) input {
    width: 77px !important;
    max-width: 77px !important;
    min-width: 77px !important;
}

/* PŘIDÁNO: Specificky pro cell-input třídu */
.data-table td:nth-child(2) .cell-input {
    width: 57px !important;
    max-width: 57px !important;
    min-width: 57px !important;
    box-sizing: border-box !important;
}

.data-table td:nth-child(3) .cell-input {
    width: 77px !important;
    max-width: 77px !important;
    min-width: 77px !important;
    box-sizing: border-box !important;
}

.data-table input:focus,
.data-table textarea:focus,
.data-table select:focus {
    border-color: #4d90fe;
    box-shadow: 0 0 0 2px rgba(77, 144, 254, 0.3);
    outline: none;
    background-color: #f9f9f9;
}

/* Speciální styly pro editovatelné buňky */
.data-table .editable .cell-input {
    background-color: transparent;
    border-color: transparent;
}

.data-table .editable:hover {
    background-color: #f1f1f1 !important;
    box-shadow: inset 0 0 0 1px #4d90fe;
}

.data-table .editable .cell-input:hover,
.data-table .editable .cell-input:focus {
    background-color: #fff;
    border-color: #4d90fe;
}

/* Styl pro řádek přidávání záznamu */
.data-table .add-record-row {
    background-color: #f9f9f9 !important;
    border-top: 2px solid #ddd;
}

.data-table .add-record-row td {
    padding: 15px;
    background-color: #f9f9f9 !important;
}

.data-table .add-record-row input,
.data-table .add-record-row textarea,
.data-table .add-record-row select {
    background-color: #fff;
}

/* Styly pro ID buňku a tlačítko V */
.data-table .id-cell {
    display: flex;
    align-items: center;
    gap: 1px;
    width: 30px;
    min-width: 30px;
    max-width: 30px;
}

.btn-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #d42f45;
    color: white;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-circle:hover {
    background-color: #b82638;
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.btn-circle.active,
.btn-circle.has-value {
    background-color: #25a565;
}

/* Akční tlačítka */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.action-btn.active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(1px);
}

/* Skrytí tlačítek Hotovo a Jedeme, mimo tlačítka Pokračovat v řádcích se stavem stop */
.action-buttons .btn-success,
.action-buttons .btn-primary:not(.row-stop .action-buttons .btn-primary) {
    display: none;
}

/* Zajištění, aby tlačítko Stop bylo vždy viditelné a zarovnané */
.action-buttons .btn-danger {
    display: block;
    width: 100%;
}
 
 

/* Speciální výjimka pro tlačítko Pokračovat v řádcích se stavem stop */
.row-stop .action-buttons .btn-primary {
    display: block;
    width: 100%;
}

/* Styly pro pole doplneni */
.doplneni-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.doplneni-container select {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    transition: all 0.2s;
}

.doplneni-container select:hover, 
.doplneni-container select:focus {
    border-color: #4d90fe;
    outline: none;
    background-color: #f9f9f9;
}

/* Styly pro vychystano modal */
.vychystano-control {
    position: relative;
    width: auto;
}

.vychystano-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 99999 !important;
    background-color: #fff !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    border-radius: 8px !important;
    padding: 20px !important;
    display: none !important;
    flex-direction: column !important;
    gap: 15px !important;
    width: 300px !important;
    min-width: 300px !important;
    box-sizing: border-box !important;
    border: 1px solid #ddd !important;
}

.vychystano-modal.visible {
    display: flex !important; /* Zobrazí se pouze když má třídu visible */
}

.current-vychystano {
    font-size: 16px !important;
    color: #333 !important;
    margin-bottom: 10px !important;
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
    font-weight: 500 !important;
    border-bottom: 1px solid #eee !important;
    padding-bottom: 10px !important;
}

.current-value {
    font-weight: bold !important;
    color: #333 !important; /* Změněno z #e0e0e0 na světlejší #e9e9e9 */
}

.vychystano-input {
    width: 100% !important;
    padding: 12px !important;
    border: 2px solid #ddd !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    background-color: #fff !important;
    color: #333 !important;
    font-size: 16px !important;
    margin: 10px 0 !important;
}

.vychystano-save {
    padding: 12px !important;
    background-color: #25a565 !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    width: 100% !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

.vychystano-save:hover {
    background-color: #2dbd74 !important; /* Světlejší zelená při najetí myší */
}

/* Akcenty pro buňky */
.accent-success {
    color: #4caf50;
}

.accent-warning {
    color: #ff9800;
}

.accent-danger {
    color: #f44336;
}

/* Styly pro zobrazení rozdílu množství */
.quantity-display {
    margin-top: 5px;
    font-size: 13px;
    color: #4d90fe;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
    background-color: rgba(77, 144, 254, 0.1);
    display: inline-block;
}

/* Když je rozdíl menší než 0, zobrazíme to červeně */
.quantity-display.negative {
    color: #ffffff; /* Změněno na bílou barvu pro lepší kontrast */
    background-color: #d42f45; /* Odstraněna průhlednost (neprůhledná červená) */
    font-weight: 700; /* Silnější text pro lepší čitelnost */
}

/* Zvýraznění, když je rozdíl 0 (vše vychystáno) */
.quantity-display.complete {
    color: #ffffff; /* Změněno na bílou barvu pro lepší kontrast */
    background-color: #2dbd74; /* Odstraněna průhlednost (neprůhledná zelená) */
    font-weight: 700; /* Silnější text pro lepší čitelnost */
}

/* Notifikace o uložení */
.save-notification {
    position: fixed;
    bottom: 20px; /* Zobrazení vpravo dole */
    right: 20px;
    padding: 10px 20px;
    border-radius: 4px;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 2000;
    font-weight: 500;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.save-notification.success {
    background-color: #25a565;
}

.save-notification.error {
    background-color: #d42f45;
}

.save-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Styly pro obarvení řádků podle akce */
.data-table .row-hotovo {
    background-color: rgba(37, 165, 101, 0.15) !important; /* Zelená pro Hotovo (dříve Start) */
}

.data-table .row-jedeme {
    background-color: rgba(77, 144, 254, 0.15) !important; /* Modrá pro Jedeme */
}

.data-table .row-stop {
    background-color: rgba(212, 47, 69, 0.15) !important; /* Červená pro Stop */
}

.data-table .row-preskocit {
    background-color: rgba(139, 69, 19, 0.15) !important; /* Hnědá pro Přeskočit */
    opacity: 0.7;
}

/* Styl pro řádky označené jako "nedokonceno" */
.data-table .row-nedokonceno {
    background-color: rgba(255, 165, 0, 0.2); /* Světle oranžová barva */
}

.data-table .row-nedokonceno td {
    border-bottom-color: rgba(255, 165, 0, 0.3); /* Odpovídající barva pro spodní okraj */
}

/* Zajištění čitelnosti textu i po obarvení řádku */
.data-table .row-hotovo td,
.data-table .row-jedeme td,
.data-table .row-stop td,
.data-table .row-preskocit td {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Hover efekt s vyšší intenzitou pozadí */
.data-table .row-hotovo:hover {
    background-color: rgba(37, 165, 101, 0.25) !important;
}

.data-table .row-jedeme:hover {
    background-color: rgba(77, 144, 254, 0.25) !important;
}

.data-table .row-stop:hover {
    background-color: rgba(212, 47, 69, 0.25) !important;
}

.data-table .row-preskocit:hover {
    background-color: rgba(139, 69, 19, 0.25) !important;
}

/* Styly pro řádky označené jako "preskocit" - read-only podobně jako u hotovo */
.data-table .row-preskocit .editable input,
.data-table .row-preskocit .editable textarea,
.data-table .row-preskocit .editable select,
.data-table .row-preskocit .doplneni-container select {
    pointer-events: none;
    opacity: 0.8;
    background-color: #f1f1f1 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    cursor: not-allowed;
}

.data-table .row-preskocit .editable:hover {
    background-color: inherit !important; 
    box-shadow: none !important;
    cursor: not-allowed;
}

.data-table .row-preskocit .btn-circle {
    pointer-events: none;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Styly pro deaktivovaná tlačítka */
.action-btn:disabled,
.action-btn.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Styly pro řádky označené jako "Hotovo" - read-only */
.data-table .row-hotovo .editable input,
.data-table .row-hotovo .editable textarea,
.data-table .row-hotovo .editable select,
.data-table .row-hotovo .doplneni-container select {
    pointer-events: none;
    opacity: 0.8;
    background-color: #f1f1f1 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    cursor: not-allowed;
}

.data-table .row-hotovo .editable:hover {
    background-color: inherit !important; 
    box-shadow: none !important;
    cursor: not-allowed;
}

.data-table .row-hotovo .btn-circle {
    pointer-events: none;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Styl pro readonly řádky */
.data-table tr[data-readonly="true"] {
    background-color: rgba(200, 200, 200, 0.2); /* Světle šedé pozadí */
    pointer-events: none; /* Zakáže interakci s prvky */
    opacity: 0.7; /* Snížená průhlednost */
}

.data-table tr[data-readonly="true"] .readonly-cell {
    color: #999; /* Šedý text */
    cursor: not-allowed; /* Změna kurzoru na "zakázáno" */
}

.data-table tr[data-readonly="true"] .action-buttons {
    display: none; /* Skryje akční tlačítka */
}

/* Indikátor načítání */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 5px solid transparent;
    border-top-color: #4d90fe;
    border-bottom-color: #4d90fe;
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* RESPONZIVNÍ STYLY */
@media (max-width: 768px) {
    /* Menu pro mobily */
    .hamburger {
        display: block;
        z-index: 1001;
       
    }

    .menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        padding: 1rem;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        border-top: 1px solid #ddd;
        overflow: auto;
        max-height: 80vh; /* Maximální výška menu nastavena na 80 % výšky obrazovky */
        overflow-y: auto; /* Povolení vertikálního posouvání */
        -webkit-overflow-scrolling: touch; /* Plynulé posouvání na mobilních zařízeních */
    }

    .menu.active {
        display: flex;
        flex-direction: column;
    }

    .menu-button {
        width: 100%;
        margin: 0.05rem 0;
    }

    .menu-button.logout-button {
        margin-left: 0 !important;
        margin: 0.25rem 0;
    }
  
    /* Admin container na mobily */
    .admin-container {
        margin-top: 60px;
        padding: 10px;
    }

    /* Formuláře na mobily */
    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    .form-row label {
        flex: none;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-button {
        width: 100%;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
  
    /* Tabulka na mobily */
    .data-table {
        border-radius: 0;
        box-shadow: none;
        border: 1px solid #ddd;
    }
  
    .data-table thead {
        display: none;
    }
  
    .data-table tbody tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background-color: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
  
    .data-table td {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        border-bottom: 1px solid #ddd;
    }
  
    .data-table td:last-child {
        border-bottom: none;
    }
  
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #aaa;
        flex: 0 0 45%;
        text-align: right;
        padding-left: 16px;
        order: 2;
    }
  
    .data-table input,
    .data-table textarea,
    .data-table select,
    .data-table .cell-input,
    .data-table .doplneni-container {
        flex: 0 0 55%;
        order: 1;
        margin: 0;
    }
  
    .data-table .id-cell {
        flex-direction: row;
        justify-content: flex-start;
        width: 55%;
        order: 1;
        max-width: 3px;
    }
  
    .data-table .action-buttons {
        flex-direction: column;
        width: 100%;
        order: 1;
        gap: 8px;
    }
  
    .action-btn {
        width: 100%;
        justify-content: center;
    }
  
    .add-record-row {
        margin-top: 16px;
        margin-bottom: 0 !important;
    }
  
    .add-record-row td {
        padding: 12px;
    }
}

/* Admin table specifické styly */
.admin-table {
    background-color: #fff;
    color: #333;
}

.admin-table th {
    background-color: #f1f1f1;
    color: #333;
}

.admin-table td {
    border-bottom: 1px solid #ddd;
}

.admin-table tr:nth-child(even) td {
    background-color: #f9f9f9;
}

.admin-form {
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-form h2 {
    color: #333;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* Obecné tmavé styly pro další elementy */
h1, h2, h3, h4, h5, h6 {
    color: #333;
}

a {
    color: #4d90fe;
    text-decoration: none;
}

a:hover {
    color: #3a7bd5;
    text-decoration: underline;
}

hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 20px 0;
}

code, pre {
    background-color: #f1f1f1;
    color: #333;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
}

em {
    color: #666;
    font-style: italic;
}

/* Styly pro upozornění na blížící se časy - sjednocená definice */
.alerts-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 450px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 150px; /* Přidána minimální výška */
    max-height: 450px; /* Maximální výška */
    overflow-y: auto; /* Povolení vertikálního posouvání */
    padding: 1px; /* Vnitřní odsazení */
    background-color: #f9f9f9; /* Světlé pozadí */
    border: 1px solid #ccc; /* Rámeček */
    border-radius: 4px; /* Zaoblené rohy */
}

.time-alert {
    background-color: #fff;
    color: #333;
    border-left: 4px solid #4d90fe;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideIn 0.3s ease;
    min-width: 280px;
    max-width: 400px;
    z-index: 99999;
    width: 66.67%; /* Nastavení šířky na dvě třetiny obrazovky */
    font-size: 0.9rem; /* Zmenšení písma */
    margin: 0 auto; /* Vycentrování okna */
    width: 50%; /* Zmenšení šířky na 50 % */
    font-size: 0.8rem; /* Další zmenšení písma */
    max-width: 300px; /* Maximální šířka */
    margin: 0 auto; /* Vycentrování okna */
}

.time-alert.urgent {
    border-left: 4px solid #d42f45;
    background-color: #fff !important; /* Neprůhledné pozadí s !important */
}

.time-alert h4 {
    margin: 0;
    display: flex;
    justify-content: space-between;
}

.time-alert p {
    margin: 5px 0;
}

.time-alert-header {
    font-size: 0.75rem; /* Zmenšení písma v záhlaví */
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.time-alert-body {
    font-size: 0.7rem; /* Zmenšení písma v těle upozornění */
}

.time-alert-actions {
    font-size: 0.7rem; /* Zmenšení písma v tlačítkách */
}

.time-alert-header {
    font-size: 0.95rem; /* Zmenšení písma v záhlaví */
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.time-alert-body {
    font-size: 0.85rem; /* Zmenšení písma v těle upozornění */
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.time-alert-actions {
    font-size: 0.85rem; /* Zmenšení písma v tlačítkách */
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.time-alert-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    align-items: center;
}

.time-alert-label {
    color: #666;
    font-weight: 500;
}

.time-alert-value {
    color: #333;
    font-weight: 600;
}

.time-alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.time-alert-close {
    cursor: pointer;
    padding: 2px 8px;
    border: none;
    background: #ddd;
    color: #333;
    border-radius: 3px;
    font-size: 12px;
    transition: background 0.2s;
}

.time-alert-close:hover {
    background: #ccc;
}

.time-alert-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.time-alert-button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    background-color: #ddd;
    color: #333;
}

.time-alert-button:hover {
    background-color: #ccc;
}

.time-alert-confirm {
    background-color: #4d90fe;
    color: white;
}

.time-alert-confirm:hover {
    background-color: #3a7bd5;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.time-alert.removing {
    animation: slideOut 0.3s ease forwards;
}

/* Styly pro zobrazení informace o zastavení */
.stop-info {
    margin-bottom: 8px;
    font-size: 12px;
    color: #d42f45;
    font-weight: bold;
    text-align: center;
}

.stop-time {
    display: block;
    padding: 2px 4px;
    background-color: rgba(212, 47, 69, 0.1);
    border-radius: 3px;
}

/* Styl pro tabulky s pevnou šířkou buněk a bez orámování */
.fixed-size-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

.fixed-size-table th,
.fixed-size-table td {
    padding: 10px;
    text-align: left;
    border: none; /* Zrušení orámování */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fixed-size-table th[data-label="Auftrag"],
.fixed-size-table td[data-label="Auftrag"] {
    width: 9rem;
}

.fixed-size-table th[data-label="SAP"],
.fixed-size-table td[data-label="SAP"] {
    width: 10rem;
}

.fixed-size-table th[data-label="Materiál"],
.fixed-size-table td[data-label="Materiál"] {
    width: 15rem;
}

.fixed-size-table th[data-label="Množství"],
.fixed-size-table td[data-label="Množství"] {
    width: 6rem;
}

.fixed-size-table th[data-label="Na kolik"],
.fixed-size-table td[data-label="Na kolik"] {
    width: auto; /* Automatická šířka podle obsahu data a času */
}

.fixed-size-table th[data-label="Vychystáno"],
.fixed-size-table td[data-label="Vychystáno"] {
    width: 4rem;
}

/* Zmenšení rozestupů mezi řádky a buňkami v tabulkách s třídou fixed-size-table */
.fixed-size-table tbody tr {
    line-height: 1; /* Menší výška řádků */
    padding: 0; /* Odstranění vnitřního odsazení */
}

.fixed-size-table td, 
.fixed-size-table th {
    padding: 4px; /* Menší vnější odsazení buněk */
    font-size: 12px; /* Zmenšení velikosti písma */
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal h2 {
    margin-bottom: 15px;
    font-size: 20px;
    color: #333;
}

.modal p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #666;
}

.modal-actions {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.modal-actions .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

    .modal-actions .btn-primary {
        background: #fe4d65;
        color: white;
    }

.reset-cas-vyroba {
    background: #b8018a;
    color: white;
}
.modal-actions .btn-primary:hover {
    background: #3a7bd5;
}



.modal-actions .btn-secondary {
    background: #ddd;
    color: #333;
}

.modal-actions .btn-secondary:hover {
    background: #ccc;
}

.form-inline {
    display: inline-flex;
    justify-content: space-between;      
    padding: 10px;
    border-radius: 4px; 
    margin-bottom: 20px;
    width: 50%;
    max-width: 600px;
    margin: 0 auto;
    gap: 10px;
     align-items: center;
    flex-direction:  row;    
}
.form-inline button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    background: #e7f8f1;
    color: #333;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 1;
    min-width: 100px;
    max-width: 200px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.9rem;
    
 
}
.form-inline button:hover {
    background: #d0f0e0;
    font-weight: 500;
    transition: all 1s ease;
    -webkit-transition: all 1s ease;
    -moz-transition: all 1s ease;
    -ms-transition: all 1s ease;
    -o-transition: all 1s ease;
}
/* Styly pro zobrazení změn v pořadí */
.zmena-poradi {
    font-weight: bold;
    text-align: center;
    padding: 2px 4px;
    border-radius: 3px;
    display: inline-block;
    min-width: 30px;
}

.zmena-new {
    color: #0066cc;
    background-color: #e6f2ff;
}

.zmena-up {
    color: #008800;
    background-color: #eaffea;
}

.zmena-down {
    color: #cc0000;
    background-color: #ffebeb;
}

.zmena-none {
    color: #888888;
    background-color: #f7f7f7;
}

/* ===== MODERNÍ MENU DESIGN ===== */

/* Kontejner menu */
.menu {
    background: #667eea;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    margin: 10px;
    padding: 8px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.menu-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

/* ===== RESPONSIVE LAYOUT ===== */
/* VŠECHNY ORIENTACE - KOMPAKTNÍ VERZE pro úsporu místa */
@media (min-width: 768px) {
    .menu {
        margin: 5px;
        padding: 4px;
        border-radius: 6px;
    }
    
    .menu-form {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 3px;
        justify-content: flex-start;
        align-items: center;
        align-content: center;
    }
    
    .menu-section {
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
        margin: 0;
        width: auto;
        align-self: center;
        align-items: center;
    }
    
    /* Stroje - kompaktní horizontální dropdown layout */
    .menu-machines {
        order: 1;
        flex: 1;
        min-width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
    }
    
    /* Hlavní funkce - v jednom řádku */
    .menu-main {
        order: 2;
        display: flex;
        gap: 3px;
    }
    
    /* Správa a analýzy - v jednom řádku */
    .menu-management {
        order: 3;
        display: flex;
        gap: 3px;
    }
    
    /* Speciální funkce - v jednom řádku */  
    .menu-special {
        order: 4;
        display: flex;
        gap: 3px;
    }
    
    /* Logistika - v jednom řádku */
    .menu-logistics {
        order: 5;
        display: flex;
        gap: 3px;
    }
    
    /* Admin a logout na konec */
    .menu-admin {
        order: 6;
    }
    
    .menu-logout {
        order: 7;
        margin-left: auto;
        flex-shrink: 0;
        align-self: center;
    }
    
    /* Kompaktní tlačítka pro všechny orientace */
    .menu-button {
        padding: 4px 8px;
        font-size: 11px;
        min-width: 50px;
        min-height: 24px;
        margin: 1px;
        border-radius: 4px;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    /* Emoji optimalizace */
    .menu-button .emoji {
        font-size: 12px;
        margin-right: 2px;
    }
    
    /* Speciální velikosti pro různé sekce */
    .menu-machines .menu-button {
        min-width: 40px;
        padding: 3px 5px;
        font-size: 10px;
    }
    
    .menu-main .menu-button {
        min-width: 60px;
        padding: 4px 7px;
        font-size: 10px;
    }
    
    .menu-management .menu-button {
        min-width: 55px;
        padding: 4px 6px;
        font-size: 10px;
    }
    
    .menu-special .menu-button {
        min-width: 55px;
        padding: 4px 6px;
        font-size: 10px;
    }
    
    .menu-logistics .menu-button {
        min-width: 55px;
        padding: 4px 6px;
        font-size: 10px;
    }
    
    .menu-logout .menu-button {
        padding: 4px 8px;
        min-width: 45px;
        background: linear-gradient(135deg, #dc3545, #b02a37);
        font-size: 10px;
    }
}

/* ===== MOBILE OPTIMIZATIONS ===== */

/* ===== TLAČÍTKA DESIGN ===== */
.menu-button {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    min-width: 8rem;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.menu-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.menu-button:hover::before {
    left: 100%;
}

.menu-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.menu-button:active {
    transform: translateY(0);
}

/* Aktivní tlačítko */
.menu-button.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* ===== KATEGORIE TLAČÍTEK ===== */

/* Stroje - zachovat původní barvy */
.btn-machine {
    min-width: 100px;
}

/* Hlavní funkce */
.btn-main {
    background:  #4facfe ;
    border-color: rgba(79, 172, 254, 0.3);
}
.btn-main:hover {
    background:   #00f2fe ;
}

/* Správa a analýzy */
.btn-management {
    background:  #43e97b ;
    border-color: rgba(67, 233, 123, 0.3);
    color:black;
}
.btn-management:hover {
    background: #178800;
}

/* Speciální funkce */
.btn-special {
    background:   #178800 ;
    border-color: rgba(250, 112, 154, 0.3);
}
.btn-special:hover {
    background:   #0a3302  ;
}

/* Logistika */
.btn-logistics {
    background: #5a6acf; /* Jednobarevná modrá místo gradientu */
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.btn-logistics:hover {
    background: #4854b8;
}

/* Admin */
.btn-admin {
    background: #e74c3c; /* Jednobarevná červená místo gradientu */
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Logout */
.logout-button {
    background: #c0392b !important; /* Jednobarevná tmavě červená */
    color: #ffffff !important;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
}

/* ===== STAVY STROJŮ ===== */
.btn-machine.machine-stopped {
    background-color: #bdc3c7 !important; /* Světlejší šedá pro lepší kontrast */
    color: #000000 !important; /* Tmavý text na světlém pozadí */
    font-weight: 700 !important;
    text-shadow: none !important;
    opacity: 1;
    position: relative;
    padding: 0.2rem 0.8rem;
}
.btn-machine.machine-stopped::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(245, 112, 97, 0.6) 5px,
         rgba(245, 112, 97, 0.6) 10px
    );
    border-radius: inherit;
}

.btn-machine.machine-empty {
    background-color: #aad3d6 !important; /* Tmavší šedá */
    color: #020000 !important; /* cerny text na tmavším pozadí */
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
    opacity: 1;
    position: relative;
    padding: 0.2rem 0.8rem;
}
.btn-machine.machine-empty::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 4px,
         rgba(245, 112, 97, 0.6) 4px,
         rgba(245, 112, 97, 0.6) 8px
    );
    border-radius: inherit;
}

/* ===== NOTIFIKACE ===== */
.notification-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ffeb3b;
    border-radius: 50%;
    margin-left: 6px;
    animation: pulse-notification 1.5s infinite;
}

@keyframes pulse-notification {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* ===== ADMIN DROPDOWN ===== */
.admin-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 8px;
    z-index: 1001;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-dropdown:hover .dropdown-content {
    display: block;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    width: 100%;
    padding: 10px 15px;
    margin: 2px 0;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 500;
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    transform: translateX(4px);
}

 
/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    .menu {
        margin: 5px;
        padding: 6px;
        border-radius: 6px;
    }
    
    .menu-button {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 16px;
        min-width: 80px;
    }
    
    .btn-machine {
        min-width: 85px;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .dropdown-content {
        background: rgba(30, 30, 30, 0.95);
    }
    
    .dropdown-item {
        color: #fff;
        background: rgba(255, 255, 255, 0.05);
    }
    
    .dropdown-item:hover {
        background: rgba(102, 126, 234, 0.25);
        color: #4facfe;
    }
}

/* ===== MACHINE DROPDOWN STYLES - COMPACT INDUSTRIAL DESIGN ===== */
.machine-dropdown {
    position: relative;
    margin: 2px;
    background: #f8f9fa;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: visible;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: inline-block;
    min-width: 100px;
}

/* Individual machine buttons - každý stroj samostatně */
.individual-machines-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.individual-machine-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 2px solid transparent;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 120px;
    min-height: 20px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.individual-machine-btn .machine-name {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
}



/* Základní styly pro všechny stavy strojů - zachování originálních barev */
.individual-machine-btn.machine-empty,
.individual-machine-btn.machine-stopped,
.individual-machine-btn.machine-running {
    /* Barva je nastavena inline stylem z databáze */
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.individual-machine-btn.machine-empty:hover,
.individual-machine-btn.machine-stopped:hover,
.individual-machine-btn.machine-running:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

/* Aktivní (vybraný) stroj */
.individual-machine-btn.active {
    border-color: #ffffff !important;
    border-width: 1px !important;
   
    z-index: 10;
    box-shadow: 0 0 15px rgba(9, 255, 0, 0.9);
}

 
.group-dropdown-btn {
    width: 100%;
    padding: 4px 8px;
    background: linear-gradient(135deg, #555 0%, #777 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    height: 24px;
    line-height: 1;
    gap: 4px;
}

.group-dropdown-btn:hover {
    background: linear-gradient(135deg, #666 0%, #888 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.group-count {
    background: rgba(255,255,255,0.3);
    padding: 1px 4px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    text-align: center;
}

.group-status-indicators {
    display: flex;
    gap: 2px;
    align-items: center;
}

.status-indicator {
    padding: 1px 3px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: bold;
    min-width: 12px;
    text-align: center;
    line-height: 1;
}

.empty-indicator {
    background: #dc3545;
    color: white;
}

.stopped-indicator {
    background: #ffc107;
    color: #212529;
}

.active-indicator {
    background: #28a745;
    color: white;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    font-size: 10px;
    width: 12px;
    text-align: center;
}

.machine-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.group-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: 300px;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;
    max-height: 250px;
    overflow-y: auto;
}

.machine-dropdown.active .group-dropdown-content {
    display: block;
}

.dropdown-machine-btn {
    width: 100%;
    padding: 4px 8px;
    border: none;
    background: #f8f9fa;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid #eee;
    font-size: 11px;
    height: 22px;
    line-height: 1.2;
    white-space: nowrap;
    min-width: 120px;
}

.dropdown-machine-btn:hover {
    background: #e9ecef;
}

.dropdown-machine-btn:last-child {
    border-bottom: none;
    border-radius: 0 0 4px 4px;
}

.dropdown-machine-btn.active {
    background: #007bff !important;
    color: white;
    font-weight: bold;
}

.dropdown-machine-btn.machine-empty {
    background-color: #dc3545 !important;
    color: white;
}

.dropdown-machine-btn.machine-stopped {
    background-color: #ffc107 !important;
    color: #212529;
}

/* Single machine button states */
.single-machine-btn.machine-empty {
    background-color: #dc3545 !important;
    color: white;
}

.single-machine-btn.machine-stopped {
    background-color: #ffc107 !important;
    color: #212529;
}

.single-machine-btn.active {
    background-color: #007bff !important;
    color: white;
    font-weight: bold;
}

/* Machine dropdown container horizontal layout - compact */
.machine-dropdown-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: flex-start;
    align-items: flex-start;
    margin: 8px 0;
}

/* Responsive adjustments for compact dropdown menus */
@media (max-width: 768px) {
    .machine-dropdown {
        min-width: 80px;
        margin: 1px;
    }
    
/* Responzivní úpravy pro individuální tlačítka strojů */
@media (max-width: 768px) {
    .individual-machines-container {
        gap: 0.25rem;
    }
    
    .individual-machine-btn {
        min-width: 100px;
        min-height: 50px;
        padding: 0.25rem 0.5rem;
    }
    
    .individual-machine-btn .machine-name {
        font-size: 10px;
    }
    

}

@media (max-width: 480px) {
    .individual-machine-btn {
        min-width: 80px;
        min-height: 45px;
        padding: 0.25rem;
    }
    
    .individual-machine-btn .machine-name {
        font-size: 9px;
    }
    

}
    
    .group-dropdown-btn {
        padding: 3px 6px;
        font-size: 10px;
        height: 22px;
        gap: 2px;
    }
    
    .machine-dropdown-container {
        gap: 2px;
        justify-content: center;
    }
    
    .dropdown-machine-btn {
        font-size: 10px;
        height: 20px;
        padding: 3px 6px;
        min-width: 100px;
    }
    
    .group-dropdown-content {
        max-width: 250px;
        max-height: 200px;
    }
    
    .status-indicator {
        font-size: 8px;
        padding: 0px 2px;
        min-width: 10px;
    }
    
    .group-status-indicators {
        gap: 1px;
    }
}

/* ===== KANBAN ALERT INDICATOR ===== */
.kanban-alert-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 12px;
    animation: kanban-blink 1s infinite;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 1px;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

/* Globální kanban alert indikátor - nezávislý na tlačítkach */
.kanban-global-alert {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    min-height: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.kanban-global-alert:hover {
    background: linear-gradient(135deg, #ff7849 0%, #fa9f47 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.kanban-icon {
    font-size: 12px;
}

.kanban-text {
    font-size: 9px;
    letter-spacing: 0.5px;
}

.kanban-count {
    background: #dc3545;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    animation: kanban-blink 1s infinite;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.kanban-blink {
    font-size: 10px;
    animation: kanban-blink 1s infinite;
}

@keyframes kanban-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Mobile optimization pro kanban indikátor */
@media (max-width: 768px) {
    .kanban-alert-indicator {
        font-size: 10px;
        top: -1px;
        right: -1px;
    }
    
    .kanban-global-alert {
        padding: 3px 6px;
        min-height: 22px;
        gap: 2px;
    }
    
    .kanban-icon {
        font-size: 10px;
    }
    
    .kanban-text {
        font-size: 8px;
    }
    
    .kanban-blink {
        font-size: 9px;
    }
}

/* Globální material alert indikátor - podobný kanban indikátoru */
.material-global-alert {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    min-height: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.material-global-alert:hover {
    background: linear-gradient(135deg, #34ce57 0%, #36d6a5 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.material-icon {
    font-size: 12px;
}

.material-text {
    font-size: 9px;
    letter-spacing: 0.5px;
}

.material-count {
    background: #dc3545;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    animation: material-blink 1s infinite;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

@keyframes material-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Mobile optimization pro material indikátor */
@media (max-width: 768px) {
    .material-global-alert {
        padding: 3px 6px;
        min-height: 22px;
        gap: 2px;
    }
    
    .material-icon {
        font-size: 10px;
    }
    
    .material-text {
        font-size: 8px;
    }
    
    .material-count {
        font-size: 9px;
        padding: 1px 4px;
        min-width: 16px;
    }
}

/* E-kanban modální okno styly */
#modal-ekanban {
    font-family: Arial, sans-serif;
}

.ekanban-list {
    max-height: 400px;
    overflow-y: auto;
}

.ekanban-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 12px;
    background: #f9f9f9;
}

.ekanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.ekanban-time {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

.ekanban-content {
    font-size: 14px;
    line-height: 1.4;
}

.ekanban-content > div {
    margin-bottom: 4px;
}

.ekanban-content strong {
    color: #007bff;
    margin-right: 8px;
}

/* Responzivní design pro modální okno */
@media (max-width: 768px) {
    #modal-ekanban > div {
        max-width: 95%;
        max-height: 90%;
        padding: 15px;
    }
    
    .ekanban-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ===== VYHLEDÁVÁNÍ V TABULKÁCH STROJŮ ===== */
.filter-stroje-container {
    width: auto;
    max-width: 300px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    flex-direction: row;
    gap: 0;
    align-items: center;
}

#filter-stroje {
    width: 100%;
    padding: 0.2rem 0.8rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 26px;
    box-sizing: border-box;
}

#filter-stroje:focus {
    outline: none;
    border-color: #4d90fe;
    box-shadow: 0 0 0 3px rgba(77, 144, 254, 0.2);
    background: #fff;
}

#filter-stroje::placeholder {
    color: #999;
    font-size: 11px;
}

#machine-search-results {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    padding: 0;
    border: 2px solid #4d90fe;
    max-height: 70vh;
    overflow-y: auto;
}

.search-result-item {
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.search-result-item:hover {
    background: #f0f8ff;
    border-color: #007bff;
    transform: translateX(2px);
}

.search-result-item:last-child {
    margin-bottom: 0;
}

/* Mobile optimization pro vyhledávání */
@media (max-width: 768px) {
    .filter-stroje-container {
        margin: 3px 0;
        width: 100%;
        max-width: 100%;
    }
    
    #filter-stroje {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    #machine-search-results {
        max-width: 100%;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .search-result-item {
        padding: 8px;
        font-size: 11px;
    }
}

