/* Liberia Maritime Authority - Voucher Management System Styles */

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #0ea5e9;
    --light-color: #f1f5f9;
    --dark-color: #0f172a;
    --border-radius: 10px;
    --box-shadow: 0 5px 15px rgba(30, 58, 138, 0.1);
    --transition: all 0.3s ease;
    --navbar-height: 100px;
}

/* Base Styles */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f1f5f9;
    line-height: 1.6;
    overflow-x: hidden;
    min-width: 0;
}

/* LMA Logo Styles */
.lma-logo {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 50px;
    width: auto;
    max-width: 120px;
}


.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
}

/* Navigation Styles */
.navbar-brand {
    font-weight: bold;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
    border-radius: 5px;
    margin: 0 5px;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Navigation Link Text Colors */
.navbar-nav .nav-link {
    color: white !important;
}

.navbar-nav .nav-link:hover {
    color: white !important;
}

/* Dashboard Title Colors */
h2 {
    color: white !important;
}

/* Overdue Vouchers Management Title */
.overdue-title {
    color: black !important;
}

/* Controller Dashboard Title */
.controller-title {
    color: black !important;
}

/* Back to Dashboard Links - Make ALL text white with maximum specificity */
.back-btn,
.navbar-brand.fw-bold.text-primary,
a.btn-outline-primary.back-btn,
a.btn-outline-secondary:has(i.fa-arrow-left),
a.btn-secondary:has(i.fa-arrow-left),
a.btn-primary:has(i.fa-arrow-left) {
    color: white !important;
}

/* Override text-primary class for Back to Dashboard */
.navbar-brand.fw-bold.text-primary {
    color: white !important;
}

/* Force white color for ALL navbar-brand elements with Back to Dashboard text */
.navbar-brand.fw-bold.text-primary[href*="dashboard"],
a[href*="dashboard"].navbar-brand {
    color: white !important;
}

/* Force white for all button variants linking to dashboard */
a[href*="dashboard"].btn,
a[href*="dashboard"].btn-primary,
a[href*="dashboard"].btn-secondary,
a[href*="dashboard"].btn-outline-primary,
a[href*="dashboard"].btn-outline-secondary {
    color: white !important;
}

/* Hover states for Back to Dashboard buttons */
a[href*="dashboard"].btn:hover,
a[href*="dashboard"].btn-primary:hover,
a[href*="dashboard"].btn-secondary:hover,
a[href*="dashboard"].btn-outline-primary:hover,
a[href*="dashboard"].btn-outline-secondary:hover {
    color: white !important;
}

/* Override any inline styles on navbar-brand with white text */
.navbar-brand.fw-bold.text-primary[style*="color"] {
    color: white !important;
}

/* Override inline styles for buttons */
a.btn[style*="color"],
a[href*="dashboard"][style*="color"] {
    color: white !important;
}

/* Specific styling for Mark All as Read and Refresh buttons */
button.btn-outline-primary,
button.btn-outline-secondary {
    color: white !important;
    border-color: white !important;
}

button.btn-outline-primary:hover,
button.btn-outline-secondary:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: white !important;
}

/* Individual Mark Read/Unread buttons */
.btn-mark-read,
.btn-mark-unread {
    color: white !important;
    border-color: white !important;
}

.btn-mark-read:hover,
.btn-mark-unread:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: white !important;
}

/* Sky Blue Navbar Theme */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.2);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
}

/* ========== App Layout with Sidebar ========== */
.app-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - var(--navbar-height));
    overflow-x: hidden;
}

.app-layout.with-sidebar .main-content {
    flex: 1;
    margin-left: 260px;
    min-width: 0;
    padding-top: 0.5rem;
}

.app-layout:not(.with-sidebar) .main-content {
    flex: 1;
    min-width: 0;
}

/* Sidebar - starts below the navbar (same page, not over the header) */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--navbar-height);
    bottom: 0;
    width: 260px;
    background: #2B4E8C;
    color: #e2e8f0;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0 0.75rem;
}

.sidebar-item {
    margin-bottom: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-link:hover {
    background-color: rgba(59, 130, 246, 0.15);
    color: #f1f5f9;
}

.sidebar-link:active,
.sidebar-link.active {
    background-color: rgba(59, 130, 246, 0.25);
    color: #fff;
}

.sidebar-icon {
    width: 1.5rem;
    margin-right: 0.75rem;
    font-size: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-item-logout {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.sidebar-item-logout .sidebar-link:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* Sidebar toggler button (mobile) */
.sidebar-toggler {
    color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.5);
}

.sidebar-toggler:hover {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.8);
}

/* Sidebar overlay on mobile when open */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--navbar-height);
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

