/* Reset & Base */
@import url('sidebar.css');

* {
    box-sizing: border-box;
}

body,
body * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23333" d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/></svg>') 3 3, auto !important;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    color: #1f2937;
    font-size: 14px;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
    margin-left: 0; /* Sidebar is sticky or fixed */
}

/* Sidebar Adjustment if needed */
.panel-sidebar {
    flex-shrink: 0;
    width: 280px;
    width: var(--sidebar-width, 280px);
}

/* Calculator Wrapper */
.calculator-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background-color: #ffffff;
    padding: 20px 32px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-title h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #111827;
    letter-spacing: -0.01em;
}

.header-title p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.header-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Week Controls */
.week-controls {
    display: flex;
    align-items: center;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 2px;
}

.btn-nav {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #6b7280;
    border-radius: 4px;
    font-size: 14px;
}

.btn-nav:hover {
    background-color: #e5e7eb;
    color: #374151;
}

.week-label {
    padding: 0 12px;
    font-weight: 500;
    color: #374151;
    min-width: 100px;
    text-align: center;
}

/* Controls */
.product-select {
    padding: 9px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background-color: #fff;
    min-width: 250px;
    transition: border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.product-select:hover {
    border-color: #9ca3af;
}

.product-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
    background-color: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Main Table */
.table-container {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden; /* For rounded corners */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 24px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.data-table tbody tr:hover {
    background-color: #f9fafb;
}

.saturday-row {
    background-color: #fcfdfd;
}

.sunday-row {
    background-color: #f3f4f6; /* Wyraźniejsze oznaczenie niedzieli */
}

/* Table Cells */
.production-cell {
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
}

.production-cell:hover {
    background-color: #eff6ff;
}

.production-manual {
    font-weight: 600;
    color: #1e40af;
}

.manual-icon {
    font-size: 10px;
    color: #93c5fd;
    margin-left: 6px;
    vertical-align: top;
}

.reservations-cell {
    min-width: 250px;
}

.stock-cell {
    font-weight: 600;
}

.stock-value {
    display: inline-block;
}

.btn-add-order {
    background: none;
    border: 1px dashed #d1d5db;
    color: #9ca3af;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

.btn-add-order:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background-color: #eff6ff;
}

/* Orders List inside table */
.orders-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
    width: calc(100% - 40px);
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 13px;
    background-color: #f3f4f6;
    border: 1px solid transparent;
    transition: opacity 0.15s ease, transform 0.15s ease, max-height 0.15s ease, margin 0.15s ease, padding 0.15s ease;
    opacity: 1;
    transform: translateY(0);
    max-height: 100px;
    overflow: hidden;
    gap: 8px;
}

.order-item.order-unfulfillable {
    background-color: #fee2e2 !important;
    border-color: #fecaca !important;
}

.order-item.order-unfulfillable.status-do-realizacji {
    background-color: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

.order-priority-controls {
    display: flex;
    flex-direction: row;
    gap: 2px;
    flex-shrink: 0;
}

.priority-up-btn,
.priority-down-btn {
    background: none;
    border: 1px solid #d1d5db;
    color: #6b7280;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    padding: 0;
    transition: all 0.15s;
}

.priority-up-btn:hover:not(:disabled),
.priority-down-btn:hover:not(:disabled) {
    border-color: #3b82f6;
    color: #3b82f6;
    background-color: #eff6ff;
}

.priority-up-btn:disabled,
.priority-down-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.fulfillable-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 14px;
    cursor: help;
}

.order-item.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.order-item.fade-in {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.25s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-item:last-child {
    margin-bottom: 0;
}

.order-item.status-zrealizowane {
    background-color: #ecfdf5;
    color: #065f46;
    border-color: #d1fae5;
    text-decoration: line-through;
    opacity: 0.7;
}

.order-item.status-do-realizacji {
    background-color: #fff7ed;
    color: #9a3412;
    border-color: #ffedd5;
}

.order-item.order-warning {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fca5a5 !important;
}

.order-item.order-warning.status-zrealizowane {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fca5a5 !important;
    opacity: 0.8;
}

.btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-icon:disabled:hover {
    color: #6b7280;
}

.order-info {
    display: flex;
    gap: 8px;
}

.order-client {
    font-weight: 500;
}

.order-actions {
    display: flex;
    gap: 4px;
    opacity: 0; /* Show on hover */
    transition: opacity 0.2s;
}

.order-item:hover .order-actions {
    opacity: 1;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
    color: #6b7280;
}

.btn-icon:hover {
    color: #111827;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.summary-card {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.summary-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.summary-card h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.summary-item span {
    color: #6b7280;
}

.summary-item strong {
    color: #111827;
    font-weight: 600;
}

/* Week Orders List in Summary */
.orders-content {
    max-height: 150px;
    overflow-y: auto;
}

.order-list-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.order-list-item:last-child {
    border-bottom: none;
}

.order-list-info {
    display: flex;
    flex-direction: column;
}

.order-list-client {
    font-weight: 500;
    color: #1f2937;
}

.order-list-date {
    font-size: 11px;
    color: #9ca3af;
}

.order-list-qty {
    font-weight: 600;
    color: #4b5563;
}

.no-orders {
    color: #9ca3af;
    font-style: italic;
    font-size: 13px;
    display: block;
    padding: 8px 0;
}

/* Chart Card */
.chart-card {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.chart-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.chart-card h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
}

.chart-wrapper {
    height: 300px;
    width: 100%;
}

/* Modals - Professional CRM Style */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal.is-open {
    display: flex;
}

.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 800px;
    max-height: 96vh;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: max-width 0.3s ease-in-out;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.modal-content.modal-expanded {
    max-width: 1150px;
}


.modal-content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

#newOrderPanel .modal-body {
    overflow-y: visible;
    overflow: visible;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f9fafb;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    min-height: 64px;
}

.modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.01em;
}

