/* VTrack Global Styles */

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

html {
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
}

body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: var(--light-gray);
}

/* Ensure no top margins on any elements */
h1, h2, h3, h4, h5, h6, p, div, header, main, section {
    margin-top: 0 !important;
}

:root {
    /* Color Palette */
    --navy-blue: #0A2647;
    --royal-blue: #144272;
    --medium-blue: #205295;
    --success-green: #4CAF50;
    --alert-red: #FF6B6B;
    --info-blue: #2196F3;
    --warning-amber: #FFC107;
    
    /* Additional Colors */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #6c757d;
    --dark-gray: #343a40;
    --black: #000000;
    
    /* Sidebar specific colors */
    --sidebar-bg: var(--navy-blue);
    --sidebar-hover: var(--royal-blue);
    --sidebar-active: var(--medium-blue);
    --sidebar-text: rgba(255, 255, 255, 0.9);
    --sidebar-text-muted: rgba(255, 255, 255, 0.6);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    
    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, 
        var(--navy-blue) 0%, 
        rgba(10, 38, 71, 0.98) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
    box-shadow: 
        4px 0 24px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
}

.sidebar-header {
    padding: 2rem var(--spacing-lg) 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0.02) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.sidebar-logo-large {
    width: 80px !important;
    height: 80px !important;
    max-width: none !important;
    max-height: none !important;
}

.user-role-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
}

.sidebar-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin: 0;
    line-height: 1.2;
}

.sidebar-brand p {
    font-size: 0.75rem;
    color: var(--sidebar-text-muted);
    margin: 0;
    line-height: 1.2;
}

.sidebar-nav {
    flex: 1;
    padding: 0 var(--spacing-md);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 0.875rem var(--spacing-lg);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    margin: 4px 0;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(135deg, 
        var(--royal-blue) 0%, 
        rgba(20, 66, 114, 0.8) 100%);
    transition: width var(--transition-fast);
    border-radius: 0 12px 12px 0;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    transform: translateX(4px);
}

.sidebar-nav a:hover::before {
    width: 4px;
}

.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-nav a.active::before {
    width: 4px;
    background: rgba(255, 255, 255, 0.9);
}

.sidebar-nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: transform var(--transition-fast);
}

.sidebar-nav a:hover .sidebar-nav-icon {
    transform: scale(1.1);
}

.sidebar-nav a.active .sidebar-nav-icon {
    transform: scale(1.05);
}

.nav-section-header {
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-sm) var(--spacing-lg);
    margin-top: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: var(--spacing-sm);
}

.nav-section-header:first-child {
    margin-top: 0;
}

.nav-section-header span {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sidebar-text-muted);
}


/* Top Header Styles */
.top-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 24px 32px;
    position: fixed !important;
    top: 0 !important;
    left: 280px !important;
    right: 0 !important;
    z-index: 9999 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 0 !important;
    transform: translateY(0) !important;
    min-height: 80px;
    display: flex;
    align-items: center;
    width: calc(100% - 280px);
}

.top-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.top-header-title {
    flex: 1;
}

.top-header-title h1 {
    font-size: 20px;
    font-weight: 500;
    color: #1f2937;
    margin: 0;
    letter-spacing: -0.025em;
}

.top-header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.page-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
    flex-shrink: 0;
}

.page-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.page-details h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.page-subtitle {
    color: #6b7280;
    font-size: 15px;
    margin: 2px 0 0 0;
    font-weight: 400;
    line-height: 1.2;
}

.top-header-breadcrumb {
    font-size: 0.8rem;
    color: var(--gray);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.top-header-breadcrumb i {
    font-size: 0.7rem;
    opacity: 0.6;
}

.top-header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Header Action Button */
.header-action-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 255, 255, 0.6) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-md);
    color: var(--gray);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-action-btn:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 255, 255, 0.7) 100%);
    color: var(--dark-gray);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--alert-red);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 255, 255, 0.6) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 200px;
}

.user-dropdown-trigger:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 255, 255, 0.7) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-dropdown-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        var(--navy-blue) 0%, 
        var(--medium-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(10, 38, 71, 0.2);
    overflow: hidden;
    position: relative;
}

.user-dropdown-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: inherit;
    color: inherit;
    font-weight: inherit;
    font-size: inherit;
}

