@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-hsl: 224, 64%, 33%; /* Navy Blue */
    --primary: hsl(var(--primary-hsl));
    --primary-light: hsl(224, 64%, 45%);
    --primary-dark: hsl(224, 64%, 22%);
    
    --accent-hsl: 175, 77%, 26%; /* Scouts Emerald/Teal */
    --accent: hsl(var(--accent-hsl));
    --accent-hover: hsl(175, 77%, 20%);
    --accent-glow: rgba(15, 118, 110, 0.1);
    
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    
    --bg-app: #f8fafc; /* Clean Light Slate */
    --bg-card: #ffffff; /* Crisp White Cards */
    
    --text-main: #0f172a; /* Slate 900 */
    --text-muted: #475569; /* Slate 600 */
    --text-light: #94a3b8; /* Slate 400 */
    
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Base Body Styles */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

/* Navbar Restyling */
.navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    letter-spacing: -0.03em;
}

.navbar-brand img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
    border-radius: var(--radius-sm);
    object-fit: contain;
    margin-right: 10px;
}

.navbar-nav .nav-link {
    font-weight: 600;
    font-size: 0.925rem;
    color: var(--text-muted) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary) !important;
    background-color: #f1f5f9;
}

.navbar-nav .nav-link.active {
    color: var(--primary) !important;
    background-color: #eff6ff;
    font-weight: 700;
}

/* Dropdown styling */
.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    padding: 0.5rem;
    margin-top: 0.5rem !important;
    animation: dropdownFade 0.2s ease forwards;
}

.dropdown-item {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.dropdown-item.text-danger:hover {
    background-color: var(--danger-light);
    color: var(--danger);
}

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

/* Card layout & Glassmorphism widgets */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

/* Buttons */
.btn {
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(30, 58, 138, 0.15);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-light) !important;
    border-color: var(--primary-light) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(30, 58, 138, 0.25);
}

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.1);
}

.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.2);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-muted);
}

.btn-outline-secondary:hover {
    background-color: #f8fafc;
    color: var(--text-main);
    border-color: var(--text-light);
}

/* Inputs & Form styling */
.form-label {
    font-weight: 600;
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    font-size: 0.925rem;
    color: var(--text-main);
    background-color: #f8fafc;
    transition: all 0.2s ease;
}

.form-control:focus {
    background-color: #ffffff;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-light);
}

.input-group-text {
    background-color: #f8fafc;
    border-color: var(--border-color);
    color: var(--text-muted);
    border-radius: var(--radius-md);
}

/* Search Box Container */
.search-box {
    position: relative;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-lg);
    background: #ffffff;
}

.search-input {
    border-radius: var(--radius-lg) !important;
    padding-left: 2.75rem !important;
    height: 3.25rem;
    font-size: 1rem;
    border: 1.5px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    background-color: #ffffff;
}

.search-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 10;
}

.search-spinner {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    z-index: 10;
}

/* Search results suggestions popup */
.search-results {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 6px;
    display: none;
    position: absolute;
    width: 100%;
    z-index: 1000;
    background: #ffffff;
    box-shadow: var(--shadow-xl);
    padding: 0.5rem 0;
}

.search-item {
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.search-item:hover {
    background-color: #f8fafc;
}

.search-item:last-child {
    border-bottom: none;
}

.search-highlight {
    background-color: #dbeafe;
    color: #1e40af;
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Modern styling for the tables */
.table-responsive {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: #ffffff;
}

.compact-table {
    margin-bottom: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.compact-table th {
    background-color: #f8fafc !important;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.725rem;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
}

.compact-table td {
    padding: 14px 16px;
    vertical-align: middle;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-main);
}

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

.compact-table tbody tr {
    transition: background-color 0.15s ease;
}

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

/* Custom modern status badge states */
.status-badge {
    font-size: 0.725rem !important;
    font-weight: 700 !important;
    padding: 0.35rem 0.75rem !important;
    border-radius: 50px !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Status: Stored (Received) */
.btn-primary.status-btn {
    background-color: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1e40af !important;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: none;
}

/* Status: Collected (Cleared) */
.btn-success.status-btn {
    background-color: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    color: #065f46 !important;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: none;
}

/* UI Stats widgets */
.stat-widget {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    background: #ffffff;
}

.stat-widget:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-widget.widget-blue {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #bfdbfe;
    color: #1e40af;
}

.stat-widget.widget-green {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #a7f3d0;
    color: #065f46;
}

.stat-widget.widget-cyan {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-color: #ddd6fe;
    color: #5b21b6;
}

/* Modals */
.modal-content {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    background: #ffffff;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    background-color: #f8fafc;
}

.modal-title {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    background-color: #f8fafc;
}

/* Hero Section (Main Landings) */
.hero-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--text-main);
    padding: 120px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

/* Animated gradient text helper */
.gradient-text {
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Feature icon box */
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: rgba(30, 58, 138, 0.08);
    border: 1px solid rgba(30, 58, 138, 0.15);
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

/* List group style for light theme */
.list-group-item {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
    padding: 1rem 0;
}

.list-group-item small {
    color: var(--text-muted);
}

.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
}

/* Footer Section */
.footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 50px 0 30px 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    margin-top: auto;
}

.footer h4 {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
}

.footer a {
    color: #94a3b8;
    transition: color 0.2s ease;
    text-decoration: none;
}

.footer a:hover {
    color: #ffffff;
}

/* Tab controls */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    gap: 8px;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    background-color: #f1f5f9;
}

.nav-tabs .nav-link.active {
    color: var(--primary) !important;
    background-color: #ffffff;
    border-bottom: 3px solid var(--primary);
}

/* Receipt box styling */
.receipt {
    max-width: 500px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 30px;
    border: 1px solid var(--border-color);
}

.receipt-header {
    text-align: center;
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.receipt-logo {
    width: 100px;
    margin-bottom: 12px;
}

.qr-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.receipt-details div {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.925rem;
}

.receipt-details div:last-child {
    border-bottom: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Sidebar Hover Sliding Drawer Layout */
.sidebar-trigger {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    z-index: 1040;
    background: transparent;
}

.sidebar-nav {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 1050;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

/* Slide in when trigger or nav itself is hovered */
.sidebar-trigger:hover + .sidebar-nav,
.sidebar-nav:hover {
    transform: translateX(280px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand img {
    height: 36px;
    object-fit: contain;
}

.sidebar-brand span {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.15rem;
}

.sidebar-user {
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.sidebar-menu a:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.sidebar-menu a.active {
    background-color: #eff6ff;
    color: var(--primary);
}

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

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: auto;
}

.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.sidebar-footer-link:hover {
    background-color: #f1f5f9;
}

.sidebar-footer-link.text-danger:hover {
    background-color: var(--danger-light);
    color: var(--danger) !important;
}

.sidebar-handle {
    position: fixed;
    left: 0;
    top: 20px;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1039;
    box-shadow: var(--shadow-md);
    transition: opacity 0.2s ease, left 0.3s ease;
    cursor: pointer;
}

/* Hide the hover handle when sidebar is slid in */
.sidebar-trigger:hover ~ .sidebar-handle,
.sidebar-nav:hover ~ .sidebar-handle {
    left: -30px;
    opacity: 0;
}

@media print {
    .sidebar-nav, .sidebar-trigger, .sidebar-handle {
        display: none !important;
    }
}