.modal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
    border-radius: 4px;
}

.btn-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.btn-save {
    background: #111827;
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: background-color 0.15s;
    height: 36px;
}

.btn-save:hover {
    background: #1f2937;
}

.btn-delete {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-size: 14px;
    height: 36px;
}

.btn-delete:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

.btn-icon {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 36px;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
}

.btn-icon:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

#newOrderPanel .modal-content-wrapper {
    overflow: hidden;
}

#newOrderPanel .modal-body {
    overflow-y: visible !important;
    overflow: visible !important;
    max-height: none;
}

/* Custom Packing Panel */
.custom-packing-panel {
    width: 0;
    overflow: hidden;
    background: #f9fafb;
    border-left: 2px solid #e5e7eb;
    transition: width 0.3s ease-in-out;
    flex-shrink: 0;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
}

.custom-packing-panel.panel-open {
    width: 350px;
    border-left: 2px solid #d1d5db;
}

.custom-packing-content {
    padding: 24px;
    height: 100%;
    overflow-y: auto;
    min-width: 350px;
    background: #ffffff;
}

.custom-packing-content h4 {
    margin: 0 0 24px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 12px;
    letter-spacing: -0.01em;
}

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

.custom-packing-content .form-group:last-child {
    margin-bottom: 0;
}

.custom-packing-content .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.custom-packing-content .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.custom-packing-content .form-group input:hover {
    border-color: #9ca3af;
}

.custom-packing-content .form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.custom-packing-content .form-group input::placeholder {
    color: #9ca3af;
}

/* Order Modal Styles */
.order-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.order-modal.is-open {
    display: flex;
}

.order-modal-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.order-modal-container {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 20px;
}

.order-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.order-modal-title h2 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.order-modal-title p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.order-modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s;
}

.order-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.order-modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.order-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.order-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.order-form-group label i {
    color: #6b7280;
    font-size: 12px;
}

.order-form-group .required {
    color: #ef4444;
    margin-left: 2px;
}

.order-form-group input,
.order-form-group select,
.order-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.15s;
    background: #ffffff;
    color: #111827;
}

.order-form-group input:hover,
.order-form-group select:hover,
.order-form-group textarea:hover {
    border-color: #9ca3af;
}

.order-form-group input:focus,
.order-form-group select:focus,
.order-form-group textarea:focus {
    outline: none;
    border-color: #3F7432;
    box-shadow: 0 0 0 3px rgba(63, 116, 50, 0.1);
}

.order-form-section {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.order-form-section-header {
    margin-bottom: 16px;
}

.order-form-section-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-form-section-header h3 i {
    color: #3F7432;
    font-size: 14px;
}

.order-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.15s;
}

.order-checkbox-label:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.order-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3F7432;
    margin: 0;
}

.order-checkbox-label span {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0;
}

