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

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

/* Navbar */
.navbar {
    background: #1a1a2e;
    color: #fff;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-brand a {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
}

.nav-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    margin-left: 24px;
    font-size: 14px;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    border-bottom-color: #4361ee;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Dashboard header */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-header h1 {
    font-size: 24px;
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.badge-new {
    background: #4361ee;
    color: #fff;
}

/* Filters */
.filters {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 14px;
    border-radius: 16px;
    text-decoration: none;
    font-size: 13px;
    color: #666;
    background: #fff;
    border: 1px solid #ddd;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #4361ee;
    color: #4361ee;
}

.filter-btn.active {
    background: #4361ee;
    color: #fff;
    border-color: #4361ee;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.orders-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
    white-space: nowrap;
}

.orders-table td {
    padding: 10px 12px;
    border-top: 1px solid #eee;
    font-size: 14px;
}

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

.nowrap {
    white-space: nowrap;
}

.address-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-row {
    text-align: center;
    color: #999;
    padding: 40px !important;
}

/* Status */
.status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-new { background: #e3f2fd; color: #1565c0; }
.status-calculated { background: #e8f5e9; color: #2e7d32; }
.status-confirmed { background: #fff3e0; color: #e65100; }
.status-delivering { background: #fce4ec; color: #c62828; }
.status-completed { background: #e8f5e9; color: #1b5e20; }
.status-cancelled { background: #f5f5f5; color: #757575; }
.status-error { background: #ffebee; color: #c62828; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
}

.btn-primary { background: #4361ee; color: #fff; }
.btn-primary:hover { background: #3a56d4; }
.btn-success { background: #2e7d32; color: #fff; }
.btn-success:hover { background: #256b29; }
.btn-danger { background: #c62828; color: #fff; }
.btn-danger:hover { background: #b71c1c; }
.btn-outline { background: #fff; color: #333; border: 1px solid #ddd; }
.btn-outline:hover { border-color: #4361ee; color: #4361ee; }
.btn-full { width: 100%; }

.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; }

/* Forms */
.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

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

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

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #1a1a2e;
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    width: 360px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.login-card h1 {
    font-size: 24px;
    margin-bottom: 4px;
}

.login-card h2 {
    font-size: 14px;
    color: #999;
    font-weight: 400;
    margin-bottom: 24px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error { background: #ffebee; color: #c62828; }
.alert-success { background: #e8f5e9; color: #2e7d32; }
.alert-info { background: #e3f2fd; color: #1565c0; }

/* Detail page */
.detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

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

.detail-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.detail-card h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
}

.detail-row .label {
    color: #999;
    font-size: 13px;
}

.detail-row .price {
    font-weight: 600;
    color: #2e7d32;
    font-size: 18px;
}

.error-row span:last-child {
    color: #c62828;
}

.detail-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.action-result {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 14px;
}

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

.options-table th,
.options-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

/* Calculator */
.calc-container {
    max-width: 600px;
}

.advanced-params {
    margin-bottom: 16px;
    background: #fff;
    border-radius: 8px;
    padding: 12px 16px;
}

.advanced-params summary {
    cursor: pointer;
    color: #4361ee;
    font-size: 14px;
}

.calc-result {
    margin-top: 24px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.calc-result h3 {
    margin-bottom: 12px;
}

.offer-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 8px;
}

.offer-card .offer-type {
    font-weight: 500;
}

.offer-card .offer-price {
    font-size: 18px;
    font-weight: 600;
    color: #2e7d32;
}

/* Modal */
.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: 100;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 440px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

/* Pagination */
.pagination {
    text-align: center;
    padding: 16px;
    color: #999;
    font-size: 14px;
}

/* Loading */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 12px; }
    .dashboard-header { flex-direction: column; align-items: flex-start; }
    .navbar { padding: 0 12px; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-actions { flex-wrap: wrap; }
    .modal-content { width: 95%; margin: 0 10px; }
}
