* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, sans-serif; }
body { background: #f5f6fa; color: #333; font-size: 14px; }
.container { max-width: 1300px; margin: 0 auto; padding: 20px; }
header { background: #2c3e50; color: white; padding: 12px 0; margin-bottom: 20px; }
header .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
header h1 { font-size: 18px; }
nav a { color: #ecf0f1; text-decoration: none; margin-left: 12px; font-size: 13px; padding: 4px 8px; border-radius: 4px; }
nav a:hover, nav a.active { background: #34495e; }
.station-select { background: #34495e; color: white; border: 1px solid #7f8c8d; padding: 4px 8px; border-radius: 4px; font-size: 13px; }
.card { background: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.08); margin-bottom: 20px; overflow: hidden; }
.card-header { background: #ecf0f1; padding: 10px 15px; font-weight: 600; border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center; }
.card-body { padding: 15px; }
.btn { display: inline-block; padding: 6px 12px; border: none; border-radius: 4px; cursor: pointer; text-decoration: none; font-size: 13px; }
.btn-primary { background: #3498db; color: white; }
.btn-success { background: #27ae60; color: white; }
.btn-warning { background: #f39c12; color: white; }
.btn-danger { background: #e74c3c; color: white; }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn:hover { opacity: 0.9; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f8f9fa; font-weight: 600; }
tr:hover { background: #f8f9fa; }
.form-group { margin-bottom: 12px; }
label { display: block; margin-bottom: 4px; font-weight: 500; font-size: 13px; }
input, select, textarea { width: 100%; padding: 6px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }
input:focus, select:focus { border-color: #3498db; outline: none; }
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.col { flex: 1; padding: 0 8px; min-width: 180px; }
.col-2 { flex: 0 0 16.66%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.33%; }
.col-5 { flex: 0 0 41.66%; }
.col-6 { flex: 0 0 50%; }
.col-7 { flex: 0 0 58.33%; }
.col-8 { flex: 0 0 66.66%; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-box { background: white; padding: 15px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.08); text-align: center; }
.stat-box h3 { font-size: 22px; color: #2c3e50; margin-bottom: 4px; }
.stat-box p { color: #7f8c8d; font-size: 12px; }
.alert { padding: 10px 12px; border-radius: 4px; margin-bottom: 12px; font-size: 13px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.badge { padding: 2px 6px; border-radius: 3px; font-size: 11px; font-weight: 500; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-production { background: #cce5ff; color: #004085; }
.badge-completed { background: #d4edda; color: #155724; }
.badge-cancelled { background: #f8d7da; color: #721c24; }
.badge-loading { background: #e2e3e5; color: #383d41; }
.badge-departured { background: #d1ecf1; color: #0c5460; }
.badge-arrived { background: #d4edda; color: #155724; }
.info-box { background: #e8f4fd; border-left: 4px solid #3498db; padding: 10px 12px; margin-bottom: 12px; border-radius: 0 4px 4px 0; font-size: 13px; }
.mix-detail { background: #f8f9fa; padding: 6px; border-radius: 4px; margin-top: 4px; font-size: 12px; }
.mix-detail span { display: inline-block; margin-right: 10px; }
.tabs { display: flex; gap: 5px; margin-bottom: 15px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; background: #ecf0f1; border-radius: 4px; text-decoration: none; color: #333; font-size: 13px; }
.tabs a.active { background: #3498db; color: white; }
.scroll-table { overflow-x: auto; }
@media (max-width: 768px) { .row { flex-direction: column; } .col, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8 { flex: 1 1 100%; } nav { display: flex; flex-wrap: wrap; gap: 4px; } nav a { margin: 0; font-size: 12px; } header .container { flex-direction: column; align-items: flex-start; } }

/* ===== RESPONSIVE TABLE TO CARDS ===== */
@media (max-width: 768px) {
    table.responsive-table, table.responsive-table thead, table.responsive-table tbody,
    table.responsive-table th, table.responsive-table td, table.responsive-table tr {
        display: block;
    }
    table.responsive-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    table.responsive-table tr {
        margin-bottom: 12px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: white;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
        padding: 8px;
    }
    table.responsive-table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 45% !important;
        text-align: right !important;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
    table.responsive-table td:last-child {
        border-bottom: none;
    }
    table.responsive-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 40%;
        text-align: left;
        font-weight: 600;
        color: #2c3e50;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    table.responsive-table td .btn {
        margin: 2px;
    }
}

/* ===== Low stock / debt alerts ===== */
.stat-box.stat-danger { background: #fdecea; border: 1px solid #e74c3c; }
.stat-box.stat-danger h3 { color: #c0392b; }
.row-danger td { background: #fdecea !important; }
.row-warning td { background: #fff8e1 !important; }
.badge-cancelled { background: #95a5a6; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; border: none; }
.btn-danger:hover { background: #c0392b; }
