* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 64px;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a2e;
}

.header-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #4b5563;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #eef2f7;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 32px 28px;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a1a2e;
    text-align: center;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 24px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}

.auth-tab {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: 6px;
    background: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: #fff;
    color: #1a1a2e;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.auth-form .form-group {
    margin-bottom: 14px;
}

.auth-submit {
    width: 100%;
    margin-top: 8px;
}

.muted {
    color: #9ca3af;
    font-size: 0.85rem;
}

.role-select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
}

.layout {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    background: #fff;
    border-right: 1px solid #e1e5eb;
    padding: 24px 0;
    overflow-y: auto;
    height: calc(100vh - 64px);
    position: sticky;
    top: 64px;
    transition: width 0.3s ease, min-width 0.3s ease, padding 0.3s ease;
}

.sidebar.collapsed {
    width: 60px;
    min-width: 60px;
    padding: 24px 0;
}

.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .sidebar-item span {
    display: none;
}

.sidebar.collapsed .sidebar-item {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .sidebar-nav {
    padding: 0 8px;
}

.sidebar-nav {
    padding: 0 16px;
    transition: padding 0.3s ease;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding: 0 8px;
    white-space: nowrap;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    white-space: nowrap;
}

.sidebar-item:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.sidebar-item.active {
    background: #eff6ff;
    color: #2563eb;
}

.sidebar-item.active:hover {
    background: #dbeafe;
}

.sidebar-count {
    margin-left: auto;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.sidebar-item.active .sidebar-count {
    background: #2563eb;
    color: #fff;
}

.sidebar-count.empty {
    background: #f3f4f6;
    color: #9ca3af;
}

.sidebar-item.active .sidebar-count.empty {
    background: #bfdbfe;
    color: #1d4ed8;
}

.main {
    flex: 1;
    padding: 24px;
    max-width: calc(100% - 260px);
    width: 100%;
    margin-left: auto;
    transition: max-width 0.3s ease;
}

.main.expanded {
    max-width: calc(100% - 60px);
}

.finance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-align: center;
}

.summary-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
}

.finance-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.chart-container {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.chart-container h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a2e;
}

.chart-container canvas {
    max-height: 300px;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.report-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.report-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a2e;
}

.report-card p {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 16px;
}

.report-card .btn {
    width: 100%;
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 64px;
        height: calc(100vh - 64px);
        z-index: 100;
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 260px;
        min-width: 260px;
        transform: translateX(0);
    }
    
    .sidebar.collapsed .sidebar-section-title,
    .sidebar.collapsed .sidebar-item span {
        display: block;
    }
    
    .sidebar.collapsed .sidebar-item {
        justify-content: flex-start;
        padding: 10px 12px;
    }
    
    .sidebar.collapsed .sidebar-nav {
        padding: 0 16px;
    }
    
    .main {
        max-width: 100%;
        margin-left: 0;
    }
    
    .main.expanded {
        max-width: 100%;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        width: 100%;
        height: calc(100vh - 64px);
        background: rgba(0,0,0,0.3);
        z-index: 99;
    }
    
    .sidebar-overlay.visible {
        display: block;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .main {
        padding: 16px;
    }
    
    .order-form {
        padding: 16px;
    }
    
    .search-input {
        width: 100%;
    }
    
    .list-controls {
        width: 100%;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .orders-table th:nth-child(6),
    .orders-table td:nth-child(6),
    .orders-table th:nth-child(7),
    .orders-table td:nth-child(7) {
        display: none;
    }
    
    .finance-charts {
        grid-template-columns: 1fr;
    }
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: #1a1a2e;
}

.order-form {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    max-width: 800px;
}

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

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

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #9ca3af;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-row.one-line {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.master-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.master-new-container {
    display: flex;
    gap: 8px;
}

.master-new-container input {
    flex: 1;
}

.master-new-container.hidden {
    display: none;
}