@media (min-width: 992px) {
    .sidebar-overlay { display: none !important; }
}

/* Sidebar responsive: collapse on smaller screens */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .app-layout.with-sidebar .main-content {
        margin-left: 0;
    }
}

/* Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.15);
}

.card-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border-bottom: none;
    font-weight: 600;
}

/* Button Styles */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #20c997 0%, var(--success-color) 100%);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #fd7e14 100%);
    border: none;
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #fd7e14 0%, var(--warning-color) 100%);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #fd7e14 100%);
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #fd7e14 0%, var(--danger-color) 100%);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, var(--accent-color) 100%);
    border: none;
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--info-color) 100%);
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.4);
}

/* Form Styles */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

/* Table Styles */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead th {
    background-color: var(--light-color);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
    color: var(--dark-color);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(30, 58, 138, 0.05);
}


/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Notification Styles */
.notification-item {
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.notification-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.notification-item.unread {
    background: #e0e7ff;
    border-left-color: var(--accent-color);
}

/* Recent Notifications Card Adjustments */
.notifications-card {
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.notifications-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.notifications-card .notification-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 15px;
}

.notifications-card .notification-item {
    flex: 0 0 auto;
    margin-bottom: 0;
    min-height: 80px;
}

.notifications-card .notification-item:last-child {
    margin-bottom: 0;
}

/* Document sections spacing */
.document-card {
    margin-bottom: 1.5rem;
}

.document-card:last-child {
    margin-bottom: 0;
}

/* Better spacing for document sections */
.col-lg-8 .card {
    margin-bottom: 1rem;
}

.col-lg-8 .card:last-child {
    margin-bottom: 0;
}

/* Resubmitted Documents specific styling */
.document-card .card-header.bg-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%) !important;
}

/* Quick Actions section styling */
.kpi-rate-content {
    padding: 0.5rem 0;
}

.kpi-rate-content .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.kpi-rate-content .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.kpi-rate-content .btn-outline-primary:hover {
    background-color: #1e3a8a;
    border-color: #1e3a8a;
    color: white;
}

.kpi-rate-content .btn-outline-warning:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    color: white;
}

.kpi-rate-content .btn-outline-info:hover {
    background-color: #1e3a8a;
    border-color: #1e3a8a;
    color: white;
}

.kpi-rate-content .btn-outline-secondary:hover {
    background-color: #1e3a8a;
    border-color: #1e3a8a;
    color: white;
}

/* KPI Dashboard Styling */
.kpi-mini-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    height: 100%;
}

.kpi-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.kpi-mini-card.pending {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #ffc107;
}

.kpi-mini-card.pending .kpi-mini-icon {
    color: #ffc107;
}

.kpi-mini-card.approved {
    background: linear-gradient(135deg, #d1edff 0%, #a7d8ff 100%);
    border-color: #0ea5e9;
}

.kpi-mini-card.approved .kpi-mini-icon {
    color: #0ea5e9;
}

.kpi-mini-card.rejected {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    border-color: #dc2626;
}

.kpi-mini-card.rejected .kpi-mini-icon {
    color: #dc2626;
}

.kpi-mini-card.resubmitted {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-color: #6366f1;
}

.kpi-mini-card.resubmitted .kpi-mini-icon {
    color: #6366f1;
}

.kpi-mini-icon {
    font-size: 2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.kpi-mini-content {
    flex: 1;
}

.kpi-mini-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e293b;
    line-height: 1;
}

.kpi-mini-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* KPI Rate Cards */
.kpi-rate-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    height: 100%;
}

.kpi-rate-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-rate-value {
    font-size: 2rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.kpi-rate-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* Trend Chart Styling */
.kpi-chart-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.kpi-chart-container h6 {
    color: #1e293b;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
}

.kpi-chart-container .form-select {
    border-color: #28a745;
    font-size: 0.875rem;
}

.kpi-chart-container .form-select:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Chart canvas styling */
#trendChart {
    background: white;
    border-radius: 0.375rem;
    padding: 1rem;
}

/* Legend styling to match the image */
.chartjs-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.chartjs-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.chartjs-legend-item::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.chartjs-legend-item.approved::before {
    background-color: #28a745;
}

.chartjs-legend-item.rejected::before {
    background-color: #dc3545;
}

/* Responsive adjustments for notifications */
@media (max-width: 992px) {
    .notifications-card {
        margin-top: 1rem;
    }
}


/* KPI Dashboard Styles */
.kpi-dashboard-card {
    display: flex;
    flex-direction: column;
    min-height: 400px;
    max-height: 500px;
}

.kpi-dashboard-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.kpi-chart-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.kpi-stats .badge {
    font-size: 0.8rem;
    padding: 8px 12px;
    border-radius: 20px;
}

