/* Modern Inventory Management Styles */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 12px;
    --border-radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Navigation Styles */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    position: sticky;
    top: 1rem;
    z-index: 50;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar-content {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.navbar-brand i {
    font-size: 1.75rem;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.navbar-toggle:hover {
    background: var(--gray-100);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-menu.mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    padding: 1rem 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: none;
}

.navbar-menu.mobile.show {
    display: flex;
}

.navbar-link {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.navbar-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.navbar-link:hover::before {
    left: 100%;
}

.navbar-link:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.navbar-link.logout {
    color: var(--error);
}

.navbar-link.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Card Styles */
.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-title i {
    color: var(--primary);
    font-size: 1.1em;
}

.card-body {
    padding: 1.5rem;
}

/* Form Styles */
.filters {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(200px, 1fr));
    width: 100%;
    max-width: 1000px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    visibility: visible;
}

/* Add this NEW section for login form specifically */
.login-form .form-group {
margin-bottom: 1.5rem;  /* Add more space between fields */
}

.login-form .btn {
margin-top: 1rem;  /* Add space above the login button */
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.form-input, .form-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    background: var(--gray-50);
    font-size: 0.875rem;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
    width: 100%;
    min-width: 200px;
    display: block;
    visibility: visible;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234b5563'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5rem;
    padding-right: 2.5rem;
}

.form-select option {
    white-space: normal;
}

.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.form-input:hover, .form-select:hover {
    border-color: var(--gray-400);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

/* Button Styles */
.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
    text-align: center;
    min-width: fit-content;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-700);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-600);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-2px);
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.table th {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    position: sticky;
    top: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table th:nth-child(1) { width: 20%; } /* Tool Name */
.table th:nth-child(2) { width: 18%; } /* Serial Number */
.table th:nth-child(3) { width: 20%; } /* Team */
.table th:nth-child(4) { width: 15%; } /* Category */
.table th:nth-child(5) { width: 15%; } /* Expiry Date */
.table th:nth-child(6) { width: 9%; min-width: 80px; } /* Status */
.table th:nth-child(7) { width: 11%; min-width: 120px; } /* Actions */

.table th:hover {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

.table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0;
    position: relative;
}

.table td:hover::after {
    content: attr(data-full-text);
    position: absolute;
    background: var(--gray-800);
    color: white;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    z-index: 10;
    white-space: normal;
    max-width: 300px;
    display: none;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.table td:hover::after {
    display: block;
}

.table td:nth-child(6) {
    text-align: center;
}

.table td:nth-child(6) .badge {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    font-size: 1rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.table td:nth-child(7) {
    white-space: nowrap;
    overflow: visible;
}

.table tr:hover {
    background: var(--gray-50);
    transform: scale(1.01);
}

.table tr:hover td {
    color: var(--gray-900);
}

/* Mobile Card Styles */
.mobile-cards {
    display: none;
}

.mobile-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.mobile-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.mobile-card-row:last-child {
    border-bottom: none;
}

.mobile-card-label {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.mobile-card-value {
    color: var(--gray-800);
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pagination Styles */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination a {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    border: 2px solid var(--gray-300);
    color: var(--gray-600);
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 44px;
    text-align: center;
}

.pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.pagination a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Status Badge Styles */
.badge {
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: fit-content;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* Alert Styles */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-bottom: 2rem;
}

.quick-action-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.quick-action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.quick-action-card:hover::before {
    left: 100%;
}

.quick-action-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.6);
}

.quick-action-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

.quick-action-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.quick-action-content p {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

/* Responsive Design */
@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-grid .form-group.full-width {
        grid-column: 1 / -1;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
    
    .card-body {
        padding: 2rem;
    }
    
    .card-header {
        padding: 1.5rem 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    .navbar-toggle {
        display: block;
    }

    .navbar-menu:not(.mobile) {
        display: none;
    }

    .table-container {
        display: none;
    }

    .mobile-cards {
        display: block;
    }

    .filters {
        align-items: stretch;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        gap: 0.25rem;
    }

    .pagination a {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        min-width: 40px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .quick-action-card {
        padding: 1.5rem;
        gap: 1rem;
    }

    .quick-action-icon {
        font-size: 2rem;
    }

    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .card-title {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .mobile-card {
        padding: 1rem;
    }
    
    .quick-action-card {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
}



/* Print Styles */
@media print {
    .navbar,
    .btn,
    .quick-actions,
    .pagination {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .table {
        font-size: 12px;
    }
}


/* Focus styles for keyboard navigation */
.btn:focus,
.form-input:focus,
.form-select:focus,
.navbar-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    /* Hide navigation, buttons, filters */
    .navbar,
    .btn,
    .btn-group,
    .pagination,
    .filters,
    .alert,
    .navbar-toggle,
    .form-group,
    form,
    .empty-state {
        display: none !important;
    }
    
    /* Clean background and colors */
    body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
        margin: 0;
        padding: 20px;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Card styling for print */
    .card {
        box-shadow: none !important;
        border: 2px solid #000 !important;
        page-break-inside: avoid;
        margin: 0 0 20px 0;
        background: white !important;
    }
    
    .card-header {
        background: #e8e8e8 !important;
        border-bottom: 2px solid #000 !important;
        padding: 10px !important;
        display: block !important;
    }
    
    .card-title {
        font-size: 18pt !important;
        font-weight: bold !important;
        color: #000 !important;
        display: block !important;
    }
    
    .card-body {
        padding: 10px !important;
    }
    
    /* Table styling */
    .table-responsive {
        overflow: visible !important;
    }
    
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: auto;
        font-size: 9pt;
    }
    
    thead {
        display: table-header-group; /* Repeat on each page */
        font-weight: bold;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    th {
        background: #d0d0d0 !important;
        border: 1px solid #000 !important;
        padding: 8px 4px !important;
        font-weight: bold !important;
        font-size: 10pt !important;
        color: #000 !important;
        text-align: left !important;
    }
    
    td {
        border: 1px solid #000 !important;
        padding: 6px 4px !important;
        font-size: 9pt !important;
        color: #000 !important;
    }
    
    /* Hide Actions column when printing */
    th:last-child,
    td:last-child {
        display: none !important;
    }
    
    /* Status badge styling for print */
    .badge {
        border: 1px solid #000 !important;
        padding: 2px 6px !important;
        border-radius: 3px;
        font-size: 8pt !important;
        background: white !important;
        color: #000 !important;
    }
    
    /* Status colors (grayscale for printing) */
    .status-active { 
        background: #f0f0f0 !important; 
        border: 1px solid #333 !important;
    }
    
    .status-expired { 
        background: #e0e0e0 !important; 
        border: 2px solid #000 !important;
        font-weight: bold !important;
    }
    
    .status-expiring { 
        background: #f5f5f5 !important; 
        border: 1px dashed #000 !important;
    }
    
    /* Page settings */
    @page {
        margin: 1.5cm;
        size: A4 landscape; /* Use landscape for wide tables */
    }
    
    /* Print header with date */
    .card-header::before {
        content: "Printed: " attr(data-print-date);
        display: block;
        font-size: 9pt;
        color: #666;
        margin-bottom: 5px;
        font-weight: normal;
    }
    
    /* Ensure links print */
    a[href]:after {
        content: none !important;
    }
    
    /* Break long text */
    td {
        word-wrap: break-word;
        word-break: break-word;
    }
}

/* ===============================================
   DARK MODE THEME
   =============================================== */

:root.dark-mode {
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --secondary: #a78bfa;
    --accent: #06b6d4;
    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;
    
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #78909c;
    --gray-600: #94a3b8;
    --gray-700: #cbd5e1;
    --gray-800: #e2e8f0;
    --gray-900: #f1f5f9;
}

/* Dark mode body and backgrounds */
:root.dark-mode body {
    background: linear-gradient(135deg, #0f172a 0%, #1a1f35 100%) !important;
    color: #e2e8f0 !important;
}

:root.dark-mode .container {
    background: transparent;
}

/* Dark mode cards */
:root.dark-mode .card {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

:root.dark-mode .card-header {
    background: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
}

:root.dark-mode .card-title {
    color: #f1f5f9 !important;
}

/* Dark mode tables */
:root.dark-mode table {
    background: #1e293b;
}

:root.dark-mode table th {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

:root.dark-mode table td {
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

:root.dark-mode table tr:hover {
    background: #273449 !important;
}

/* Dark mode forms */
:root.dark-mode input,
:root.dark-mode select,
:root.dark-mode textarea {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

:root.dark-mode input:focus,
:root.dark-mode select:focus,
:root.dark-mode textarea:focus {
    background: #1e293b !important;
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1) !important;
}

:root.dark-mode label {
    color: #cbd5e1 !important;
}

/* Dark mode buttons */
:root.dark-mode .btn-primary {
    background: #818cf8 !important;
    color: #0f172a !important;
    border-color: #818cf8 !important;
}

:root.dark-mode .btn-primary:hover {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
}

:root.dark-mode .btn-secondary {
    background: #334155 !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

:root.dark-mode .btn-secondary:hover {
    background: #475569 !important;
    border-color: #64748b !important;
}

:root.dark-mode .btn-danger {
    background: #ef4444 !important;
    color: #fff !important;
    border-color: #ef4444 !important;
}

:root.dark-mode .btn-danger:hover {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}

/* Dark mode navbar */
:root.dark-mode .navbar {
    background: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
}

:root.dark-mode .navbar-link {
    color: #cbd5e1 !important;
}

:root.dark-mode .navbar-link:hover,
:root.dark-mode .navbar-link.active {
    color: #818cf8 !important;
}

/* Dark mode alerts */
:root.dark-mode .alert {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

:root.dark-mode .alert-success {
    background: #064e3b !important;
    color: #a7f3d0 !important;
    border-color: #34d399 !important;
}

:root.dark-mode .alert-error {
    background: #7f1d1d !important;
    color: #fca5a5 !important;
    border-color: #ef4444 !important;
}

/* Dark mode badges */
:root.dark-mode .badge {
    background: #334155 !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

/* Dark mode pagination */
:root.dark-mode .pagination-link {
    background: #1e293b !important;
    color: #818cf8 !important;
    border-color: #334155 !important;
}

:root.dark-mode .pagination-link:hover {
    background: #334155 !important;
    border-color: #475569 !important;
}

:root.dark-mode .pagination-info {
    color: #cbd5e1 !important;
}

/* Dark mode toggle button */
.theme-toggle {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s;
    margin-left: auto;
}

.theme-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
}

:root.dark-mode .theme-toggle {
    color: #fbbf24;
}

/* Smooth transition for theme switching */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Prevent transition on page load */
html.no-transition * {
    transition: none !important;
}

/* Dark mode stats cards - make them darker */
:root.dark-mode .stat-card {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #e2e8f0 !important;
}

:root.dark-mode .stat-card .stat-label {
    color: #cbd5e1 !important;
}

:root.dark-mode .stat-card .stat-number {
    color: #818cf8 !important;
}

:root.dark-mode .stat-icon {
    color: #a78bfa !important;
    background: #1e293b !important;
}

/* Dashboard cards in dark mode */
:root.dark-mode .dashboard-stat,
:root.dark-mode .stat-box {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
}

:root.dark-mode .dashboard-stat h3,
:root.dark-mode .stat-box h3 {
    color: #e2e8f0 !important;
}

:root.dark-mode .dashboard-stat .number,
:root.dark-mode .stat-box .number {
    color: #818cf8 !important;
}

/* Make sure all panels in dark mode are dark */
:root.dark-mode [class*="stat"],
:root.dark-mode [class*="panel"] {
    background: #1e293b !important;
    border-color: #334155 !important;
}


/* Dark mode mobile menu */
:root.dark-mode .navbar-menu.mobile {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
}

:root.dark-mode .navbar-menu.mobile.show {
    background: #1e293b !important;
}

:root.dark-mode .navbar-menu.mobile .navbar-link {
    color: #cbd5e1 !important;
    border-bottom: 1px solid #334155 !important;
}

:root.dark-mode .navbar-menu.mobile .navbar-link:hover {
    background: #0f172a !important;
    color: #818cf8 !important;
}

/* Dark mode for add pages (teams, categories) */
:root.dark-mode .form-group,
:root.dark-mode .form-group label {
    color: #e2e8f0 !important;
}

:root.dark-mode .form-group input,
:root.dark-mode .form-group select,
:root.dark-mode .form-group textarea {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border: 1px solid #334155 !important;
}

:root.dark-mode .form-group input:focus,
:root.dark-mode .form-group select:focus,
:root.dark-mode .form-group textarea:focus {
    background: #1e293b !important;
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1) !important;
}

/* Dark mode list items */
:root.dark-mode li {
    color: #cbd5e1 !important;
}

/* Dark mode error/success messages */
:root.dark-mode .error-message,
:root.dark-mode .success-message {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* Dark mode file inputs */
:root.dark-mode input[type="file"] {
    color: #cbd5e1 !important;
}

:root.dark-mode input[type="file"]::file-selector-button {
    background: #334155 !important;
    color: #e2e8f0 !important;
    border: 1px solid #475569 !important;
}

/* Dark mode TABLES - Fix teams and categories pages */
:root.dark-mode .table {
    background: #1e293b !important;
    color: #cbd5e1 !important;
}

:root.dark-mode .table thead {
    background: #0f172a !important;
}

:root.dark-mode .table thead th {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
    border-bottom: 2px solid #334155 !important;
}

:root.dark-mode .table tbody td {
    color: #cbd5e1 !important;
    border-color: #334155 !important;
    background: #1e293b !important;
}

:root.dark-mode .table tbody tr {
    background: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
}

:root.dark-mode .table tbody tr:hover {
    background: #273449 !important;
}

:root.dark-mode .table-responsive {
    background: transparent !important;
}

/* Dark mode mobile cards (for team and category lists) */
:root.dark-mode .mobile-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

:root.dark-mode .mobile-card:hover {
    background: #273449 !important;
}

:root.dark-mode .mobile-card-label {
    color: #94a3b8 !important;
}

:after.dark-mode .mobile-card-value {
    color: #e2e8f0 !important;
}


/* Dark mode action buttons in tables */
:root.dark-mode .btn-sm {
    color: #e2e8f0 !important;
}

:root.dark-mode .btn-primary.btn-sm {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
}

:root.dark-mode .btn-danger.btn-sm {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
}

:root.dark-mode .btn-secondary.btn-sm {
    background: #475569 !important;
    border-color: #475569 !important;
}


.navbar-menu.mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    padding: 1rem 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.navbar-menu.mobile.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
}

.navbar {
  position: relative;
  z-index: 200;
}

/* Dark mode mobile menu */
:root.dark-mode .navbar-menu.mobile {
    background: rgba(15, 23, 42, 0.98) !important;
    border: 1px solid #334155 !important;
    border-top: none !important;
}

.navbar-menu.mobile {
    z-index: 100;
}

:root.dark-mode .navbar-menu.mobile .navbar-link {
    color: #cbd5e1 !important;
}

/* ===============================================
   DARK MODE FIX FOR TEAMS PAGE
   =============================================== */

:root.dark-mode .teams-header {
    color: #e2e8f0 !important;
}

:root.dark-mode .teams-header h2 {
    color: #f1f5f9 !important;
}

:root.dark-mode .teams-grid {
    background: transparent !important;
}

:root.dark-mode .team-card {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
    transition: background 0.3s ease, color 0.3s ease;
}

:root.dark-mode .team-card:hover {
    background: #273449 !important;
    border-color: #475569 !important;
}

:root.dark-mode .team-card-header {
    border-bottom: 1px solid #334155 !important;
}

:root.dark-mode .team-card h3,
:root.dark-mode .team-card p,
:root.dark-mode .team-card span,
:root.dark-mode .team-card label {
    color: #cbd5e1 !important;
}

:root.dark-mode .team-card input,
:root.dark-mode .team-card select,
:root.dark-mode .team-card textarea {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border: 1px solid #334155 !important;
}

:root.dark-mode .team-card input:focus,
:root.dark-mode .team-card select:focus,
:root.dark-mode .team-card textarea:focus {
    background: #1e293b !important;
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1) !important;
}

:root.dark-mode .team-card button,
:root.dark-mode .team-card .btn {
    background: #334155 !important;
    color: #e2e8f0 !important;
    border: 1px solid #475569 !important;
}

:root.dark-mode .team-card button:hover,
:root.dark-mode .team-card .btn:hover {
    background: #475569 !important;
}

:root.dark-mode .team-card .btn-primary {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
    color: #fff !important;
}

:root.dark-mode .team-card .btn-danger {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #fff !important;
}

:root.dark-mode .alert,
:root.dark-mode .error-message,
:root.dark-mode .success-message {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border: 1px solid #334155 !important;
}

:root.dark-mode .alert-success {
    background: #064e3b !important;
    border-color: #34d399 !important;
    color: #a7f3d0 !important;
}

:root.dark-mode .alert-error {
    background: #7f1d1d !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
}

/* ===============================================
   DARK MODE FIX — MODALS & NUMBER BADGES
   =============================================== */

/* Fix for Add/Edit modals or pop-up windows */
:root.dark-mode .modal,
:root.dark-mode .modal-content,
:root.dark-mode .popup,
:root.dark-mode .form-window,
:root.dark-mode .dialog {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5) !important;
}

/* Optional — if you use overlay/backdrop for modals */
:root.dark-mode .modal-backdrop {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* Fix light input borders inside modals */
:root.dark-mode .modal input,
:root.dark-mode .modal select,
:root.dark-mode .modal textarea {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #e2e8f0 !important;
}

:root.dark-mode .modal input:focus,
:root.dark-mode .modal select:focus,
:root.dark-mode .modal textarea:focus {
    background: #1e293b !important;
    border-color: #818cf8 !important;
}

/* Fix for small number counts or badges */
:root.dark-mode .badge,
:root.dark-mode .count,
:root.dark-mode .number,
:root.dark-mode .stat,
:root.dark-mode .team-count {
    background: #334155 !important;
    color: #fbbf24 !important; /* goldish accent so it's visible */
    border: 1px solid #475569 !important;
}

/* If you have circular number counters (like icons) */
:root.dark-mode .circle-count,
:root.dark-mode .badge-number {
    background: #475569 !important;
    color: #facc15 !important; /* slightly brighter */
    border: 1px solid #334155 !important;
}