.warehouse-picker {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.warehouse-search {
    position: relative;
    flex: 1;
    min-width: 240px;
}

.warehouse-picker .qty-input {
    width: 90px;
    flex: 0 0 auto;
}

.warehouse-picker .btn {
    flex: 0 0 auto;
    width: auto;
}

.warehouse-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 260px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.warehouse-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.warehouse-item:hover {
    background: #f3f4f6;
}

.warehouse-item.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.warehouse-item-name {
    flex: 1;
}

.warehouse-item-price,
.warehouse-item-stock {
    white-space: nowrap;
}

.warehouse-item-stock {
    color: #6b7280;
    font-size: 0.85rem;
    min-width: 80px;
    text-align: right;
}

.warehouse-empty {
    padding: 10px;
    color: #6b7280;
    font-size: 0.9rem;
}

.order-parts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.order-parts-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
}

.order-parts-name {
    flex: 1;
}

.order-parts-sum {
    font-weight: 600;
    white-space: nowrap;
}

#order-parts-hint {
    margin-top: 8px;
}

.master-add-panel.hidden {
    display: none;
}

.master-add-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.master-add-actions {
    display: flex;
    gap: 12px;
}

.masters-period-summary {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #6b7280;
}

.category-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.category-add-row input {
    flex: 1;
    min-width: 0;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
}