.kpi-mini-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 1px solid #dee2e6;
    transition: var(--transition);
}

.kpi-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kpi-mini-card.approved {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
}

.kpi-mini-card.pending {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #ffc107;
}

.kpi-mini-card.rejected {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
}

.kpi-mini-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.kpi-mini-card.pending .kpi-mini-icon {
    color: #ffc107;
}

.kpi-mini-card.approved .kpi-mini-icon {
    color: #28a745;
}

.kpi-mini-card.rejected .kpi-mini-icon {
    color: #dc3545;
}

.kpi-mini-number {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.kpi-mini-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 600;
}

.kpi-rate-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #2196f3;
}

.kpi-rate-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1976d2;
    margin-bottom: 8px;
}

.kpi-rate-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #1976d2;
    text-align: center;
}

.kpi-rate-card .progress {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.kpi-rate-card .progress-bar {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 10px;
}

/* Activity Log Styles */
.activity-item {
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.activity-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.activity-item.upload {
    border-left-color: var(--accent-color);
}

.activity-item.approve {
    border-left-color: var(--success-color);
}

.activity-item.reject {
    border-left-color: var(--danger-color);
}

.activity-item.download {
    border-left-color: var(--warning-color);
}

/* Apply same improvements to activity items in notifications cards */
.notifications-card .activity-item {
    flex: 0 0 auto;
    margin-bottom: 15px;
    min-height: 90px;
}

.notifications-card .activity-item:last-child {
    margin-bottom: 0;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 1rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

/* Navy Blue Gradient Variations for Different Cards */
.stats-card:nth-child(1) {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

.stats-card:nth-child(2) {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

.stats-card:nth-child(3) {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
}

.stats-card:nth-child(4) {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
}

.stats-card:nth-child(5) {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.stats-card:nth-child(6) {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.stats-card:nth-child(7) {
    background: linear-gradient(135deg, #60a5fa 0%, #93c5fd 100%);
}

.stats-card:nth-child(8) {
    background: linear-gradient(135deg, #93c5fd 0%, #dbeafe 100%);
    color: #1e293b;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.stats-label {
    font-size: 1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Chart Container */
.chart-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 1rem;
    border: 1px solid rgba(30, 58, 138, 0.1);
}

.chart-container h5 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* File Upload Styles */
.file-upload-area {
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    background: #f1f5f9;
    transition: var(--transition);
    cursor: pointer;
}

.file-upload-area:hover {
    background: #e0e7ff;
    border-color: var(--accent-color);
    transform: scale(1.02);
}

.file-upload-area.dragover {
    background: #e0e7ff;
    border-color: var(--accent-color);
    transform: scale(1.02);
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Alert Styles */
.alert {
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* Modal Styles */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border-bottom: none;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Footer Styles */
footer {
    margin-top: auto;
    background: var(--light-color);
    border-top: 1px solid #dee2e6;
}

/* Responsive Design */
/* Large monitors: constrain content width for readability */
@media (min-width: 1400px) {
    .responsive-main {
        max-width: 1600px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Tables: horizontal scroll on small screens */
.table-responsive,
.table-responsive-sm,
.table-responsive-md {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    min-width: 0;
}

/* Wrap tables in responsive container when not already wrapped */
@media (max-width: 991.98px) {
    main .card .table:not(.table-responsive *) {
        margin-bottom: 0;
    }
    main .card > .table-responsive,
    main .card > .table-responsive-md,
    main .card > div:first-child .table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Touch-friendly: minimum tap target size on touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .dropdown-item,
    a.btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 768px) {
    .stats-card {
        padding: 1.5rem;
    }
    
    .stats-number {
        font-size: 2rem;
    }
    
    .logo-image {
        height: 40px;
        max-width: 90px;
    }
    
    .logo-title {
        font-size: 0.95rem;
        line-height: 1.2;
    }
    
    .logo-subtitle {
        font-size: 0.65rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.35rem; }
    h3, .h3 { font-size: 1.2rem; }
    h4, .h4 { font-size: 1.1rem; }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .stats-card {
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .stats-number {
        font-size: 1.5rem;
    }
    
    .stats-label {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
    }
    
    .dropdown-menu {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* Tablet: comfortable middle ground */
@media (min-width: 577px) and (max-width: 991.98px) {
    .responsive-main {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Prevent very long words from breaking layout */
body, .card, .table, .navbar-brand {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
}

.shadow {
    box-shadow: var(--box-shadow) !important;
}

.shadow-lg {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
}

.border-radius {
    border-radius: var(--border-radius) !important;
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .modal,
    footer {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    body {
        background: white !important;
    }
}
