/* =========================================================
   SLW Cargo Accounts System - Master Design System & Styles
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: #f1f5f9;
    color: #1e293b;
    min-height: 100vh;
}

.acc-container {
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 230px;
    height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    color: white;
    position: fixed;
    transition: all 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    z-index: 1000;
}

.sidebar .logo {
    padding: 20px 16px;
    text-align: center;
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .logo h2 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.sidebar .menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar .menu li {
    margin: 3px 8px;
}

.sidebar .menu li a {
    color: #c7d2fe;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 600;
}

.sidebar .menu li a i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.sidebar .menu li a:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #ffffff;
    padding-left: 18px;
}

.sidebar .menu li a.active {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Main Content */
.main-content {
    margin-left: 230px;
    width: calc(100% - 230px);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    background: white;
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar .toggle-btn {
    font-size: 20px;
    cursor: pointer;
    color: #475569;
    display: none;
}

.acc-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.acc-user a {
    color: #ef4444;
    text-decoration: none;
    font-size: 13px;
}

.content {
    padding: 28px;
    flex: 1;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
}

.muted {
    color: #64748b;
    font-size: 14px;
    margin-top: 2px;
}

/* Grid & Cards */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    display: flex;
    gap: 16px;
    align-items: center;
    transition: transform 0.25s, box-shadow 0.25s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1 0%, #4338ca 100%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    flex-shrink: 0;
}

.stat-num {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.stat-lbl {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    margin-top: 4px;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.btn-outline {
    background: white;
    color: #4f46e5;
    border: 1.5px solid #e2e8f0;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #6366f1;
}

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

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

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

/* Forms */
.card-form {
    background: white;
    padding: 28px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    max-width: 800px;
}

.card-form label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.card-form input,
.card-form select,
.card-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    background: #f8fafc;
    transition: border 0.2s;
    font-size: 14px;
    margin-bottom: 14px;
}

.card-form input:focus,
.card-form select:focus,
.card-form textarea:focus {
    border-color: #6366f1;
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Tables */
.table-wrap {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

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

table.acc-table th {
    background: #0f172a;
    color: white;
    text-align: left;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

table.acc-table td {
    padding: 14px 16px;
    border-top: 1px solid #e2e8f0;
    font-size: 14px;
    color: #334155;
}

table.acc-table tr:nth-child(even) td {
    background: #f8fafc;
}

table.acc-table tr:hover td {
    background: #eef2ff;
}

/* Status Badges */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
}

.badge-paid { background: #dcfce7; color: #166534; }
.badge-unpaid { background: #fee2e2; color: #991b1b; }
.badge-partial { background: #fef3c7; color: #92400e; }

/* Footer */
.footer {
    background: transparent;
    color: #64748b;
    text-align: center;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 500;
    margin-top: auto;
    border-top: 1px solid #e2e8f0;
}

/* =========================================================
   Mobile Responsiveness (Phones & Tablets)
========================================================= */

@media (max-width: 768px) {
    .sidebar {
        left: -240px;
        top: 0;
        bottom: 0;
        height: 100vh;
        position: fixed;
        z-index: 9999;
    }
    
    .sidebar.active {
        left: 0;
        box-shadow: 8px 0 25px rgba(0,0,0,0.4);
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .topbar {
        padding: 12px 16px;
    }
    
    .topbar .toggle-btn {
        display: block !important;
    }
    
    .content {
        padding: 14px 12px;
    }
    
    .page-header h2 {
        font-size: 20px;
    }

    .responsive-grid-stack {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .mobile-flex-stack {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .mobile-full-width {
        width: 100% !important;
    }

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

    table.acc-table th, table.acc-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Print Styles */
@media print {
    .sidebar, .topbar, .btn, .no-print, .footer, footer { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; }
    body { background: white !important; }
    .card-form, .table-wrap { box-shadow: none !important; border: none !important; }
}
