:root {
    /* Paleta Wyspawany - Industrial */
    --bg-body: #1e1e24;
    /* Bardzo ciemny szary (tło) */
    --bg-card: #2b2b33;
    /* Jasniejszy szary (boxy) */
    --text-main: #e0e0e0;
    /* Biały złamany */
    --text-muted: #a0a0a0;
    /* Szary tekst */

    --accent-yellow: #ffbd00;
    /* Spawalniczy żółty */
    --accent-brown: #8d6e63;
    /* Brąz (rdza/drewno) */
    --accent-hover: #e6a800;
    --accent-green: rgb(0, 204, 0);

    --border-color: #3e3e4a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- UKŁAD GLÓWNY (GRID) --- */
.app-container {
    display: grid;
    /* Treść (auto) | Menu (300px) */
    grid-template-columns: 1fr 300px;
    gap: 20px;
    padding: 20px;
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
    min-height: 100vh;
}

/* Mobilka: jeden pod drugim */
@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    /* Na mobilce menu wrzucamy na górę lub dół - tu zostawiam naturalny flow */
    .sidebar {
        order: -1;
    }
}

/* --- LEWA STRONA: BOX GŁÓWNY --- */
.main-content {
    background: var(--bg-card);
    border-radius: 12px;
    border-left: 4px solid var(--accent-yellow);
    /* Żółty akcent po lewej */
    padding: 30px;
    box-shadow: var(--shadow);
    min-height: 80vh;
}

.page-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--accent-yellow);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: var(--accent-yellow);
    color: #000;
    border-color: var(--accent-yellow);
}

[data-theme="light"] .sidebar-toggle-btn {
    background: #fff;
    color: #333;
    border-color: #ccc;
}

.sidebar-toggle-floating {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
}

/* --- PRAWA STRONA: MENU --- */
.sidebar {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 20px;
    /* Po rozwinięciu kategorii z dużą liczbą linków (np. "Laser") sidebar potrafił
       być wyższy niż okno przeglądarki, a ostatnie linki stawały się nieosiągalne.
       Ograniczamy wysokość do widocznego obszaru i przewijamy menu wewnątrz sidebaru,
       niezależnie od przewijania całej strony. */
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.logo-area {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo-text a {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    text-decoration: none;
}

.logo-text-a {
    text-decoration: none;
}

.logo-text span {
    color: var(--accent-yellow);
    display: block;
    font-size: 0.9em;
}

/* Style Menu */
.menu-category {
    margin-bottom: 15px;
}

.menu-toggle {
    background: #363640;
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
    border: 1px solid transparent;
}

.menu-toggle:hover,
.menu-toggle.active {
    background: #40404a;
    border-color: var(--accent-brown);
    color: var(--accent-yellow);
}

/* --- MENU ROZWIJANE (SIDEBAR) --- */
.link-group {
    display: none;
    /* Domyślnie ukryte */
    padding-left: 10px;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.link-group.show {
    display: block;
    /* Pokaż gdy klasa .show jest dodana */
}

.link-group a {
    display: block;
    padding: 10px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 2px solid transparent;
    transition: 0.2s;
}

.link-szukaj a {
    padding: 10px 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 2px solid transparent;
    transition: 0.2s;
}

.link-group a:hover {
    color: #fff;
    background: rgba(255, 189, 0, 0.05);
    border-left-color: var(--accent-yellow);
    padding-left: 25px;
}

/* Przyciski w treści */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent-brown);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: 0.2s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #7a5e54;
}

.btn-primary {
    background: var(--accent-yellow);
    color: #1a1a1a;
    font-weight: 700;
}

.action-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent-yellow);
    color: #1a1a1a;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    border: 2px solid var(--accent-yellow);
    transition: 0.2s;
    cursor: pointer;
    text-align: center;
}

