/* ============================================
   EVECTRA DASHBOARD - SISTEMA DE LICITACIONES
   Estilos principales con Light/Dark Mode
   ============================================ */

/* CSS Variables - Light Theme (Default) */
:root, [data-theme="light"] {
    /* Primary Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-bg: rgba(99, 102, 241, 0.1);
    
    /* Secondary Colors */
    --secondary: #10b981;
    --secondary-dark: #059669;
    --secondary-light: #34d399;
    
    /* Accent Colors */
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.1);
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-input: #ffffff;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Border Colors */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 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);
    
    /* Sidebar */
    --sidebar-bg: #1e293b;
    --sidebar-text: #e2e8f0;
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: rgba(99, 102, 241, 0.2);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    
    /* Login Branding */
    --login-branding-bg: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* Dark Theme */
[data-theme="dark"] {
    /* Primary Colors */
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #a5b4fc;
    --primary-bg: rgba(129, 140, 248, 0.15);
    
    /* Background Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --bg-input: #1e293b;
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-inverse: #0f172a;
    
    /* Border Colors */
    --border-light: #334155;
    --border-medium: #475569;
    --border-dark: #64748b;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    
    /* Sidebar */
    --sidebar-bg: #0f172a;
    --sidebar-text: #e2e8f0;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(129, 140, 248, 0.2);
    
    /* Login Branding */
    --login-branding-bg: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    
    /* Adjusted status colors for dark mode */
    --danger-light: rgba(239, 68, 68, 0.2);
    --warning-light: rgba(245, 158, 11, 0.2);
    --success-light: rgba(16, 185, 129, 0.2);
    --info-light: rgba(59, 130, 246, 0.2);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ============================================
   LOGIN PAGE STYLES
   ============================================ */
.login-page {
    min-height: 100vh;
    background-color: var(--bg-secondary);
}

.login-container {
    display: flex;
    min-height: 100vh;
}

/* Login Branding Side */
.login-branding {
    flex: 1;
    background: var(--login-branding-bg);
    color: #ffffff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.login-branding::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.login-branding::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.branding-content {
    position: relative;
    z-index: 1;
}

.logo-large {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
}

.logo-large i {
    color: var(--primary-light);
    font-size: 2.5rem;
}

.login-branding h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.login-branding > .branding-content > p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 500px;
    margin-bottom: 3rem;
}

.features-preview {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, background 0.3s ease;
}

.feature-item:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.08);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.feature-text h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.feature-text p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.branding-footer {
    position: relative;
    z-index: 1;
}

.branding-footer p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Login Form Side */
.login-form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    background-color: var(--bg-primary);
    position: relative;
}

.theme-toggle-login {
    position: absolute;
    top: 2rem;
    right: 2rem;
}

.theme-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

.theme-btn:hover {
    background-color: var(--bg-hover);
    color: var(--primary);
    transform: rotate(15deg);
}

.login-form-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i:first-child {
    position: absolute;
    left: 1rem;
    color: var(--text-tertiary);
    font-size: 1rem;
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.input-wrapper input::placeholder {
    color: var(--text-tertiary);
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.toggle-password:hover {
    color: var(--primary);
    background-color: var(--primary-bg);
}

.toggle-password:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

.toggle-password:active {
    transform: scale(0.95);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-medium);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-wrapper input:checked + .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-wrapper input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.625rem;
    color: white;
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gradient-primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.5);
}

.btn-login i {
    transition: transform 0.3s ease;
}

.btn-login:hover i {
    transform: translateX(5px);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-light);
}

