/* assets/css/style.css */

:root {
    --primary-color: #0f172a;       /* Deep slate/navy blue */
    --secondary-color: #1e293b;     /* Card background blue */
    --accent-blue: #0284c7;         /* Active blue */
    --accent-indigo: #4f46e5;       /* Focus indigo */
    --success-green: #10b981;       /* Achievement green */
    --warning-orange: #f59e0b;      /* Attention orange */
    --danger-red: #ef4444;          /* Locked/alert red */
    --light-bg: #f8fafc;            /* Light gray background */
    --dark-bg: #090d16;             /* Master page background */
    --text-primary: #1e293b;        /* Dark text */
    --text-muted: #64748b;          /* Secondary text */
    --border-color: #e2e8f0;        /* Light border */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --sidebar-width: 260px;
}

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Styling */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: #f1f5f9;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-header span {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-menu {
    padding: 20px 0;
    list-style: none;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    color: #94a3b8;
    text-decoration: none;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.sidebar-menu a i {
    margin-right: 12px;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.sidebar-menu a:hover,
.sidebar-menu li.active a {
    color: #38bdf8;
    background-color: rgba(255, 255, 255, 0.03);
    border-left-color: #38bdf8;
}

.sidebar-menu li.active a i {
    color: #38bdf8;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(0, 0, 0, 0.1);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    transition: all 0.3s ease;
    min-width: 0; /* Prevents flex children from breaking layouts */
}

/* Top Navbar */
.top-navbar {
    background-color: #ffffff;
    padding: 15px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Page Header */
.page-title {
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

/* Premium Dashboard Cards */
.kpi-card {
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.kpi-icon.primary { background-color: rgba(2, 132, 199, 0.1); color: var(--accent-blue); }
.kpi-icon.success { background-color: rgba(16, 185, 129, 0.1); color: var(--success-green); }
.kpi-icon.warning { background-color: rgba(245, 158, 11, 0.1); color: var(--warning-orange); }
.kpi-icon.danger { background-color: rgba(239, 68, 68, 0.1); color: var(--danger-red); }

.kpi-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.kpi-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

.progress-bar-custom {
    height: 6px;
    border-radius: 3px;
    background-color: #f1f5f9;
    overflow: hidden;
    margin-top: 15px;
}

.progress-bar-custom-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.progress-bar-custom-fill.primary { background-color: var(--accent-blue); }
.progress-bar-custom-fill.success { background-color: var(--success-green); }
.progress-bar-custom-fill.warning { background-color: var(--warning-orange); }

/* Custom Tables */
.table-responsive-custom {
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    margin-bottom: 30px;
}

.table-custom {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.table-custom th {
    background-color: #f8fafc;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 16px 24px;
    border-bottom: 2px solid var(--border-color);
}

.table-custom td {
    padding: 16px 24px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: #334155;
    font-size: 0.875rem;
}

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

.table-custom tbody tr:hover {
    background-color: #f8fafc;
}

.table-totals {
    font-weight: 700;
    background-color: #f8fafc;
}

.table-totals td {
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    color: var(--primary-color);
}

/* Badges */
.badge-custom {
    padding: 6px 12px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-custom.success { background-color: rgba(16, 185, 129, 0.1); color: var(--success-green); }
.badge-custom.warning { background-color: rgba(245, 158, 11, 0.1); color: var(--warning-orange); }
.badge-custom.danger { background-color: rgba(239, 68, 68, 0.1); color: var(--danger-red); }
.badge-custom.info { background-color: rgba(2, 132, 199, 0.1); color: var(--accent-blue); }

/* Card Panels */
.panel-card {
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    padding: 24px;
    margin-bottom: 30px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.panel-header h5 {
    font-weight: 700;
    margin: 0;
    color: var(--primary-color);
}

/* Operations Flow Form Styles */
.step-container {
    display: none;
}

.step-container.active {
    display: block;
}

.nav-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    list-style: none;
}

.nav-step-item {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-step-item:hover {
    color: var(--primary-color);
}

.nav-step-item.active:hover {
    color: var(--accent-blue);
}

.nav-step-item.active {
    color: var(--accent-blue);
}

.nav-step-item.completed {
    color: var(--success-green);
}

.step-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #e2e8f0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.nav-step-item.active .step-indicator {
    background-color: var(--accent-blue);
    color: #ffffff;
}

.nav-step-item.completed .step-indicator {
    background-color: var(--success-green);
    color: #ffffff;
}

/* Custom form spacing */
.form-label-custom {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.form-select-custom,
.form-input-custom {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 10px 12px;
}

.form-select-custom:focus,
.form-input-custom:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

/* Print CSS Media Rules */
@media print {
    body {
        background-color: #ffffff;
        color: #000000;
        font-size: 11pt;
    }
    
    .sidebar,
    .top-navbar,
    .btn,
    .report-filters,
    .no-print,
    header,
    footer,
    nav {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    .panel-card,
    .table-responsive-custom {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin-bottom: 20px !important;
    }
    
    .table-custom th {
        background-color: #f1f5f9 !important;
        border-bottom: 2px solid #000000 !important;
        color: #000000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .table-custom td {
        border-bottom: 1px solid #e2e8f0 !important;
    }
    
    .table-totals td {
        border-top: 2px solid #000000 !important;
        border-bottom: 2px solid #000000 !important;
        font-weight: bold !important;
    }
    
    h2, h3, h4, h5 {
        color: #000000 !important;
    }
    
    .page-break {
        page-break-before: always;
    }
    
    .kpi-card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        background-color: #ffffff !important;
    }
    
    /* Ensure colors print reasonably */
    .progress-bar-custom {
        border: 1px solid #cbd5e1 !important;
        background-color: #f8fafc !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .progress-bar-custom-fill {
        background-color: #64748b !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Mobile Responsiveness */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .app-container.sidebar-open .sidebar {
        transform: translateX(0);
    }
}
