:root {
    --primary: #f46b27;
    --primary-dark: #d85a1b;
    --primary-light: #fff3ec;
    --accent: #ff5500;
    --danger: #d32f2f;
    --danger-light: #fce4e4;
    --warning: #f5a623;
    --warning-light: #fef6e6;
    --success: #2e7d32;
    --success-light: #e8f5e9;
    --bg: #f3f3f3;
    --card: #ffffff;
    --text: #222222;
    --text-secondary: #555555;
    --muted: #888888;
    --border: #cccdce;
    --border-light: #e5e5e5;
    --header-bg: #333333;
}

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

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}

/* === LAYOUT === */

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.25rem;
}

/* === HEADER === */

.header {
    background: var(--header-bg);
    color: white;
    padding: 0;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-brand .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: white;
}

.header h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.header .subtitle {
    font-size: 0.8rem;
    color: #aaaaaa;
    font-weight: 400;
}

.header-nav {
    display: flex;
    gap: 0.25rem;
}

.header-nav a {
    padding: 0.5rem 0.875rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #cccccc;
    text-decoration: none;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.header-nav a:hover {
    color: white;
    background: rgba(255,255,255,0.08);
}

.header-nav a.active {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
}

/* === CARDS === */

.card {
    background: var(--card);
    border-radius: 6px;
    border: 1px solid var(--border);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid var(--primary);
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* === TABLES === */

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

th, td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #fafafa;
}

tr:hover {
    background: #fafafa;
}

/* === BADGES === */

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge-warning {
    background: var(--warning-light);
    color: #8a6100;
    border: 1px solid #f0d58c;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid #a5d6a7;
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #ef9a9a;
}

/* === BUTTONS === */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.125rem;
    border: none;
    border-radius: 4px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1.4;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(244,107,39,0.25);
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 4px rgba(46,125,50,0.2);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
}

/* === FORMS === */

.form-group { margin-bottom: 0.875rem; }

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
    background: white;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(244,107,39,0.1);
}

/* === SUMMARY BAR === */

.summary-bar {
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.summary-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.125rem;
    flex: 1;
    min-width: 160px;
    border-top: 3px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.summary-item .label {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.summary-item .value {
    font-size: 1.35rem;
    font-weight: 800;
    margin-top: 0.25rem;
    color: var(--text);
}

/* === AMOUNTS === */

.amount { font-family: 'Segoe UI', Roboto, monospace; font-weight: 700; }
.amount-positive { color: var(--success); }
.amount-negative { color: var(--danger); }

/* === ORDER CARDS (dispatch) === */

.order-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 1rem;
    margin: 0.625rem 0;
    border-left: 4px solid var(--primary);
    transition: box-shadow 0.15s;
}

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

.order-card.assigned {
    border-left-color: var(--success);
}

.order-card .order-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.order-card .order-meta {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 0.25rem;
}

.order-card .order-specs {
    font-size: 0.85rem;
    margin-top: 0.375rem;
}

.order-card .order-money {
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-weight: 600;
}

/* === MODAL === */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 100;
    overflow-y: auto;
    backdrop-filter: blur(2px);
}

.modal-content {
    max-width: 620px;
    margin: 2rem auto;
    background: white;
    border-radius: 8px;
    padding: 1.75rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.modal-content h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
}

.modal-section {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    margin: 1rem 0 0.5rem;
}

/* === BRIGADE PANEL === */

.brigade-item {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

.brigade-item strong {
    color: var(--text);
}

.brigade-item .brigade-skills {
    color: var(--muted);
    font-size: 0.78rem;
}

.brigade-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.625rem 0;
}

.brigade-section-title.free { color: var(--success); }
.brigade-section-title.busy { color: var(--muted); margin-top: 0.625rem; }

/* === RESPONSIVE === */

@media (max-width: 768px) {
    .container { padding: 0.75rem; }

    .header-inner {
        flex-direction: column;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .header-nav { width: 100%; justify-content: center; }

    table { font-size: 0.78rem; }
    th, td { padding: 0.4rem 0.5rem; }

    .summary-bar { flex-direction: column; gap: 0.5rem; }
    .summary-item { min-width: auto; }

    .modal-content { margin: 1rem 0.5rem; padding: 1.25rem; }

    .btn { padding: 0.45rem 0.875rem; font-size: 0.8rem; }
}

@media (max-width: 480px) {
    .header h1 { font-size: 1rem; }
    .summary-item .value { font-size: 1.1rem; }
}