.order-custom-packing {
    margin-top: 16px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.order-atp-result {
    margin-top: 8px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.order-atp-result .atp-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.order-atp-result .atp-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.order-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.order-modal-footer-right {
    display: flex;
    gap: 12px;
}

.order-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.order-btn-primary {
    background: #3F7432;
    color: #ffffff;
}

.order-btn-primary:hover {
    background: #2d5a24;
}

.order-btn-secondary {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.order-btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.order-btn-danger {
    background: #ffffff;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.order-btn-danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

@media (max-width: 768px) {
    .order-form-row {
        grid-template-columns: 1fr;
    }
    
    .order-modal-container {
        margin: 10px;
        max-height: 95vh;
    }
    
    .order-modal-header,
    .order-modal-body,
    .order-modal-footer {
        padding: 20px;
    }
    
    .order-modal-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .order-modal-footer-right {
        width: 100%;
        flex-direction: column;
    }
    
    .order-btn {
        width: 100%;
        justify-content: center;
    }
}

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
    background: #ffffff;
    color: #111827;
    line-height: 1.5;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #9ca3af;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #111827;
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Custom Packing Section Animation */
#customPackingSection,
#editCustomPackingSection {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

#customPackingSection[style*="display: block"],
#editCustomPackingSection[style*="display: block"] {
    opacity: 1;
}

.form-row {
    display: grid;
    gap: 16px;
}

/* ATP Check Result */
.atp-feedback {
    margin-top: 16px;
    padding: 0;
    border-radius: 0;
    font-size: 0;
}

.atp-success {
    color: #065f46;
    background: #d1fae5;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #6ee7b7;
}

.atp-error {
    color: #991b1b;
    background: #fee2e2;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #fca5a5;
}

/* Notification */
#notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background-color: #fff;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    padding: 16px;
    border-radius: 4px;
    min-width: 300px;
    display: flex;
    justify-content: space-between;
    align-items: start;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.notification.show {
    transform: translateX(0);
}

.notification-success { border-left-color: #10b981; }
.notification-error { border-left-color: #ef4444; }

.notification-content h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #111827;
}

.notification-content p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-style: italic;
}

.btn-add-order {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

.btn-add-order:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background-color: #eff6ff;
}

/* Orders List inside table */
.orders-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
    width: calc(100% - 40px);
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 13px;
    background-color: #f3f4f6;
    border: 1px solid transparent;
    transition: opacity 0.15s ease, transform 0.15s ease, max-height 0.15s ease, margin 0.15s ease, padding 0.15s ease;
    opacity: 1;
    transform: translateY(0);
    max-height: 100px;
    overflow: hidden;
    gap: 8px;
}

.order-item.order-unfulfillable {
    background-color: #fee2e2 !important;
    border-color: #fecaca !important;
}

.order-item.order-unfulfillable.status-do-realizacji {
    background-color: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

.order-priority-controls {
    display: flex;
    flex-direction: row;
    gap: 2px;
    flex-shrink: 0;
}

.priority-up-btn,
.priority-down-btn {
    background: none;
    border: 1px solid #d1d5db;
    color: #6b7280;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    padding: 0;
    transition: all 0.15s;
}

.priority-up-btn:hover:not(:disabled),
.priority-down-btn:hover:not(:disabled) {
    border-color: #3b82f6;
    color: #3b82f6;
    background-color: #eff6ff;
}

.priority-up-btn:disabled,
.priority-down-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.fulfillable-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 14px;
    cursor: help;
}

.order-item.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.order-item.fade-in {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.25s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-item:last-child {
    margin-bottom: 0;
}

.order-item.status-zrealizowane {
    background-color: #ecfdf5;
    color: #065f46;
    border-color: #d1fae5;
    text-decoration: line-through;
    opacity: 0.7;
}

.order-item.status-do-realizacji {
    background-color: #fff7ed;
    color: #9a3412;
    border-color: #ffedd5;
}

.order-item.order-warning {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fca5a5 !important;
}

.order-item.order-warning.status-zrealizowane {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fca5a5 !important;
    opacity: 0.8;
}

.btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-icon:disabled:hover {
    color: #6b7280;
}

.order-info {
    display: flex;
    gap: 8px;
}

.order-client {
    font-weight: 500;
}

.order-actions {
    display: flex;
    gap: 4px;
    opacity: 0; /* Show on hover */
    transition: opacity 0.2s;
}

.order-item:hover .order-actions {
    opacity: 1;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
    color: #6b7280;
}

.btn-icon:hover {
    color: #111827;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.summary-card {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.summary-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.summary-card h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.summary-item span {
    color: #6b7280;
}

.summary-item strong {
    color: #111827;
    font-weight: 600;
}

/* Week Orders List in Summary */
.orders-content {
    max-height: 150px;
    overflow-y: auto;
}

.order-list-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.order-list-item:last-child {
    border-bottom: none;
}

.order-list-info {
    display: flex;
    flex-direction: column;
}

.order-list-client {
    font-weight: 500;
    color: #1f2937;
}

.order-list-date {
    font-size: 11px;
    color: #9ca3af;
}

.order-list-qty {
    font-weight: 600;
    color: #4b5563;
}

.no-orders {
    color: #9ca3af;
    font-style: italic;
    font-size: 13px;
    display: block;
    padding: 8px 0;
}

/* Chart Card */
.chart-card {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.chart-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.chart-card h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
}

.chart-wrapper {
    height: 300px;
    width: 100%;
}

/* Modals - Professional CRM Style */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal.is-open {
    display: flex;
}

.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 800px;
    max-height: 96vh;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: max-width 0.3s ease-in-out;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.modal-content.panel-expanded {
    max-width: 1150px;
}

.modal-content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

#newOrderPanel .modal-body {
    overflow-y: visible;
    overflow: visible;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f9fafb;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    min-height: 64px;
}

.modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.01em;
}

.modal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
    border-radius: 4px;
}