.login-divider span {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.social-login {
    display: flex;
    gap: 1rem;
}

.btn-social {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-social:hover {
    background-color: var(--bg-hover);
    border-color: var(--border-medium);
}

.btn-social.google:hover {
    border-color: #ea4335;
    color: #ea4335;
}

.btn-social.microsoft:hover {
    border-color: #00a4ef;
    color: #00a4ef;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
}

.login-footer p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.login-footer a {
    font-weight: 500;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 1.75rem;
    color: var(--primary-light);
}

.logo span {
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar.collapsed .logo span {
    display: none;
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
}

.sidebar.collapsed .nav-section-title {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--sidebar-text);
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
}

.nav-item.active {
    background-color: var(--sidebar-active);
    color: var(--primary-light);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--primary-light);
    border-radius: 0 3px 3px 0;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.125rem;
}

.nav-item span {
    font-size: 0.9375rem;
    font-weight: 500;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.nav-badge {
    margin-left: auto;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--danger);
    color: white;
    border-radius: 10px;
}

.sidebar.collapsed .nav-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.user-profile:hover {
    background-color: var(--sidebar-hover);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar.collapsed .user-info {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: 80px;
}

/* Top Header */
.top-header {
    background-color: var(--bg-primary);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-title p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.header-search {
    position: relative;
    width: 320px;
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.header-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

.header-btn:hover {
    background-color: var(--bg-hover);
    color: var(--primary);
}

.header-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--danger);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.header-avatar:hover {
    transform: scale(1.05);
}

/* Avatar Wrapper & Dropdown */
.avatar-wrapper {
    position: relative;
}

.avatar-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 240px;
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.avatar-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.avatar-dropdown-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.avatar-dropdown-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.avatar-dropdown-email {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

.avatar-dropdown-role {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
    margin-top: 0.25rem;
}

.avatar-dropdown-menu {
    padding: 0.5rem 0;
}

.avatar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.avatar-dropdown-item:hover {
    background-color: var(--bg-hover);
}

.avatar-dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--text-secondary);
}

.avatar-dropdown-item.logout {
    color: var(--danger);
    border-top: 1px solid var(--border-light);
    margin-top: 0.25rem;
    padding-top: 0.75rem;
}

.avatar-dropdown-item.logout i {
    color: var(--danger);
}

.avatar-dropdown-menu form {
    margin: 0;
}

.avatar-dropdown-menu form button.avatar-dropdown-item {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
}

.input-error {
    display: block;
    color: var(--danger);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

/* Alert Messages */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

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

.alert-danger p {
    margin: 0.25rem 0;
}

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

/* Button Danger */
.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

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

/* Page Content */
.page-content {
    padding: 2rem;
}

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

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

.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.stat-card-link:hover {
    border-color: var(--primary);
}

.stat-card-link:hover .stat-icon {
    transform: scale(1.1);
}

.stat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary {
    background-color: var(--primary-bg);
    color: var(--primary);
}

.stat-icon.success {
    background-color: var(--success-light);
    color: var(--success);
}

.stat-icon.warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.stat-icon.danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.stat-icon.info {
    background-color: var(--info-light);
    color: var(--info);
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.stat-trend.up {
    background-color: var(--success-light);
    color: var(--success);
}

.stat-trend.down {
    background-color: var(--danger-light);
    color: var(--danger);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============================================
   DATA TABLE
   ============================================ */
.table-container {
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.table-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 1rem;
}

.table-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-title h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.table-title .count {
    padding: 0.25rem 0.625rem;
    background-color: var(--primary-bg);
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 6px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background-color: var(--bg-hover);
    border-color: var(--border-medium);
}

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

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

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
}

/* Filters Bar */
.filters-bar {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: all 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 140px;
    transition: all 0.2s ease;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.filter-btn.apply {
    background-color: var(--primary);
    color: white;
}

.filter-btn.clear {
    background-color: transparent;
    color: var(--text-secondary);
}

.filter-btn.clear:hover {
    color: var(--danger);
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    color: var(--primary);
}

.data-table th .sort-icon {
    margin-left: 0.375rem;
    opacity: 0.5;
}

.data-table th.sorted .sort-icon {
    opacity: 1;
    color: var(--primary);
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: var(--bg-hover);
}

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

/* Table Cell Styles */
.tender-title {
    max-width: 300px;
}

.tender-title a {
    font-weight: 500;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}

.tender-title a:hover {
    color: var(--primary);
}

.tender-title .tender-id {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.country-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.country-badge .flag {
    font-size: 1rem;
}

.country-badge .fi {
    font-size: 1rem;
    border-radius: 2px;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.platform-badge.ted {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.platform-badge.boamp {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.platform-badge.germany {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.platform-badge.uk {
    background-color: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.budget-value {
    font-weight: 600;
    color: var(--text-primary);
}

.budget-value.high {
    color: var(--success);
}

.date-cell {
    white-space: nowrap;
}

.date-cell .date {
    font-weight: 500;
}

.date-cell .days-left {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.125rem;
}

.date-cell .days-left.urgent {
    color: var(--danger);
    font-weight: 500;
}

.date-cell .days-left.warning {
    color: var(--warning);
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
}

.score-badge.high {
    background-color: var(--success-light);
    color: var(--success);
}

.score-badge.medium {
    background-color: var(--warning-light);
    color: var(--warning);
}

.score-badge.low {
    background-color: var(--danger-light);
    color: var(--danger);
}

.score-badge.unscored {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px dashed var(--border-light);
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    background-color: transparent;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary);
}

.action-btn.favorite:hover {
    color: var(--warning);
}

.action-btn.favorite.active {
    color: var(--warning);
}

.action-btn.score-btn.unscored {
    color: var(--danger);
}

.action-btn.score-btn.unscored:hover {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* Checkbox Container */
.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.checkbox-container .checkmark {
    height: 18px;
    width: 18px;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-container .checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:indeterminate ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-container input:indeterminate ~ .checkmark:after {
    display: block;
    left: 3px;
    top: 7px;
    width: 10px;
    height: 2px;
    border: none;
    background-color: white;
    transform: none;
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-bg);
    border: 1px solid var(--primary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.bulk-actions-info {
    font-weight: 600;
    color: var(--primary);
}

.bulk-actions-buttons {
    display: flex;
    gap: 0.75rem;
}

/* Table Pagination */
.table-footer {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background-color: transparent;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.pagination-btn.active {
    background-color: var(--primary);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   DETAIL PAGE
   ============================================ */
.detail-header {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
}

.detail-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.detail-badges {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-item i {
    color: var(--text-tertiary);
}

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.detail-grid.settings-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Profile card - spans full width */
.profile-card {
    grid-column: span 2;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.detail-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.detail-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.detail-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-card-header h3 i {
    color: var(--primary);
}

.detail-card-body {
    padding: 1.5rem;
}

.description-text {
    color: var(--text-secondary);
    line-height: 1.7;
}

.description-text p {
    margin-bottom: 1rem;
}

.description-text p:last-child {
    margin-bottom: 0;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.info-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.info-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.info-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
}

.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-light);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary);
    border: 2px solid var(--bg-card);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
}

.timeline-content {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.notes-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notes-textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.875rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================
   ALERTS PAGE
   ============================================ */
.alerts-config {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.alert-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-light);
}

.alert-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.alert-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.alert-card-icon.email {
    background-color: var(--info-light);
    color: var(--info);
}

.alert-card-icon.urgent {
    background-color: var(--danger-light);
    color: var(--danger);
}

.alert-card-icon.deadline {
    background-color: var(--warning-light);
    color: var(--warning);
}

.alert-card-icon.keyword {
    background-color: var(--success-light);
    color: var(--success);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-medium);
    border-radius: 26px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.alert-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.alert-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.alert-config-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.config-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.config-row label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.config-row input,
.config-row select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.8125rem;
}

.config-row input {
    width: 120px;
}

/* Recent Alerts */
.recent-alerts {
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-light);
}

.alert-list {
    padding: 0;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
}

.alert-item:hover {
    background-color: var(--bg-hover);
}

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

.alert-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-item-icon.high-value {
    background-color: var(--danger-light);
    color: var(--danger);
}

.alert-item-icon.deadline {
    background-color: var(--warning-light);
    color: var(--warning);
}

.alert-item-icon.new {
    background-color: var(--info-light);
    color: var(--info);
}

.alert-item-content {
    flex: 1;
    min-width: 0;
}

.alert-item-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.alert-item-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.alert-item-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.alert-item-action {
    flex-shrink: 0;
}

/* ============================================
   STATISTICS PAGE
   ============================================ */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.chart-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.chart-card.full-width {
    grid-column: span 2;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-period {
    display: flex;
    gap: 0.25rem;
}

.period-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: transparent;
    transition: all 0.2s ease;
}

.period-btn:hover {
    background-color: var(--bg-hover);
}

.period-btn.active {
    background-color: var(--primary);
    color: white;
}

.chart-placeholder {
    height: 280px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

/* Stats Summary */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.summary-item {
    text-align: center;
}

.summary-item .summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-item .summary-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ============================================
   SUPER ADMIN - USERS PAGE
   ============================================ */
.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.users-stats {
    display: flex;
    gap: 1.5rem;
}

.user-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background-color: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.user-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.user-stat-icon.total {
    background-color: var(--primary-bg);
    color: var(--primary);
}

.user-stat-icon.active {
    background-color: var(--success-light);
    color: var(--success);
}

.user-stat-icon.inactive {
    background-color: var(--danger-light);
    color: var(--danger);
}

.user-stat-text .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.user-stat-text .label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-row .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
}

.user-row .user-info .name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-row .user-info .email {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Role Badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-badge.superadmin {
    background-color: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.role-badge.admin {
    background-color: var(--primary-bg);
    color: var(--primary);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background-color: var(--success-light);
    color: var(--success);
}

.status-badge.inactive {
    background-color: var(--danger-light);
    color: var(--danger);
}

.status-badge.read {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
}

.status-badge.unread {
    background-color: var(--primary-bg);
    color: var(--primary);
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    margin-right: 0.375rem;
}

/* Notification Type Icons */
.notification-type-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.notification-type-icon.new {
    background-color: var(--primary-bg);
    color: var(--primary);
}

.notification-type-icon.high-value {
    background-color: var(--warning-light);
    color: var(--warning);
}

.notification-type-icon.deadline {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* Unread row highlight */
.data-table tbody tr.unread-row {
    background-color: var(--primary-bg);
}

.data-table tbody tr.unread-row:hover {
    background-color: rgba(79, 70, 229, 0.1);
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--bg-card);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    background-color: transparent;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form Styles */
.form-row {
    margin-bottom: 1.25rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.3s ease;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-row select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.helper-text {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 0.375rem;
}

/* ============================================
   NOTIFICATIONS DROPDOWN
   ============================================ */
.notifications-wrapper {
    position: relative;
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 380px;
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xl);
    z-index: 100;
}

.notifications-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notifications-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notifications-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mark-all-read {
    font-size: 0.8125rem;
    color: var(--primary);
    background: none;
}

.mark-all-read:hover {
    text-decoration: underline;
}

.notifications-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    background-color: var(--bg-hover);
}

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

.notification-item.unread {
    background-color: var(--primary-bg);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notification-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.notifications-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.notifications-footer a {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-card.full-width {
        grid-column: span 1;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .alerts-config {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: none;
        width: 280px !important;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
    }
    
    /* Force full sidebar display in mobile (not collapsed) */
    .sidebar.collapsed {
        width: 280px !important;
    }
    
    .sidebar .logo span,
    .sidebar .nav-section-title,
    .sidebar .nav-item span,
    .sidebar .user-info {
        display: block !important;
    }
    
    .sidebar .nav-badge {
        position: static !important;
        padding: 0.125rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    .sidebar .sidebar-toggle {
        display: none;
    }
    
    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .header-search {
        display: none;
    }
    
    .login-branding {
        display: none;
    }
    
    .login-form-container {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .top-header {
        padding: 1rem;
    }
    
    .page-content {
        padding: 1rem;
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .table-title {
        width: 100%;
    }
    
    .table-actions {
        width: 100%;
    }
    
    .table-actions .header-search {
        width: 100% !important;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select,
    .filter-input {
        flex: 1;
        min-width: 0;
    }
    
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
    }
    
    .tender-title {
        min-width: 200px;
        max-width: 250px;
    }
    
    /* Users page responsive */
    .users-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .users-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    .users-stats {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .user-stat {
        flex: 1;
        min-width: calc(50% - 0.5rem);
    }
    
    .user-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .user-row .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    /* Alert cards tablet */
    .alert-card {
        padding: 1.25rem;
    }
    
    .config-row {
        flex-wrap: wrap;
    }
    
    /* Detail grid tablet */
    .detail-grid,
    .detail-grid.settings-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Profile card responsive */
    .profile-card {
        grid-column: span 1;
    }
    
    .profile-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Recent alerts */
    .recent-alerts {
        margin-top: 1.5rem;
    }
    
    /* Action buttons */
    .action-buttons {
        gap: 0.375rem;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
    }
    
    /* Stat cards responsive */
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .login-form-container {
        padding: 1.5rem;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .social-login {
        flex-direction: column;
    }
    
    .detail-header {
        padding: 1.25rem;
    }
    
    .detail-title {
        font-size: 1.25rem;
    }
    
    .detail-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .modal {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    /* Alert cards mobile */
    .alert-card {
        padding: 1rem;
    }
    
    .alert-card h4 {
        font-size: 1rem;
    }
    
    .alert-config-options {
        gap: 0.75rem;
    }
    
    .config-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
    }
    
    .config-row input,
    .config-row select {
        width: 100% !important;
    }
    
    /* Table actions mobile */
    .table-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .table-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Pagination mobile */
    .table-footer {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .pagination-info {
        text-align: center;
        font-size: 0.8125rem;
    }
    
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.8125rem;
    }
    
    /* Header mobile adjustments */
    .page-title h1 {
        font-size: 1.25rem;
    }
    
    .page-title p {
        font-size: 0.75rem;
    }
    
    .header-right {
        gap: 0.5rem;
    }
    
    .header-btn {
        width: 38px;
        height: 38px;
    }
    
    .header-avatar {
        width: 38px;
        height: 38px;
    }
    
    /* Stats summary mobile */
    .stats-summary {
        grid-template-columns: 1fr !important;
    }
    
    /* Detail card mobile */
    .detail-card {
        padding: 1rem;
    }
    
    .detail-card-header h3 {
        font-size: 1rem;
    }
    
    /* Alert list mobile */
    .alert-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .alert-item-action {
        width: 100%;
    }
    
    .alert-item-action .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Users stats mobile */
    .user-stat {
        min-width: 100%;
    }
    
    .users-stats {
        flex-direction: column;
    }
    
    /* Detail card mobile */
    .detail-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .detail-card-header h3 {
        font-size: 0.9375rem;
    }
    
    /* Settings platform cards */
    .platform-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .platform-item .toggle-switch {
        align-self: flex-end;
    }
    
    /* Form rows in settings */
    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-row label {
        min-width: auto;
    }
    
    .form-row input,
    .form-row select {
        width: 100%;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .page-content {
        padding: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .filter-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.bg-primary { background-color: var(--primary); }
.bg-success { background-color: var(--success); }
.bg-danger { background-color: var(--danger); }
.bg-warning { background-color: var(--warning); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

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

/* Table Row Hover Animation */
.data-table tbody tr {
    animation: fadeIn 0.3s ease forwards;
}

.data-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.data-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.data-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.data-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.data-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.data-table tbody tr:nth-child(6) { animation-delay: 0.3s; }
.data-table tbody tr:nth-child(7) { animation-delay: 0.35s; }
.data-table tbody tr:nth-child(8) { animation-delay: 0.4s; }
.data-table tbody tr:nth-child(9) { animation-delay: 0.45s; }
.data-table tbody tr:nth-child(10) { animation-delay: 0.5s; }

/* Stat Cards Animation */
.stat-card {
    animation: fadeIn 0.4s ease forwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background-color: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s ease forwards;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.toast.success .toast-icon {
    background-color: var(--success-light);
    color: var(--success);
}

.toast.error .toast-icon {
    background-color: var(--danger-light);
    color: var(--danger);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    color: var(--text-tertiary);
    font-size: 1rem;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: var(--text-primary);
}
