html {
    overflow-y: scroll;
}

body { 
    font-family: Arial; 
    font-size:12px; 
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}
a { text-decoration:none; color:#497da4; }
a:hover { color:#284670; }
a img {border:0;}
ul { list-style:none; padding:0; margin:0; }
li { display: inline; }
#wrapper { 
    margin: 20px auto;
    position: relative; 
    max-width: 1600px; 
    height: auto; 
    overflow: hidden; 
    padding: 20px; 
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
#menu { width:100%; height:30px; margin-bottom:10px;}
#menu ul li a { height:22px; padding:5px 8px 0 8px; background: #ededed; display:block; float:left; margin-right:1px; color: #333333; text-decoration:none; }
#menu ul li a:hover { background:#e1e1e1; }
#menu .active {background-color:#e0e0e0!important;}
#logoutBtn { background:#c30808; color:#fff; padding:4px 8px 4px 8px; font-size:11px; position:absolute; top:20px; right:20px; text-decoration:none; }
#logoutBtn:hover { background:#e80f0f; }
#content { width:100%; }
#content form ul li {width:100%; margin-bottom:12px; float:left; display: flex; flex-wrap: wrap; align-items: flex-start;}
#content form label {width:15%; float:left; display:block; padding-top: 5px;}
#content form .field-container {width:85%; float:left; display:block; box-sizing: border-box;}
#content form .full-width-container {width:100%; float:left; display:block; margin-top: 5px;}
#activeOrders {
    width: 100%;
    height: calc((100vh - 340px) * 0.7);
    overflow-y: scroll;
    float: left;
    border: 0px solid #e7e7e7;
    border-radius: 4px;
}

#finishedOrders {
    width: 100%;
    height: calc((100vh - 340px) * 0.3);
    overflow-y: scroll;
    float: left;
    border: 0px solid #e7e7e7;
    border-radius: 4px;
}
#archiveOrders {width:100%; height:calc(100vh - 240px); overflow-y: scroll; float:left; border:0px solid #e7e7e7; border-radius: 4px;}
#addOrderContainer {width:100%; height:calc(100vh - 240px); overflow-y: scroll; float:left; border:0px solid #e7e7e7; border-radius: 4px;}
#order_types {width:693px; float:left; display:block;}
#order_types span {width:295px; float:left; height: 20px; display:block; text-align: left;}
#orderDescription {height: 750px!important;}
#printList li {display: block; width: 100%; margin:5px 0 0 0; float: left; padding-top:5px; border-top: 1px solid #e1e1e1;}
#printList label { display: block; width:200px; float: left; font-weight: bold; color: #ff0000;}
#printList .printTxtContainer {display: block; float: left;}
.inputText { width:100%; float:left; border:1px solid #cccccc; box-sizing: border-box; min-height: 23px; border-radius: 4px; }
.selectCategory { width:100%; float:left; height:100px; box-sizing: border-box; }
.separator { width:100%; height:2px; border-bottom:1px solid #cccccc; float:left; margin:8px 0; }

/* Style dla edytora Summernote */
.note-editor {
    border: 1px solid #cccccc !important;
    margin-bottom: 12px;
    width: 100% !important;
    box-sizing: border-box !important;
}
.note-editor .note-editing-area {
    background-color: white;
}
.note-editor.note-frame .note-editing-area .note-editable {
    font-family: Arial, Verdana;
    font-size: 12px;
    color: #333;
    padding: 10px;
    min-height: 100px;
}
.note-editor .note-toolbar {
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
}
.note-editor.note-frame.error-frame {
    border: 1px solid #f44336 !important;
    background-color: #fff8f8;
}

.saveButton, .addButton, .printButton, .endButton, .moveBackButton, .archiveButton, .duplicateButton { 
    float:right; 
    background-color:#ededed!important; 
    border:1px solid #ccc; 
    display:block; 
    padding:4px 6px 4px 22px; 
    cursor:pointer; 
    color:#666; 
    margin:10px 0 0 5px; 
    line-height: 16px;
    background-position: 4px center;
    background-size: 16px 16px;
}
.saveButton:hover, .addButton:hover, .printButton:hover, .endButton:hover, .moveBackButton:hover, .archiveButton:hover, .duplicateButton:hover {color:#000000!important;}
.saveButton     {background:url(../images/save.png) no-repeat left;}
.addButton      {background:url(../images/add.png) no-repeat left;}
.printButton    {background:url(../images/print.png) no-repeat left;}
.endButton      {background:url(../images/confirm.png) no-repeat left;}
.moveBackButton {background:url(../images/moveBack.png) no-repeat left;}
.archiveButton  {background:url(../images/archive.png) no-repeat left;}
.duplicateButton {background-image: url('../images/duplicate.png');}
.goBackLink { float:right;line-height:25px; margin:0 8px; }
.blueIt { font-style:italic; color:#377ca0; }
.redIt { font-style:italic; color:#377ca0; }
.grey {color:#8e8e8e;}
.infoMsg { 
    background-color: #e3f2fd;
    color: #0d47a1;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    border-left: 4px solid #2196F3;
}
.errMsg { 
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid #f44336;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    display: block;
    clear: both;
    overflow: hidden;
}

.errMsg h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 15px;
    color: #d32f2f;
}

.errMsg ul {
    margin: 5px 0 5px 20px;
    padding: 0;
    list-style-type: disc;
    width: 100%;
    display: block;
}

.errMsg ul li {
    display: list-item !important;
    margin-bottom: 5px;
    line-height: 1.4;
    text-align: left;
    width: 100%;
    float: none;
}

/* Nowa definicja klasy error zastępująca starą */
.error {
    border: 1px solid #f44336 !important;
    background-color: #fff8f8 !important;
} 

.error-container {
    position: relative;
}

/* Usuwam ikonę trójkąta
.error-container::after {
    content: "⚠️";
    position: absolute;
    right: 10px;
    top: 8px;
    color: #f44336;
    font-size: 16px;
    z-index: 10;
}
*/

.note-editor.note-frame.error-frame {
    border: 1px solid #f44336 !important;
    background-color: #fff8f8;
}
.bold {font-weight:bold;}
.left {float: left;}
.right {float: right;}
.hide {display: none;}
label.error {display:none!important;}
.withBgColor { background-color:#eef2f4; }
.withBgColor1 { background-color:#dfe9f1; }
.promotion { background-color:#efe4c7; }
.alert1 {color:#db390e;}
.legend { width:100%; float:left; margin: 5px 0 10px 0; }
.legendItem { display:block; float:left; width:20px; height:15px; margin-right:4px; }
.orders_list_item { position:relative; width:100%; padding:8px 0; float:left; margin-bottom: 4px; border-radius: 4px;}
.orders_list_item ul, .categoriesListItem ul { position:absolute; top:50%; right:5px; transform: translateY(-50%); }
.orders_list_item ul li, .categoriesListItem ul li { display:inline; text-align:center; float:left; }
.listNumber {color:#666666; margin-left:8px; width:30px; display:block; float:left;}
.col0 {width:160px; min-height:20px; display:block; float:left; padding:0 7px;}
.col1 {width:80px; min-height:20px; display:block; float:left; padding:0 7px;}
.col2 {width:80px; min-height:20px; display:block; float:left; padding:0 7px;}
.col3 {width:83px; min-height:20px; display:block; float:left; padding:0 7px;}
.col4 {width:80px; min-height:20px; display:block; float:left; padding:0 7px;}
.colName {width:16%; min-height:20px; display:block; float:left; padding:0 7px; overflow:hidden;}
.colPerson {width:100px; min-height:20px; display:block; float:left; padding:0 7px;}
.colProduction {width:150px; min-height:20px; display:block; float:left; padding:0 7px;}
.colStatus {width:150px; min-height:20px; display:block; float:left; padding:0 7px;}
.colEdit, .colDel, .colFV {width:30px; display:block; float:left;}

/* Style dla ikon */
.colEdit a, .colEdit span, .colDel a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #ffffff;
    border-radius: 4px;
    border: 1px solid #cccccc;
}

.colEdit a img, .colEdit span img, .colDel a img {
    width: 16px;
    height: 16px;
    filter: brightness(0);
}

/* Style dla formularza wyszukiwania */
.js-filter-form {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.js-filter-form input[type="text"] {
    margin-right: 10px;
    padding: 6px 10px;
    width: 220px;
    border: 1px solid #cccccc;
    border-radius: 4px;
}

.js-filter-form select {
    margin-right: 10px;
    padding: 5px 8px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background-color: #ffffff;
}

.js-filter-form input[type="submit"] {
    padding: 6px 15px;
    background-color: #ededed;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
}

.js-filter-form input[type="submit"]:hover {
    background-color: #e1e1e1;
    color: #000000;
}

.topMargin1 {margin-top:30px; display:block; float:left; }
.categoryName, .unclassified { text-align:center; font-weight:bold; line-height:30px; background-color:#333333; width:99%; float:left; margin-bottom:5px; color:#efefef; }
.headerBold {font-weight:bold; }
.turnoverIcon {position: absolute; top:94px; right:12px; z-index: 100;}

/* Style dla walidacji formularzy */
.error-frame {
    border: 2px solid #ff0000 !important;
}

/* Styl dla czerwonej gwiazdki */
.redIt {
    color: #ff0000;
    font-weight: bold;
}

/* Style dla przycisków formularzy */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-right: 0;
    text-decoration: none !important;
    height: 32px;
    box-sizing: border-box;
}

a.button {
    color: inherit;
}

.button i {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
}

.button-primary {
    background-color: #4CAF50;
    color: white !important;
}

.button-secondary {
    background-color: #4e95d4;
    color: white !important;
}

.button-back {
    background-color: #f0f0f0;
    color: #333;
}

.form-buttons {
    text-align: right;
    padding: 10px 0;
    margin: 0;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-buttons .saveButton,
.form-buttons .addButton,
.form-buttons .printButton,
.form-buttons .endButton,
.form-buttons .moveBackButton,
.form-buttons .archiveButton,
.form-buttons .duplicateButton {
    float: none;
    display: inline-block;
    margin-left: 10px;
}

/* Zmiana stylu dla ostatniego elementu listy */
#content form ul li:last-child {
    justify-content: flex-end;
}

/* Modal dialog */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 1.5px 8px rgba(73,125,164,0.10);
    max-width: 410px;
    width: 100%;
    transition: box-shadow 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;}

.modal-body {
    line-height: 1.7;
}

.modal-body p {
    margin: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 18px;
}

.modal-footer button {
    margin-left: 10px;
    padding: 6px 15px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel {
    background-color: #f1f1f1;
    color: #555;
    border: 0px !important;
    border-radius: 7px;
    font-weight: 500;
    padding: 8px 22px;
    font-size: 14px;
}

.btn-confirm {
    background-color: #e53935;
    color: #fff;
    border: 0px !important;
    border-radius: 7px;
    font-weight: 600;
    padding: 8px 22px;
    font-size: 14px;
}

/* ===== RESPONSYWNOŚĆ DLA URZĄDZEŃ MOBILNYCH ===== */
@media only screen and (max-width: 768px) {
    /* Ogólne style */
    body {
        font-size: 14px;
    }
    
    #wrapper {
        padding: 5px;
        max-width: 100%;
        box-sizing: border-box;
        border-width: 0;
    }
    
    /* Menu nawigacyjne */
    #menu {
        flex-direction: column;
        gap: 5px;
        margin-bottom: 15px;
        height: auto;
    }
    
    #menu a, 
    #menu .menu-item {
        width: 100%;
        box-sizing: border-box;
        justify-content: flex-start;
        display: flex !important;
        float: none;
        height: auto;
        margin-bottom: 5px;
    }
    
    #logoutBtn {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        margin-top: 5px;
        box-sizing: border-box;
    }
    
    /* Formularze */
    #content form label {
        width: 100%;
        margin-bottom: 5px;
        padding-top: 0;
    }
    
    #content form .field-container {
        width: 100%;
    }
    
    #content form ul li {
        margin-bottom: 15px;
    }
    
    .inputText {
        width: 100%;
    }
    
    /* Przyciski */
    .saveButton, .addButton, .printButton, .endButton, .moveBackButton, .archiveButton, .duplicateButton {
        margin: 5px 0;
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .form-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .form-buttons button {
        width: 100%;
    }
    
    /* Tabele i listy zleceń */
    .orders_list_item {
        position: relative;
        padding: 10px 0;
        display: flex;
        flex-wrap: wrap;
    }
    
    .listNumber {
        width: 100%;
        margin-left: 0;
        margin-bottom: 5px;
    }
    
    .col0, .col1, .col2, .col3, .col4, .colName, .colPerson, .colStatus {
        width: 100%;
        padding: 3px 5px;
        min-height: auto;
    }
    
    .colEdit, .colDel, .colFV {
        width: auto;
        margin: 5px 5px 0 0;
    }
    
    /* Ukrywanie elementów na mobilnych urządzeniach */
    .mobile-hide {
        display: none !important;
    }
    
    /* Style dla nagłówka tabeli na urządzeniach mobilnych */
    .orders-header {
        display: none;
    }
    
    /* Wyszukiwarka */
    .js-filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .js-filter-form input[type="text"],
    .js-filter-form select,
    .js-filter-form button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    /* Paginacja */
    .pagination {
        flex-wrap: wrap;
    }
    
    /* Modalne okna */
    .modal-container {
        width: 95%;
        max-width: 95%;
        padding: 15px;
    }
    
    /* Wysokości kontenerów */
    #activeOrders, #finishedOrders, #archiveOrders {
        height: auto;
        max-height: 70vh;
    }
    
    /* Etykiety dla mobilnych urządzeń */
    .orders_list_item .col1:before {
        content: "Nr zlecenia: ";
        font-weight: bold;
    }
    
    .orders_list_item .col0:before {
        content: "Klient: ";
        font-weight: bold;
    }
    
    .orders_list_item .colName:before {
        content: "Nazwa zlecenia: ";
        font-weight: bold;
    }
    
    .orders_list_item .col3:before {
        content: "Data realizacji: ";
        font-weight: bold;
    }
    
    /* Poprawka dla nagłówków h3 z formularzami */
    h3 {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    
    h3 .right {
        width: 100%;
        margin-top: 10px;
    }
}

/* Dodatkowe style dla bardzo małych ekranów */
@media only screen and (max-width: 480px) {
    /* Jeszcze mniejsze fonty */
    body {
        font-size: 13px;
    }
    
    /* Zmniejsz padding dla przycisków */
    #menu a {
        padding: 6px 12px;
    }
    
    /* Zmniejsz rozmiar ikon */
    .colEdit a, .colEdit span, .colDel a {
        width: 20px;
        height: 20px;
    }
    
    .colEdit a img, .colEdit span img, .colDel a img {
        width: 14px;
        height: 14px;
    }
}

/* Style dla formularza logowania */
.login-body {
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.login-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 400px;
    max-width: 90%;
    overflow: hidden;
    text-align: center;
}

.login-logo {
    padding: 30px 0 10px;
}

.login-logo img {
    max-width: 120px;
    height: auto;
}

.login-form-container {
    padding: 20px 30px;
}

.login-form-container h2 {
    margin: 0 0 20px;
    color: #444444;
    font-size: 24px;
    font-weight: 500;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666666;
    font-size: 14px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666666;
    width: 18px;
    height: 18px;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.input-with-icon input:focus {
    border-color: #666666;
    outline: none;
}

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    background-color: #444444;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-button:hover {
    background-color: #333333;
}

.login-button svg {
    margin-right: 8px;
    width: 18px;
    height: 18px;
}

.login-error {
    background-color: #ffebee;
    color: #f44336;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-footer {
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    color: #666666;
    font-size: 12px;
}

/* Media queries dla responsywności */
@media (max-width: 480px) {
    .login-form-container {
        padding: 20px 15px;
    }
    
    .login-container {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }
}

/* Form validation styles */
.form-field-error {
    border-color: #ff4444 !important;
    box-shadow: 0 0 0 1px #ff4444 !important;
    border-radius: 4px !important;
}

.form-field-error:focus {
    border-color: #ff4444 !important;
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.25) !important;
    border-radius: 4px !important;
}

.note-editor.form-field-error {
    border: 1px solid #ff4444 !important;
}

/* Hide duplicate textarea created by Summernote */
.note-editor + textarea {
    display: none !important;
}

/* Style dla wydruku */
@media print {
    body {
        background: none;
        margin: 0;
        padding: 0;
    }
    
    #wrapper {
        margin: 0;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
        background: none;
        max-width: none;
    }
    
    #menu, #logoutBtn, .saveButton, .addButton, .printButton, 
    .endButton, .moveBackButton, .archiveButton, .duplicateButton,
    .goBackLink {
        display: none !important;
    }
    
    #content {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .note-editor {
        border: none !important;
    }
    
    .note-editor .note-toolbar {
        display: none;
    }
    /* Style dla tabel w Summernote */
    .note-editable table, 
    .printTxtContainer table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-bottom: 15px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    
    .note-editable table td, 
    .note-editable table th,
    .printTxtContainer table td, 
    .printTxtContainer table th {
        border: 1px solid #000 !important;
        padding: 6px !important;
        background-color: transparent !important;
        color: #000 !important;
    }
    
    /* Zachowanie kolorów tła, jeśli zostały ustawione */
    .note-editable table td[style*="background-color"],
    .printTxtContainer table td[style*="background-color"] {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Poprawka dla szerokości kolumn */
    .note-editable table td[width],
    .printTxtContainer table td[width] {
        width: auto !important;
    }
    
    /* Wsparcie dla łączonych komórek */
    .note-editable table td[colspan],
    .printTxtContainer table td[colspan] {
        text-align: center !important;
    }
    
    /* Dbamy o to, aby tabele nie były zbyt szerokie */
    .printTxtContainer {
        width: 100% !important;
        overflow-x: hidden !important;
    }
}

.bold-date { font-weight: bold; }