.btn-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.btn-save {
    background: #111827;
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: background-color 0.15s;
    height: 36px;
}

.btn-save:hover {
    background: #1f2937;
}

.btn-delete {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-size: 14px;
    height: 36px;
}

.btn-delete:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

.btn-icon {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 36px;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
}

.btn-icon:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

#newOrderPanel .modal-content-wrapper {
    overflow: hidden;
}

#newOrderPanel .modal-body {
    overflow-y: visible !important;
    overflow: visible !important;
    max-height: none;
}

/* Custom Packing Panel */
.custom-packing-panel {
    width: 0;
    overflow: hidden;
    background: #f9fafb;
    border-left: 2px solid #e5e7eb;
    transition: width 0.3s ease-in-out;
    flex-shrink: 0;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
}

.custom-packing-panel.panel-open {
    width: 350px;
    border-left: 2px solid #d1d5db;
}

.custom-packing-content {
    padding: 24px;
    height: 100%;
    overflow-y: auto;
    min-width: 350px;
    background: #ffffff;
}

.custom-packing-content h4 {
    margin: 0 0 24px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 12px;
    letter-spacing: -0.01em;
}

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

.custom-packing-content .form-group:last-child {
    margin-bottom: 0;
}

.custom-packing-content .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.custom-packing-content .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.custom-packing-content .form-group input:hover {
    border-color: #9ca3af;
}

.custom-packing-content .form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.custom-packing-content .form-group input::placeholder {
    color: #9ca3af;
}

/* Order Modal Styles */
.order-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.order-modal.is-open {
    display: flex;
}

.order-modal-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.order-modal-container {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 20px;
}

.order-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.order-modal-title h2 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.order-modal-title p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.order-modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s;
}

.order-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.order-modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.order-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.order-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.order-form-group label i {
    color: #6b7280;
    font-size: 12px;
}

.order-form-group .required {
    color: #ef4444;
    margin-left: 2px;
}

.order-form-group input,
.order-form-group select,
.order-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.15s;
    background: #ffffff;
    color: #111827;
}

.order-form-group input:hover,
.order-form-group select:hover,
.order-form-group textarea:hover {
    border-color: #9ca3af;
}

.order-form-group input:focus,
.order-form-group select:focus,
.order-form-group textarea:focus {
    outline: none;
    border-color: #3F7432;
    box-shadow: 0 0 0 3px rgba(63, 116, 50, 0.1);
}

.order-form-section {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.order-form-section-header {
    margin-bottom: 16px;
}

.order-form-section-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-form-section-header h3 i {
    color: #3F7432;
    font-size: 14px;
}

.order-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.15s;
}

.order-checkbox-label:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.order-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3F7432;
    margin: 0;
}

.order-checkbox-label span {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0;
}

