/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --light: #f8fafc;
    --dark: #1e293b;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow: 0 10px 25px rgba(0,0,0,0.1);
    --radius: 12px;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    margin-top: 100px;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

/* LOGO STYLES - FIXED */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--dark);
    margin: 3px 0;
    transition: 0.3s;
}

/* Main Content */
.main-content {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* COMPACT TABLE STYLES FOR EDIT LISTS AND VIEWS */
.compact-table {
    font-size: 0.75rem;
    line-height: 1.2;
}

.compact-table th,
.compact-table td {
    padding: 0.4rem 0.5rem;
    vertical-align: middle;
}

.compact-table .btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    line-height: 1;
}

.compact-table .form-control,
.compact-table .form-select {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
    height: calc(1.5em + 0.6rem);
}

.compact-table .badge {
    font-size: 0.65rem;
    padding: 0.25em 0.4em;
}

/* Ultra Compact for dense data */
.ultra-compact-table {
    font-size: 0.7rem;
}

.ultra-compact-table th,
.ultra-compact-table td {
    padding: 0.25rem 0.3rem;
}

.ultra-compact-table .btn-xs {
    padding: 0.15rem 0.3rem;
    font-size: 0.65rem;
}

/* Row adjustments for tables */
.table-row-compact tr {
    height: 35px;
}

.table-row-ultra-compact tr {
    height: 30px;
}

/* Small form controls */
.form-control-sm-custom {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    height: calc(1.5em + 0.5rem);
}

.form-select-sm-custom {
    font-size: 0.75rem;
    padding: 0.25rem 1.75rem 0.25rem 0.5rem;
    height: calc(1.5em + 0.5rem);
}

.btn-sm-custom {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Small badges */
.badge-sm {
    font-size: 0.65rem;
    padding: 0.2rem 0.35rem;
}

/* Hero Section */
.hero {
    background: var(--gradient);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: var(--radius);
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.card h3 {
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Forms */
.form-container {
    max-width: 400px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

.btn-success {
    background: var(--success);
}

.btn-danger {
    background: var(--danger);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.dashboard-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.dashboard-card i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #374151;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-error {
    background: #fee2e2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: var(--success);
    border: 1px solid #a7f3d0;
}

/* Dropdown Menu Styles */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    z-index: 1000;
    padding: 0.5rem 0;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.9rem;
}

.dropdown-link:hover {
    background: var(--primary);
    color: white;
    transform: none;
}

.dropdown-link i {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
}

/* Mobile Responsive */
/* Enhanced Mobile Menu Styles */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        padding: 1rem;
        box-shadow: var(--shadow);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        z-index: 999;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-toggle {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        padding: 0.5rem;
        background: none;
        border: none;
    }
    
    .nav-toggle span {
        width: 25px;
        height: 3px;
        background: var(--dark);
        margin: 3px 0;
        transition: 0.3s;
        transform-origin: center;
    }
    
    /* Hamburger to X animation */
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem;
        border-bottom: 1px solid #f1f1f1;
        margin: 0;
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    /* Mobile dropdown styles */
    .nav-dropdown {
        width: 100%;
        position: relative;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: #f8f9fa;
        display: none;
        width: 100%;
        margin: 0.5rem 0 0 0;
        padding-left: 1rem;
    }
    
    .nav-dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e9ecef;
        font-size: 0.9rem;
    }
    
    .dropdown-link:last-child {
        border-bottom: none;
    }
    
    /* Dropdown arrow indicator */
    .dropdown-toggle {
        position: relative;
    }
    
    .dropdown-toggle::after {
        content: '\f078';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        margin-left: auto;
        transition: transform 0.3s ease;
    }
    
    .nav-dropdown.active .dropdown-toggle::after {
        transform: rotate(180deg);
    }
}

@media (max-width: 480px) {
    .logo-text {
        display: none;
    }
    
    .logo-img {
        height: 32px;
    }
    
    .nav-logo {
        gap: 0;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    /* Ultra compact for mobile */
    .ultra-compact-table {
        font-size: 0.65rem;
    }
    
    .ultra-compact-table th,
    .ultra-compact-table td {
        padding: 0.2rem 0.25rem;
    }
}

/* Fallback if logo doesn't load */
.logo-img[src=""], 
.logo-img:not([src]) {
    display: none;
}

.logo-fallback {
    font-size: 24px;
    color: var(--primary);
}
.bowser-warning, .invoice-warning {
    font-size: 0.75rem;
    display: none;
    margin-top: 2px;
}

.bowser-warning.text-danger, 
.invoice-warning.text-danger, 
.invoice-warning.text-warning, 
.invoice-warning.text-success {
    display: block !important;
}

.invoice-warning.text-warning {
    color: #ffc107 !important;
}

.invoice-warning.text-success {
    color: #198754 !important;
}

.invoice-warning.text-danger {
    color: #dc3545 !important;
}