.user-dropdown-info {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.user-dropdown-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.user-dropdown-role {
    display: block;
    font-size: 0.75rem;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.user-dropdown-arrow {
    font-size: 0.8rem;
    color: var(--gray);
    transition: transform var(--transition-fast);
}

.user-dropdown-trigger:hover .user-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-md);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--dark-gray);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    border-radius: 0;
}

.dropdown-item:first-child {
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
}

.dropdown-item:hover {
    background: linear-gradient(135deg, 
        rgba(10, 38, 71, 0.1) 0%, 
        rgba(20, 66, 114, 0.05) 100%);
    color: var(--navy-blue);
}

.dropdown-item i {
    width: 16px;
    font-size: 0.9rem;
}

.dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
    margin: var(--spacing-xs) 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    margin-top: 88px;
    min-height: calc(100vh - 88px);
    display: flex;
    flex-direction: column;
    padding: 0;
}

.main-body {
    flex: 1;
    padding: var(--spacing-xl);
    padding-top: calc(var(--spacing-xl) + 88px);
}

/* Mobile Responsive */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: var(--spacing-lg);
    left: var(--spacing-lg);
    z-index: 1001;
    background: var(--sidebar-bg);
    color: var(--white);
    border: none;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .page-header-info {
        gap: 12px;
    }
    
    .page-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .page-details h1 {
        font-size: 20px;
    }
    
    .page-subtitle {
        font-size: 13px;
    }
    
    .top-header {
        padding: 16px 20px;
        left: 0 !important;
    }
    
    .main-content {
        margin-left: 0;
        margin-top: 70px;
        min-height: calc(100vh - 70px);
    }
    
    .sidebar-toggle {
        top: 20px;
        display: block;
    }
    
    .user-dropdown-trigger {
        min-width: auto;
    }
    
    .user-dropdown-info {
        display: none;
    }
    
    .user-dropdown-menu {
        right: auto;
        left: 0;
        min-width: 180px;
    }
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, #E6F0FF 0%, #ffffff 100%);
}

.login-form-container {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: var(--border-radius-xl);
    padding: var(--spacing-xxl);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.login-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: var(--spacing-md);
}

.login-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #0055DD;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.025em;
}

.login-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 400;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
    color: #374151;
}

.form-input:focus {
    outline: none;
    border-color: #0055DD;
    box-shadow: 0 0 0 3px rgba(0, 85, 221, 0.1);
}

.form-input:hover {
    border-color: #9ca3af;
}

/* Ensure all form elements have proper text color */
input, textarea, select {
    color: #374151;
}

input::placeholder, textarea::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Fix for date/time inputs */
input[type="date"], input[type="datetime-local"], input[type="time"] {
    color: #374151;
}

/* Fix for number inputs */
input[type="number"] {
    color: #374151;
}

/* Fix for select dropdowns */
select option {
    color: #374151;
    background: white;
}

/* Ensure form elements in modals and containers have proper colors */
.modal .form-input,
.card .form-input,
.form-card .form-input {
    color: #374151 !important;
    background: white !important;
}

/* Fix for disabled inputs */
.form-input:disabled {
    color: #6b7280;
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

/* Fix for readonly inputs */
.form-input:read-only {
    color: #374151;
    background-color: #f9fafb;
}

.btn {
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

/* Action button fixes for tables */
.action-buttons .btn {
    min-width: 32px;
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #0055DD;
    color: white;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: #0044BB;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 85, 221, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 85, 221, 0.3);
}

.btn-secondary {
    background: var(--white);
    color: var(--medium-blue);
    border: 2px solid var(--medium-blue);
}

.btn-secondary:hover {
    background: var(--medium-blue);
    color: var(--white);
}

.alert {
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-lg);
    font-size: 0.9rem;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-green);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    color: var(--info-blue);
    border: 1px solid rgba(33, 150, 243, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: var(--spacing-md);
    }
    
    .login-form-container {
        max-width: 100%;
        padding: var(--spacing-lg);
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

/* Card Component */
.card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header {
    padding: var(--spacing-lg);
    background: var(--light-gray);
    border-bottom: 1px solid #e1e5e9;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-lg);
    background: var(--light-gray);
    border-top: 1px solid #e1e5e9;
} 