.order-custom-packing {
    margin-top: 16px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.order-atp-result {
    margin-top: 8px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.order-atp-result .atp-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.order-atp-result .atp-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.order-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.order-modal-footer-right {
    display: flex;
    gap: 12px;
}

.order-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.order-btn-primary {
    background: #3F7432;
    color: #ffffff;
}

.order-btn-primary:hover {
    background: #2d5a24;
}

.order-btn-secondary {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.order-btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.order-btn-danger {
    background: #ffffff;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.order-btn-danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

@media (max-width: 768px) {
    .order-form-row {
        grid-template-columns: 1fr;
    }
    
    .order-modal-container {
        margin: 10px;
        max-height: 95vh;
    }
    
    .order-modal-header,
    .order-modal-body,
    .order-modal-footer {
        padding: 20px;
    }
    
    .order-modal-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .order-modal-footer-right {
        width: 100%;
        flex-direction: column;
    }
    
    .order-btn {
        width: 100%;
        justify-content: center;
    }
}

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
    background: #ffffff;
    color: #111827;
    line-height: 1.5;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #9ca3af;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #111827;
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Custom Packing Section Animation */
#customPackingSection,
#editCustomPackingSection {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

#customPackingSection[style*="display: block"],
#editCustomPackingSection[style*="display: block"] {
    opacity: 1;
}

.form-row {
    display: grid;
    gap: 16px;
}

/* ATP Check Result */
.atp-feedback {
    margin-top: 16px;
    padding: 0;
    border-radius: 0;
    font-size: 0;
}

.atp-success {
    color: #065f46;
    background: #d1fae5;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #6ee7b7;
}

.atp-error {
    color: #991b1b;
    background: #fee2e2;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #fca5a5;
}

/* Notification */
#notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background-color: #fff;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    padding: 16px;
    border-radius: 4px;
    min-width: 300px;
    display: flex;
    justify-content: space-between;
    align-items: start;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.notification.show {
    transform: translateX(0);
}

.notification-success { border-left-color: #10b981; }
.notification-error { border-left-color: #ef4444; }

.notification-content h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #111827;
}

.notification-content p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

/* Enhanced Order Modal Styles (Unified for Calculator & Orders List) */
#newOrderPanel .modal-content,
#orderDetailsModal .modal-content,
#newOrderModal .modal-content,
#editOrderModal .modal-content {
    flex-direction: column !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25) !important;
    transition: max-width 0.3s ease-in-out !important;
    background: #ffffff !important;
    max-width: 800px;
    width: 100% !important;
}

#newOrderPanel .modal-content.modal-expanded,
#orderDetailsModal .modal-content.modal-expanded,
#newOrderModal .modal-content.modal-expanded,
#editOrderModal .modal-content.modal-expanded {
    max-width: 1200px !important;
}

#newOrderPanel .modal-header,
#orderDetailsModal .modal-header,
#newOrderModal .modal-header,
#editOrderModal .modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 24px 32px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    min-height: 72px !important;
}

#newOrderPanel .modal-header h3,
#orderDetailsModal .modal-header h3,
#newOrderModal .modal-header h3,
#editOrderModal .modal-header h3 {
    margin: 0 !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #111827 !important;
}

#newOrderPanel .modal-body-container,
#orderDetailsModal .modal-body-container,
#newOrderModal .modal-body-container,
#editOrderModal .modal-body-container {
    display: flex !important;
    flex-direction: row !important;
    flex: 1 !important;
    overflow: hidden !important;
}

#newOrderPanel .modal-body-main,
#orderDetailsModal .modal-body-main,
#newOrderModal .modal-body-main,
#editOrderModal .modal-body-main {
    flex: 1 !important;
    padding: 32px !important;
    overflow-y: auto !important;
    min-width: 0 !important;
}

#newOrderPanel .modal-body-packing,
#orderDetailsModal .modal-body-packing,
#newOrderModal .modal-body-packing,
#editOrderModal .modal-body-packing {
    width: 0 !important;
    overflow: hidden !important;
    background: #f9fafb !important;
    border-left: 1px solid #e5e7eb !important;
    transition: width 0.3s ease-in-out !important;
    flex-shrink: 0 !important;
}

#newOrderPanel .modal-content.modal-expanded .modal-body-packing,
#orderDetailsModal .modal-content.modal-expanded .modal-body-packing,
#newOrderModal .modal-content.modal-expanded .modal-body-packing,
#editOrderModal .modal-content.modal-expanded .modal-body-packing {
    width: 350px !important;
    display: block !important;
}

#newOrderPanel .packing-column-content,
#orderDetailsModal .packing-column-content,
#newOrderModal .packing-column-content,
#editOrderModal .packing-column-content {
    padding: 32px !important;
    height: 100% !important;
    overflow-y: auto !important;
}

#newOrderPanel .modal-body-packing .form-section-title,
#orderDetailsModal .modal-body-packing .form-section-title,
#newOrderModal .modal-body-packing .form-section-title,
#editOrderModal .modal-body-packing .form-section-title {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #6b7280 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 24px !important;
    padding-bottom: 12px !important;
    border-bottom: 2px solid #e5e7eb !important;
}