.action-btn:hover {
    background: #ffd740;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 189, 0, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

/* --- TABELA ZAMÓWIEŃ --- */
.table-container {
    overflow-x: auto;
    /* Przewijanie na telefonie */
}

.data-table {
    width: 100%;
    border-collapse: separate;
    /* Umożliwia border-radius */
    border-spacing: 0 8px;
    /* Odstęp między wierszami */
    font-size: 0.95rem;
}

.data-table thead th {
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    padding: 0 15px 10px 15px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table tbody tr {
    background: #25252b;
    transition: transform 0.2s, box-shadow 0.2s;
}

.data-table tbody tr:hover {
    transform: translateY(-2px);
    background: #2a2a30;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.data-table td {
    padding: 15px;
    vertical-align: middle;
}

/* --- KOLOROWANIE WIERSZY I STATUSÓW --- */

/* Badge Styles */
.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-new {
    background: rgb(0, 102, 255);
    color: #3498db;
}

/* Niebieski */
.badge-sand {
    background: rgba(255, 189, 0, 0.15);
    color: #ffbd00;
}

/* Żółty */
.badge-paint {
    background: rgba(230, 126, 34, 0.15);
    color: #e67e22;
}

/* Pomarańcz */
.badge-ship {
    background: rgb(255, 204, 102);
    color: rgb(255, 0, 204);
}

/* Fiolet */
.badge-done {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

/* Zielony */
.badge-urgent {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

/* CZERWONY PILNE */
.badge-pack {
    background: rgba(156, 39, 176, 0.15);
    color: #d05ce3;
}

/* Róż/Fiolet */
.badge-wip {
    background: rgba(121, 85, 72, 0.2);
    color: #bcaaa4;
}

/* Brąz/Beż */
.badge-wip3 {
    background: rgb(192, 192, 192);
    color: rgb(85, 85, 85);
}

/* Brąz/Beż */

/* Kolorowe paski na dole wiersza */
.data-table tr[class^="row-status-"] td {
    border-bottom-width: 2px;
    border-bottom-style: solid;
}

.row-status-0 td {
    border-bottom-color: #3498db;
}

/* Nowe */
.row-status-1 td {
    border-bottom-color: rgb(255, 204, 51);
}

/* Realizacja */
.row-status-2 td {
    border-bottom-color: #ffbd00;
    background: rgba(255, 189, 0, 0.03) !important;
}

/* Piaskowanie */
.row-status-3 td {
    border-bottom-color: #e67e22;
    background: rgba(230, 126, 34, 0.03) !important;
}

/* Malowanie */
.row-status-4 td {
    border-bottom-color: rgb(51, 204, 51);
}

/* Wysyłka */
.row-status-5 td {
    border-bottom-color: #2ecc71;
    opacity: 0.7;
}

/* Wysłane (przygaszone) */
.row-status-6 td {
    border-bottom-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1) !important;
}

/* !!! PILNE !!! */
.row-status-7 td {
    border-bottom-color: #d05ce3;
}

/* Do pakowania */
.row-status-8 td {
    border-bottom-color: #1abc9c;
}

/* Dostawa */
.row-status-9 td {
    border-bottom-color: #795548;
}

/* Do wykończenia */
.row-status-10 td {
    border-bottom-color: #95a5a6;
}

/* Inne */

.data-table tbody tr:hover td {
    border-bottom-width: 3px;
    filter: brightness(1.2);
}


/* Badge (Pigułki statusów) */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-new {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.badge-sand {
    background: rgba(255, 189, 0, 0.15);
    color: var(--accent-yellow);
}

.badge-paint {
    background: rgba(230, 126, 34, 0.2);
    color: #e67e22;
}

.badge-ship {
    background: rgb(255, 204, 102);
    color: rgb(255, 0, 204);
}

.badge-ship2 {
    background: rgb(51, 102, 51);
    color: rgb(51, 204, 51);
}

.badge-done {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.badge-allegro {
    background: #ff5a00;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-right: 5px;
}

.client-name {
    font-weight: 600;
    color: #fff;
    display: block;
}

.client-details {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.product-list {
    font-size: 0.9rem;
    color: #ddd;
    max-width: 300px;
}

.price {
    font-weight: 700;
    color: var(--accent-yellow);
}

.action-icon {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0 5px;
    transition: 0.2s;
}

.action-icon:hover {
    color: #fff;
}

.btn-delete:hover {
    color: #ff4757;
}

/* --- STRONICOWANIE (PAGINATION) --- */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 25px;
    padding-bottom: 20px;
}

.pagination {
    display: flex;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: #25252b;
    border: 1px solid #444;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: var(--accent-yellow);
    color: #fff;
    background: #2a2a32;
}

.page-btn.active {
    background: var(--accent-yellow);
    color: #000;
    border-color: var(--accent-yellow);
    font-weight: 700;
}

.page-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

/* --- SZCZEGÓŁY ZAMÓWIENIA --- */
.details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* Lewa szersza, prawa węższa */
    gap: 25px;
}

.detail-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-top: 4px solid transparent;
}

.card-product {
    border-top-color: var(--accent-yellow);
}

.card-client {
    border-top-color: #3498db;
}

.card-date {
    border-top-color: rgb(0, 204, 0);
}

.card-actions {
    border-top-color: var(--accent-brown);
    position: sticky;
    top: 20px;
}

.detail-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: #fff;
    border-bottom: 1px solid #3e3e4a;
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #333;
    font-size: 0.95rem;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    color: #eee;
    font-weight: 500;
    text-align: right;
}

.info-value.highlight {
    color: var(--accent-yellow);
    font-weight: 700;
    font-size: 1.1em;
}

.big-data-box {
    background: #1e1e24;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
    font-family: monospace;
    color: #ccc;
    margin-top: 10px;
    white-space: pre-wrap;
    /* Zachowuje entery */
}

/* Responsywność */
@media (max-width: 900px) {
    .details-grid {
        grid-template-columns: 1fr;
    }

    .card-actions {
        position: static;
    }
}

/* --- SEKCJA KURIER I SMS --- */
.courier-box {
    background: #25252b;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.courier-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
}

.tracking-group {
    display: flex;
    gap: 10px;
}

.btn-sms {
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sms:hover {
    background: #2980b9;
}

.sms-sent-info {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #2ecc71;
    font-size: 0.9rem;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- DANE ADRESOWE I FAKTURY --- */
.address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.address-item label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 4px;
}

.address-item div {
    font-size: 1rem;
    color: #eee;
    font-weight: 500;
}

.invoice-box {
    background: rgba(255, 189, 0, 0.05);
    border: 1px dashed var(--accent-yellow);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invoice-link {
    color: var(--accent-yellow);
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.invoice-link:hover {
    text-decoration: underline;
}

/* --- NOWOCZESNE FORMULARZE --- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    background: #1a1a1e;
    /* Bardzo ciemne tło */
    border: 1px solid #444;
    color: #eee;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 3px rgba(255, 189, 0, 0.1);
    background: #202026;
}

/* Pole tekstowe z autodopasowaniem */
textarea.auto-resize {
    min-height: 100px;
    resize: none;
    /* Wyłączamy ręczne rozciąganie */
    overflow-y: hidden;
    /* Ukrywamy scrollbar */
    line-height: 1.5;
}

/* Wygląd listy rozwijanej (Select) */
select.form-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23AAAAAA%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right .7em top 50%;
    background-size: .65em auto;
    appearance: none;
    /* Usuwamy domyślną strzałkę systemową */
    padding-right: 25px;
}

/* --- ZAŁĄCZNIKI (PLIKI) --- */
.files-box {
    margin-top: 15px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e1e24;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    transition: 0.2s;
}

.file-item:hover {
    border-color: var(--accent-yellow);
    background: #25252b;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.file-icon {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.file-name {
    color: #eee;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.file-name a {
    color: inherit;
    text-decoration: none;
}

.file-name a:hover {
    text-decoration: underline;
}

.btn-file-delete {
    color: #e74c3c;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: 0.2s;
}

.btn-file-delete:hover {
    opacity: 1;
    transform: scale(1.1);
}

.upload-area {
    border: 2px dashed #444;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    margin-top: 15px;
    transition: 0.2s;
    background: rgba(255, 255, 255, 0.02);
}

.upload-area:hover {
    border-color: var(--accent-yellow);
    background: rgba(255, 189, 0, 0.05);
}

.custom-file-input {
    display: none;
}

.custom-file-label {
    display: inline-block;
    padding: 8px 15px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 5px;
}

.custom-file-label:hover {
    background: #444;
}

.orders-header {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid var(--accent-yellow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tools-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-input {
    background: #1e1e24;
    color: #fff;
    border: 1px solid #444;
    padding: 0 15px;
    height: 42px;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.2s;
}

.control-input:focus {
    border-color: var(--accent-yellow);
}

.search-box {
    position: relative;
}

.search-box input {
    padding-left: 38px;
    width: 220px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

.btn-add {
    height: 42px;
    padding: 0 20px;
    background: var(--accent-yellow);
    color: #111;
    font-weight: 700;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: none;
}

.btn-edit {
    height: 35px;
    padding: 0 20px;
    background: var(--accent-green);
    color: #111;
    font-weight: 700;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: none;
}

.btn-add:hover {
    background: var(--accent-hover);
}

.btn-details {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid #444;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.2s;
    text-decoration: none;
}

.btn-details:hover {
    background: var(--accent-yellow);
    color: #000;
    border-color: var(--accent-yellow);
}

@media (max-width: 850px) {
    .orders-header {
        flex-direction: column;
        align-items: stretch;
    }

    .tools-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box input,
    .control-input {
        width: 100%;
    }

    .btn-add {
        justify-content: center;
    }
}

/* Styl dymka powiadomienia */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1e1e24;
    border-left: 5px solid #2ecc71;
    /* Zielony pasek */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    padding: 15px 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 9999;
    min-width: 300px;
    transform: translateX(120%);
    /* Domyślnie schowane poza ekranem */
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.toast-icon {
    font-size: 1.5rem;
    color: #2ecc71;
}

.toast-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.85rem;
    color: #aaa;
}

.toast-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: #fff;
}

/* --- MESSAGE BOXES (SUCCESS/ERROR) --- */
.success-msg {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(46, 204, 113, 0.05));
    color: #2ecc71;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2ecc71;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.1);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

.error-msg {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15), rgba(231, 76, 60, 0.05));
    color: #e74c3c;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #e74c3c;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.1);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- TRYB JASNY (LIGHT MODE OVERRIDES) --- */
[data-theme="light"] {
    /* Nadpisujemy zmienne kolorystyczne */
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #e0e4e8;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Specyficzne poprawki dla trybu jasnego (żeby elementy były czytelne) */
[data-theme="light"] .logo-text a {
    color: #2c3e50;
}

[data-theme="light"] .form-input {
    background: #fff;
    border-color: #ccc;
    color: #333;
}

[data-theme="light"] .form-input:focus {
    background: #fff;
}

[data-theme="light"] .data-table tbody tr {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .data-table tbody tr:hover {
    background: #f1f1f1;
}

[data-theme="light"] .page-btn {
    background: #fff;
    color: #333;
}

[data-theme="light"] .page-btn:hover {
    background: #eee;
}

[data-theme="light"] .detail-title {
    color: #2c3e50;
}

[data-theme="light"] .info-value {
    color: #333;
}

[data-theme="light"] .courier-box,
[data-theme="light"] .big-data-box,
[data-theme="light"] .file-item {
    background: #f8f9fa;
    color: #333;
}

/* --- ZLECENIE_PODGLAD – TRYB JASNY --- */
/* Status badge w trybie jasnym (żółty na białym jest nieczytelny) */
[data-theme="light"] .st-w-trakcie {
    background: rgba(241, 196, 15, 0.2);
    color: #9a6e00;
}

/* Wiersze tabeli detali */
[data-theme="light"] .detal-row {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .detal-row:hover {
    background: #f1f3f5;
}

/* Status select i qty input – ciemne tło domyślne, w trybie jasnym poprawiamy */
[data-theme="light"] .status-select {
    background: #fff;
}

[data-theme="light"] .qty-input {
    background: #fff;
}

/* Blok dodawania detalu */
[data-theme="light"] .add-box {
    background: #f8f9fa;
    border-color: #ccd0d5;
}

/* Modal kalkulator */
[data-theme="light"] .modal-container {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .modal-left {
    background: #1a1a2e;
}

/* Poprawka kolorów badge'y (pigułek) w trybie jasnym dla lepszego kontrastu */
[data-theme="light"] .badge-new {
    background: rgba(52, 152, 219, 0.2);
    color: #2980b9;
}

[data-theme="light"] .badge-sand {
    color: #d35400;
}

[data-theme="light"] .badge-done {
    color: #27ae60;
}

[data-theme="light"] .price {
    color: #d35400;
}

/* Zamówienia: kolorowanie całego wiersza wg statusu (tryb jasny) */
[data-theme="light"] .data-table tr[class^="row-status-"] td {
    border-bottom-width: 0;
}

[data-theme="light"] .row-status-0 td {
    background: rgb(0, 153, 255);
    color: white;
}

/* Nowe - niebieski */
[data-theme="light"] .row-status-1 td {
    background: rgb(255, 153, 255);
}

/* Realizacja - fiolet */
[data-theme="light"] .row-status-2 td {
    background: rgba(241, 196, 15, 0.34) !important;
}

/* Piaskowanie - żółty */
[data-theme="light"] .row-status-3 td {
    background: rgb(51, 153, 51) !important;
}

/* Malowanie - pomarańcz */
[data-theme="light"] .row-status-4 td {
    background: rgba(26, 188, 156, 0.26);
}

/* Do wysyłki - turkus */
[data-theme="light"] .row-status-5 td {
    background: rgba(46, 204, 113, 0.24);
}

/* Wysłane - zielony */
[data-theme="light"] .row-status-6 td {
    background: rgba(231, 76, 60, 0.32) !important;
}

/* Pilne - czerwony */
[data-theme="light"] .row-status-7 td {
    background: rgba(232, 67, 147, 0.26);
}

/* Do pakowania - róż */
[data-theme="light"] .row-status-8 td {
    background: rgba(52, 73, 94, 0.20);
}

/* Dostawa - grafit */
[data-theme="light"] .row-status-9 td {
    background: rgba(141, 110, 99, 0.26);
}

/* Do wykończenia - brąz */
[data-theme="light"] .row-status-10 td {
    background: rgba(127, 140, 141, 0.28);
}

/* Inne - szary */

[data-theme="light"] .data-table tbody tr[class^="row-status-"]:hover td {
    filter: brightness(0.98);
}

/* --- POPRAWKI MENU DLA TRYBU JASNEGO --- */
[data-theme="light"] .menu-toggle {
    background: #f1f3f5;
    /* Jasne tło przycisku */
    color: #2c3e50;
    /* Ciemny tekst */
    border: 1px solid #e0e4e8;
    /* Delikatna ramka */
}

[data-theme="light"] .menu-toggle i {
    color: #7f8c8d;
    /* Kolor ikon w menu */
}

[data-theme="light"] .menu-toggle:hover,
[data-theme="light"] .menu-toggle.active {
    background: #ffffff;
    /* Białe tło po najechaniu */
    color: #d35400;
    /* Akcent kolorystyczny (brąz/pomarańcz) */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-color: #d35400;
}

[data-theme="light"] .link-group {
    background: rgba(0, 0, 0, 0.03);
    /* Bardzo jasne tło rozwiniętego menu */
    border-bottom: 1px solid #e0e4e8;
}

[data-theme="light"] .link-group a {
    color: #555;
    /* Ciemne linki */
}

[data-theme="light"] .link-group a:hover {
    color: #000;
    background: rgba(255, 189, 0, 0.15);
    /* Żółte podświetlenie po najechaniu */
}

/* Sidebar tło */
[data-theme="light"] .sidebar {
    background: #ffffff;
    border: 1px solid #e0e4e8;
}

/* --- EWIDENCJA CZASU --- */
.ewidencja-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.panel-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.odbijanie-karty {
    position: sticky;
    top: 20px;
}

.input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
}

.btn-wejscie {
    background: #27ae60;
    color: white;
    padding: 15px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
}

.btn-wejscie:hover {
    background: #229954;
}

.month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
}

.kalendarz-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.kalendarz-table th,
.kalendarz-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.kalendarz-table th {
    background: var(--bg-body);
    font-weight: 600;
    color: var(--accent-yellow);
}

.czas-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: inline-block;
}

.czas-wejscie {
    background: #d5f4e6;
    color: #27ae60;
}

.czas-wyjscie {
    background: #fadbd8;
    color: #e74c3c;
}

.czas-suma {
    background: var(--accent-yellow);
    color: #1a1a1a;
    font-weight: bold;
}

.czas-urlop {
    background: #d6eaf8;
    color: #2e86c1;
}

.czas-l4 {
    background: #fdebd0;
    color: #b9770e;
}

.czas-opieka {
    background: #e8daef;
    color: #7d3c98;
}

@media (max-width: 900px) {
    .ewidencja-container {
        grid-template-columns: 1fr;
    }

    .odbijanie-karty {
        position: relative;
    }
}

/* --- SLEDZENIE MODULE --- */
.stat-box {
    background: var(--bg-card);
    border: 2px solid var(--accent-yellow);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 189, 0, 0.2);
}

.stat-ico {
    font-size: 32px;
    display: block;
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-val {
    color: var(--accent-yellow);
    font-size: 28px;
    font-weight: bold;
}

[data-theme="light"] .stat-box:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* --- AKCJA BADGES --- */
.akcja-badge {
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
    border: 1px solid;
}

/* Konkretne akcje - CIEMNY MOTYW */
.akcja-wejscie {
    background: #2ecc71;
    color: #fff;
    border-color: #27ae60;
}

.akcja-przelaczenie {
    background: #3498db;
    color: #fff;
    border-color: #2980b9;
}

.akcja-dxf {
    background: #f39c12;
    color: #fff;
    border-color: #e67e22;
}

.akcja-manual {
    background: #9b59b6;
    color: #fff;
    border-color: #8e44ad;
}

.akcja-material {
    background: #e74c3c;
    color: #fff;
    border-color: #c0392b;
}

.akcja-wyslanie {
    background: #1abc9c;
    color: #fff;
    border-color: #16a085;
}

.akcja-upload-success {
    background: #27ae60;
    color: #fff;
    border-color: #229954;
}

.akcja-upload-error {
    background: #e74c3c;
    color: #fff;
    border-color: #c0392b;
}

.akcja-save-success {
    background: #2ecc71;
    color: #fff;
    border-color: #27ae60;
}

.akcja-save-error {
    background: #c0392b;
    color: #fff;
    border-color: #a93226;
}

.akcja-default {
    background: #95a5a6;
    color: #fff;
    border-color: #7f8c8d;
}

/* JASNY MOTYW - bardziej pastelowe kolory */
[data-theme="light"] .akcja-wejscie {
    background: #d5f4e6;
    color: #0a5e2e;
    border-color: #27ae60;
}

[data-theme="light"] .akcja-przelaczenie {
    background: #d6eaf8;
    color: #1a5490;
    border-color: #2980b9;
}

[data-theme="light"] .akcja-dxf {
    background: #fdebd0;
    color: #7d5c0c;
    border-color: #e67e22;
}

[data-theme="light"] .akcja-manual {
    background: #e8daef;
    color: #5b2c6f;
    border-color: #8e44ad;
}

[data-theme="light"] .akcja-material {
    background: #fadbd8;
    color: #7b241c;
    border-color: #c0392b;
}

[data-theme="light"] .akcja-wyslanie {
    background: #d1f2eb;
    color: #0b5345;
    border-color: #16a085;
}

[data-theme="light"] .akcja-upload-success {
    background: #d5f4e6;
    color: #0a5e2e;
    border-color: #229954;
}

[data-theme="light"] .akcja-upload-error {
    background: #fadbd8;
    color: #7b241c;
    border-color: #c0392b;
}

[data-theme="light"] .akcja-save-success {
    background: #d5f4e6;
    color: #0a5e2e;
    border-color: #27ae60;
}

[data-theme="light"] .akcja-save-error {
    background: #f5b7b1;
    color: #641e16;
    border-color: #a93226;
}

[data-theme="light"] .akcja-default {
    background: #ecf0f1;
    color: #34495e;
    border-color: #7f8c8d;
}

/* --- ZWIJANIE MENU PRAWEGO (UKŁAD) --- */
.app-container.sidebar-collapsed {
    grid-template-columns: 1fr;
}

.app-container.sidebar-collapsed .sidebar,
.main-layout.sidebar-collapsed .sidebar {
    display: none;
}