.category-remove {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.category-remove:hover {
    color: #dc2626;
}

.category-empty {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.combo {
    position: relative;
}

.combo-input {
    padding-right: 38px;
}

.combo-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    padding: 4px 6px;
    font-size: 0.9rem;
    color: #6b7280;
    cursor: pointer;
}

.combo-toggle:hover {
    color: #374151;
}

.combo-dropdown {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.combo-dropdown.open-up {
    top: auto;
    bottom: calc(100% + 4px);
}

.combo-list {
    max-height: 220px;
    overflow-y: auto;
}

.combo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

.combo-item:hover,
.combo-item.active {
    background: #eff6ff;
}

.combo-item-name {
    flex: 1;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    font-size: 0.9rem;
    color: #374151;
    cursor: pointer;
}

.combo-item-remove {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.combo-item-remove:hover {
    color: #dc2626;
}

.combo-empty {
    margin: 0;
    padding: 10px 12px;
    font-size: 0.875rem;
    color: #6b7280;
}

.combo-add {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    font: inherit;
    font-size: 0.875rem;
    color: #2563eb;
    cursor: pointer;
}

.combo-add:hover:not(:disabled) {
    background: #eff6ff;
}

.combo-add.combo-add-done {
    color: #9ca3af;
}

.category-date {
    margin-left: 8px;
    font-size: 0.75rem;
    color: #9ca3af;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

label::after {
    content: " *";
    color: #ef4444;
}

label[for="master-select"]::after,
label[for="master"]::after,
label[for="hide-zero-stock"]::after,
label[for="product-price-input"]::after,
label[for="product-stock-input"]::after,
label[for="part-stock-input"]::after,
label[for="product-delivery-input"]::after,
label[for="part-delivery-input"]::after,
label[for="product-unit-price-input"]::after,
label[for="product-total-price-input"]::after,
label[for="product-sale-price-input"]::after,
label[for="part-unit-price-input"]::after,
label[for="part-total-price-input"]::after,
label[for="computer-sale-price-input"]::after,
label[for="product-created-input"]::after {
    content: "";
}

label:not([for="serial-number"]):not([for="master"]):not([for="master-select"]):not([for="parts-price"]):not([for="products-price"]):not([for="repair-price"]):not([for="total-price"]):not([for="client-name"]):not([for="phone"]):not([for="source"]):not([for="product-type"]):not([for="product-name"]):not([for="problem"]):not([for="order-parts-search"]):not([for="order-parts-qty"]):not([for="order-extra-search"]):not([for="order-extra-qty"]):not([for="product-category-input"]):not([for="product-sku-input"]):not([for="product-price-input"]):not([for="product-sale-price-input"]):not([for="part-category-input"]):not([for="part-sku-input"]):not([for="part-price-input"]):not([for="part-stock-input"]):not([for="product-stock-input"]):not([for="hide-zero-stock"])::after {
    content: " *";
    color: #ef4444;
}

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

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

input::placeholder, textarea::placeholder {
    color: #9ca3af;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

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

.btn-secondary.active { background: #2563eb; color: #fff; border-color: #2563eb; }
    background: #e5e7eb;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.form-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    display: none;
}

.form-message.success {
    display: block;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.form-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.list-controls {
    display: flex;
    gap: 12px;
}

.search-input, .filter-select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
}

.search-input {
    width: 280px;
}

.filter-select {
    width: 180px;
    background: #fff;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-range.hidden {
    display: none;
}

.date-range-sep {
    color: #6b7280;
}

.date-input {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: #374151;
}

.table-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

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

.orders-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.orders-table tbody tr {
    transition: background 0.2s;
}

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

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

.orders-table tbody tr.catalog-summary td {
    background: #eef2f7;
    color: #374151;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 16px;
    text-align: right;
}
.orders-table tbody tr.catalog-summary td strong {
    font-weight: normal;
    color: inherit;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-accepted { background: #dbeafe; color: #1e40af; }
.status-diagnostics { background: #fef3c7; color: #92400e; }
.status-approval { background: #fce7f3; color: #9d174d; }
.status-waiting_parts { background: #fed7aa; color: #9a3412; }
.status-ready { background: #dcfce7; color: #166534; }
.status-completed { background: #e0e7ff; color: #312e81; }

.table-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #f3e8ff;
    color: #6b21a8;
    font-size: 0.75rem;
    font-weight: 500;
}

.actions-cell {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.view {
    background: #e0e7ff;
    color: #312e81;
}

.action-btn.view:hover {
    background: #c7d2fe;
}

.action-btn.edit {
    background: #dbeafe;
    color: #1e40af;
}

.action-btn.edit:hover {
    background: #bfdbfe;
}

.action-btn.delete {
    background: #fee2e2;
    color: #991b1b;
}

.action-btn.delete:hover {
    background: #fecaca;
}

.action-btn.print {
    background: #dcfce7;
    color: #166534;
}

.action-btn.print:hover {
    background: #bbf7d0;
}

.status-cell {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    user-select: none;
}

.status-cell.draft {
    background: #e5e7eb;
    color: #374151;
}

.status-cell.in_delivery {
    background: #dbeafe;
    color: #1e40af;
}

.status-cell.completed {
    background: #d1fae5;
    color: #065f46;
}

.status-cell:hover {
    opacity: 0.9;
    filter: brightness(1.1);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state.hidden {
    display: none;
}

.payroll-settings {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
    margin: 20px 0;
}

.payroll-settings .form-group {
    margin-bottom: 0;
}

.payroll-settings input[type="number"] {
    width: 120px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
}

.payroll-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.payroll-rate-input {
    width: 90px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: right;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-group {
    margin-bottom: 8px;
}

.detail-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 0.95rem;
    color: #1f2937;
}

.detail-group.full-width {
    grid-column: 1 / -1;
}

.status-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
    min-width: 160px;
}

.status-select.status-accepted { border-color: #93c5fd; background: #eff6ff; }
.status-select.status-diagnostics { border-color: #fcd34d; background: #fefce8; }
.status-select.status-approval { border-color: #f9a8d4; background: #fdf2f8; }
.status-select.status-waiting_parts { border-color: #fdba74; background: #fff7ed; }
.status-select.status-ready { border-color: #86efac; background: #f0fdf4; }
.status-select.status-completed { border-color: #a5b4fc; background: #eef2ff; }

th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th.sortable:hover {
    background: #f3f4f6;
}

th.sortable[data-dir='asc']::after {
    content: ' \25B2';
    font-size: 0.65em;
    color: #6b7280;
}

th.sortable[data-dir='desc']::after {
    content: ' \25BC';
    font-size: 0.65em;
    color: #6b7280;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .main {
        padding: 16px;
    }

    .order-form {
        padding: 16px;
    }

    .search-input {
        width: 100%;
    }

    .list-controls {
        width: 100%;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .orders-table th:nth-child(6),
    .orders-table td:nth-child(6),
    .orders-table th:nth-child(7),
    .orders-table td:nth-child(7) {
        display: none;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.25rem;
    }

    .sidebar-toggle {
        width: 36px;
        height: 36px;
    }

    .orders-table {
        font-size: 0.8rem;
    }

    .orders-table th,
    .orders-table td {
        padding: 10px 8px;
    }
}