/* Common form elements in modals */
#newOrderPanel .form-group label,
#orderDetailsModal .form-group label,
#newOrderModal .form-group label,
#editOrderModal .form-group label {
    display: block !important;
    margin-bottom: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #374151 !important;
}

#newOrderPanel .form-group input:not([type="checkbox"]),
#orderDetailsModal .form-group input:not([type="checkbox"]),
#newOrderModal .form-group input:not([type="checkbox"]),
#editOrderModal .form-group input:not([type="checkbox"]),
#newOrderPanel select,
#orderDetailsModal select,
#newOrderModal select,
#editOrderModal select,
#newOrderPanel textarea,
#orderDetailsModal textarea,
#newOrderModal textarea,
#editOrderModal textarea {
    width: 100% !important;
    padding: 11px 14px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    color: #111827 !important;
    background: #ffffff !important;
    transition: all 0.2s !important;
}

#newOrderPanel .form-group input:focus,
#orderDetailsModal .form-group input:focus,
#newOrderModal .form-group input:focus,
#editOrderModal .form-group input:focus,
#newOrderPanel select:focus,
#orderDetailsModal select:focus,
#newOrderModal select:focus,
#editOrderModal select:focus,
#newOrderPanel textarea:focus,
#orderDetailsModal textarea:focus,
#newOrderModal textarea:focus,
#editOrderModal textarea:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

#newOrderPanel .btn-save,
#orderDetailsModal .btn-save,
#newOrderModal .btn-save,
#editOrderModal .btn-save {
    background: #2563eb !important;
    color: #fff !important;
    padding: 10px 24px !important;
    border-radius: 6px !important;
    height: 40px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    border: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s !important;
}

#newOrderPanel .btn-save:hover,
#orderDetailsModal .btn-save:hover,
#newOrderModal .btn-save:hover,
#editOrderModal .btn-save:hover {
    background: #1d4ed8 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-1px) !important;
}

#newOrderPanel .btn-close,
#orderDetailsModal .btn-close,
#newOrderModal .btn-close,
#editOrderModal .btn-close {
    background: transparent !important;
    border: none !important;
    font-size: 18px !important;
    color: #6b7280 !important;
    cursor: pointer !important;
    padding: 8px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
}

#newOrderPanel .btn-close:hover,
#orderDetailsModal .btn-close:hover,
#newOrderModal .btn-close:hover,
#editOrderModal .btn-close:hover {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

#newOrderPanel .checkbox-label,
#orderDetailsModal .checkbox-label,
#newOrderModal .checkbox-label,
#editOrderModal .checkbox-label {
    display: flex !important;
    align-items: center !important;
    padding: 14px 16px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    gap: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

#newOrderPanel .checkbox-label:hover,
#orderDetailsModal .checkbox-label:hover,
#newOrderModal .checkbox-label:hover,
#editOrderModal .checkbox-label:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

/* Custom Autocomplete / Search styles */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.autocomplete-results.is-visible {
    display: block;
}

.autocomplete-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.15s;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f8fafc;
    color: #2563eb;
    padding-left: 20px;
}

.autocomplete-item i {
    color: #94a3b8;
    font-size: 12px;
}

.autocomplete-item:hover i {
    color: #2563eb;
}

.autocomplete-no-results {
    padding: 12px 16px;
    font-size: 14px;
    color: #64748b;
    text-align: center;
    font-style: italic;
}

/* Custom scrollbar for dropdown */
.autocomplete-results::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-results::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.autocomplete-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.autocomplete-results::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Multi-order position styles - Clean UI Refresh */
.order-positions-container {
    margin-top: 15px;
}

.order-position-row {
    padding: 24px 0;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    transition: all 0.2s;
}

.order-position-row:last-child {
    border-bottom: none;
}

.order-position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.order-position-title {
    font-weight: 600;
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-remove-position {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove-position:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fee2e2;
}

.btn-add-position {
    width: 100%;
    padding: 14px;
    background: #ffffff;
    color: #2563eb;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-add-position:hover {
    border-color: #2563eb;
    background: #f8faff;
}

.multi-order-client-section {
    padding: 0 0 20px 0;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 10px;
}

.item-custom-packing-section {
    margin-top: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.packing-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
    margin-bottom: 10px;
}

.packing-toggle-label input {
    width: 14px;
    height: 14px;
}
