:root {
    --primary-color: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-bg: #f1f5f9;
    --dark-bg: #0f172a;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --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);
}

* {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    padding-top: 56px;
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

body, p, span, div, a, button, input, select, textarea, label, th, td {
    font-size: 12px;
    min-font-size: 12px;
}

small, .small {
    font-size: 10px !important;
}

h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.75rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }
h5 { font-size: 1.1rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

.enterprise-navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-md);
    padding: 0.75rem 1.5rem;
    border-bottom: 3px solid var(--primary-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030 !important;
    width: 100%;
    height: 56px;
    box-sizing: border-box;
}

.enterprise-brand {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
    color: #ffffff !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Montserrat', sans-serif;
}

.enterprise-brand i {
    font-size: 1.5rem;
}

/* Navbar user info and logout alignment */
.enterprise-navbar .navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.enterprise-navbar .nav-item {
    display: flex;
    align-items: center;
}

.enterprise-navbar .navbar-text {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.enterprise-navbar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s;
}

.enterprise-navbar .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.enterprise-brand img {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.sidebar {
    min-height: calc(100vh - 56px);
    width: 250px;
    position: fixed !important;
    left: 0 !important;
    top: 56px !important;
    padding: 0;
    z-index: 1020 !important;
    transition: width 0.3s ease;
    overflow-y: auto;
    overflow-x: visible !important;
    background-color: #212529;
}

.sidebar-header {
    padding: 12px 16px !important;
    background-color: rgba(0, 0, 0, 0.3) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 100%;
    box-sizing: border-box;
}

.sidebar-header h5 {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    padding: 0;
    color: white !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    display: block;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .nav-text {
    display: none !important;
}

.sidebar.collapsed .sidebar-header h5 {
    font-size: 0;
    opacity: 0;
}

.sidebar-toggle-btn {
    position: fixed !important;
    left: 235px !important;
    top: 66px !important;
    transform: none !important;
    z-index: 1060 !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--primary-color) !important;
    border: 2px solid white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    cursor: pointer !important;
}

.sidebar.collapsed ~ .sidebar-toggle-btn,
.sidebar.collapsed .sidebar-toggle-btn {
    left: 55px !important;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    border-left: 3px solid transparent;
    transition: all 0.3s;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .nav-link i {
    font-size: 14px;
    min-width: 20px;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: var(--primary-color);
}

.main-content {
    margin-left: 250px !important;
    padding: 25px 25px 20px 25px;
    padding-top: 25px !important;
    min-height: calc(100vh - 56px);
    transition: margin-left 0.3s ease, width 0.3s ease;
    width: calc(100% - 250px) !important;
    position: relative;
    z-index: 1 !important;
    box-sizing: border-box;
    display: block !important;
    margin-top: 0 !important;
    float: none !important;
    clear: none !important;
}

/* Ensure proper spacing for first elements */
.main-content > h2:first-child,
.main-content > .d-flex:first-child {
    margin-top: 0;
    margin-bottom: 20px;
}

.main-content > .card:first-child {
    margin-top: 0;
}

body:has(.sidebar.collapsed) .main-content,
.sidebar.collapsed ~ .main-content {
    margin-left: 70px !important;
    width: calc(100% - 70px) !important;
}

.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    background: var(--card-bg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 0;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--primary-light);
}

/* Base button styles - smaller and compact */
.btn {
    border-radius: 4px;
    padding: 6px 12px;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 11px;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 28px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 10px;
    min-height: 24px;
    gap: 4px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 10px;
    min-height: 22px;
    gap: 3px;
}

/* Icon-only buttons */
.btn-icon-only {
    padding: 6px !important;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-only i {
    margin: 0 !important;
    font-size: 12px;
}

.btn-sm.btn-icon-only {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 4px !important;
}

.btn-sm.btn-icon-only i {
    font-size: 11px;
}

.btn-xs.btn-icon-only {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    padding: 3px !important;
}

.btn-xs.btn-icon-only i {
    font-size: 10px;
}

/* Remove text from icon-only buttons */
.btn-icon-only .btn-text,
.btn-icon-only span:not(.bi):not([class*="icon"]),
.btn-icon-only:not(:has(i)) {
    display: none !important;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* Button variants - ensure they don't override */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

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

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

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

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

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

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

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

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

.btn-outline-danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
    background-color: transparent;
}

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

.btn-outline-success {
    border-color: var(--success-color);
    color: var(--success-color);
    background-color: transparent;
}

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

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    background-color: transparent;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: white;
    color: white;
}

.table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
    font-size: 12px;
}

.table th, .table td {
    font-size: 12px;
    padding: 10px 12px;
}

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

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.badge {
    padding: 6px 12px;
    font-weight: 500;
    border-radius: 20px;
    font-size: 11px;
}

.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.stats-card.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stats-card.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stats-card.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 10px 15px;
    font-size: 12px;
}

.form-label {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.alert {
    border-radius: 8px;
    border: none;
}

.print-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
}

footer {
    margin-left: 250px !important;
    transition: margin-left 0.3s ease;
    width: calc(100% - 250px) !important;
    box-sizing: border-box;
    clear: both !important;
}

body:has(.sidebar.collapsed) footer {
    margin-left: 70px !important;
    width: calc(100% - 70px) !important;
}

@media print {
    .no-print {
        display: none !important;
    }
    
    .print-section {
        box-shadow: none;
        padding: 20px;
    }
    
    body {
        background: white;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 56px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 250px;
        position: fixed;
        z-index: 1040;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 70px;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 15px !important;
    }
    
    footer {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .sidebar-toggle-btn {
        top: 10px !important;
    }
}

/* Lifecycle Step Styles */
.lifecycle-step {
    transition: all 0.3s ease !important;
}

.lifecycle-step:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.lifecycle-step[style*="cursor: pointer"]:hover {
    opacity: 0.9;
}

.lifecycle-step[style*="cursor: not-allowed"]:hover {
    opacity: 0.7;
}
