/* BREAFAJ CONSULT - Main Stylesheet */
/* Matching interface.png reference design */

/* Color Variables */
:root {
    --primary-color: #1e3a5f;
    --primary-dark: #12253d;
    --sidebar-bg: #1e3a5f;
    --sidebar-text: #ffffff;
    --sidebar-hover: #2c5282;
    --accent-color: #f4b942;
    --accent-hover: #d9a53a;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f5f7fa;
    --dark-text: #2d3748;
    --light-text: #718096;
    --white: #ffffff;
    --border-color: #edf2f7;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --sidebar-width: 260px;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: var(--light-bg);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 20px;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-accent {
    background: var(--accent-color);
    color: var(--primary-dark);
    font-weight: 600;
}

.btn-accent:hover {
    background: var(--accent-hover);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s ease;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.875rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error,
.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--light-text);
    font-size: 0.9rem;
}

/* Dashboard Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    background: var(--primary-dark);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    padding: 15px 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu li {
    padding: 3px 15px;
}

.sidebar-menu li a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    color: var(--white);
    background: var(--sidebar-hover);
}

.sidebar-menu li a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: var(--light-bg);
    min-height: 100vh;
}

/* Warning Banner */
.warning-banner {
    background: var(--warning-color);
    color: #856404;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
}

.warning-banner i {
    margin-right: 8px;
}

/* Top Navbar */
.top-navbar {
    background: var(--white);
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-left h2 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--sidebar-bg);
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info {
    line-height: 1.3;
}

.user-info .text-bold {
    font-size: 0.9rem;
}

.user-info small {
    font-size: 0.75rem;
}

/* Stats Grid - Matching interface.png blue cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.stat-card {
    background: var(--primary-color);
    color: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card.light {
    background: var(--white);
    color: var(--dark-text);
}

.stat-card.light .stat-info h3 {
    color: var(--primary-color);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-right: 15px;
    background: rgba(255, 255, 255, 0.2);
}

.stat-card.light .stat-icon {
    background: rgba(30, 58, 95, 0.1);
    color: var(--primary-color);
}

.icon-blue {
    background: rgba(30, 58, 95, 0.1);
    color: var(--primary-color);
}

.icon-orange {
    background: rgba(244, 185, 66, 0.2);
    color: var(--accent-color);
}

.icon-green {
    background: rgba(40, 167, 69, 0.15);
    color: var(--success-color);
}

.icon-red {
    background: rgba(220, 53, 69, 0.15);
    color: var(--danger-color);
}

.stat-info h3 {
    font-size: 1.5rem;
    margin-bottom: 2px;
    font-weight: 700;
    color: inherit;
}

.stat-info p {
    font-size: 0.8rem;
    margin: 0;
    opacity: 0.85;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 0 20px 20px;
}

@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid var(--border-color);
    color: var(--light-text);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* Badges */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-approved {
    background: #d4edda;
    color: #155724;
}

.badge-rejected {
    background: #f8d7da;
    color: #721c24;
}

.badge-active {
    background: #cce5ff;
    color: #004085;
}

/* Quick Actions Panel (matching interface.png) */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: var(--dark-text);
    transition: all 0.2s;
}

.quick-action-btn:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.quick-action-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.quick-action-btn span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Pending Actions List */
.pending-list .pending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.pending-list .pending-item:last-child {
    border-bottom: none;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--primary-color);
}

.text-accent {
    color: var(--accent-color);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-muted {
    color: var(--light-text);
}

.text-bold {
    font-weight: 600;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print Styles */
@media print {

    /* Reset Layout */
    .wrapper {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    .sidebar,
    .top-navbar,
    .noprint,
    .no-print,
    #toast-container,
    .pwa-modal {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: white !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    /* Ensure cards print fully */
    .card,
    .statement-card {
        box-shadow: none !important;
        border: none !important;
        break-inside: avoid;
    }

    /* Improve Table Printing */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    th,
    td {
        border: 1px solid #ddd !important;
        color: black !important;
    }
}