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

:root {
    /* Color Palette - Premium Slate & Emerald */
    --primary: #10b981; /* Emerald 500 */
    --primary-dark: #059669;
    --primary-light: #d1fae5;
    --secondary: #6366f1; /* Indigo 500 */
    --accent: #f59e0b; /* Amber 500 */
    
    --bg-main: #f8fafc; /* Slate 50 */
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b; /* Slate 800 */
    
    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
    --text-light: #94a3b8; /* Slate 400 */
    --text-white: #ffffff;
    
    --border: #e2e8f0; /* Slate 200 */
    --border-light: #f1f5f9; /* Slate 100 */
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Utilities */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Button Refinements */
.btn {
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success {
    background-color: #10b981;
    border-color: #10b981;
}

/* Card Styling */
.card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: 1.25rem;
}

/* Navigation Overhaul */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column; /* Fixed typo from previous flex-column */
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-logo {
    padding: 2.5rem 1.5rem;
    font-weight: 800;
    font-size: 1.4rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.02em;
}

.sidebar-logo i {
    color: var(--primary);
    font-size: 1.8rem;
    line-height: 1;
}

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

.nav-group-label {
    padding: 1.75rem 0.75rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8; /* Increased brightness for contrast */
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: #cbd5e1; /* Brighter default text */
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 0.2rem;
    font-size: 0.925rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-link i {
    font-size: 1.25rem;
    opacity: 0.7;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-link:hover i {
    opacity: 1;
}

.sidebar-link.active {
    background-color: rgba(16, 185, 129, 0.15); /* Soft background tint */
    color: var(--primary); /* Text becomes primary color */
    font-weight: 600;
    border-left: 3px solid var(--primary);
    border-radius: 0 10px 10px 0; /* Align with border */
    margin-left: -1rem; /* Full span to the left */
    padding-left: calc(1rem - 3px);
}

.sidebar-link.active i {
    color: var(--primary);
    opacity: 1;
}

.main-content {
    flex-grow: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar-profile {
    padding: 1.5rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.2);
}

.sidebar-profile .name {
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.sidebar-profile .role {
    color: #94a3b8;
    font-size: 0.75rem;
}

.top-bar {
    height: 64px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.nav-link-studio {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link-studio:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.nav-link-studio.active {
    color: var(--primary);
    font-weight: 600;
}

/* Page Container */
.content-wrapper {
    padding: 2rem;
}

/* Inputs */
.form-control {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 0.6rem 1rem;
    transition: var(--transition);
    background-color: #fcfdfe;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    background-color: white;
}

/* Badge Styles */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 600;
    border-radius: 6px;
}

.badge-soft-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-soft-success { background: #d1fae5; color: #065f46; }
.badge-soft-warning { background: #fef3c7; color: #92400e; }
.badge-soft-danger { background: #fee2e2; color: #991b1b; }

/* Soft Background Utilities */
.bg-primary-soft { background-color: rgba(16, 185, 129, 0.1) !important; }
.bg-success-soft { background-color: rgba(16, 185, 129, 0.1) !important; }
.bg-info-soft { background-color: rgba(99, 102, 241, 0.1) !important; }
.bg-danger-soft { background-color: rgba(239, 68, 68, 0.1) !important; }
.bg-warning-soft { background-color: rgba(245, 158, 11, 0.1) !important; }

/* Timeline Card Enhancements */
.timeline-card .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-card:hover .card {
    transform: translateX(5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

.modern-timeline {
    position: relative;
    padding-left: 1rem;
    border-left: 2px dashed var(--border);
}

.timeline-card::before {
    content: '';
    position: absolute;
    left: -1.4rem;
    top: 2rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid white;
    box-shadow: 0 0 0 4px var(--primary-light);
    z-index: 1;
}

/* --- PRINT STYLES --- */
@media print {
    /* Hide layout chrome and non-printable elements */
    .sidebar, 
    .top-bar, 
    .no-print, 
    .btn, 
    .breadcrumb, 
    .modal, 
    .toast-container, 
    .alert,
    .sidebar-profile {
        display: none !important;
    }

    /* Reset main content for full page usage */
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    .content-wrapper,
    .container,
    .container-fluid {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Force background colors/images to print (browsers usually disable this) */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Typography adjustments */
    body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
        overflow: visible !important;
    }

    h1, h2, h3, h4, h5, h6 {
        color: black !important;
    }

    /* Remove shadows for cleaner print */
    .card, .shadow, .shadow-sm, .shadow-lg {
        box-shadow: none !important;
        border: 1px solid #eee !important;
        break-inside: avoid;
    }

    /* Table optimization */
    .table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .table th, .table td {
        border: 1px solid #dee2e6 !important;
        padding: 8px !important;
    }

    /* Header for printed documents */
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 2rem;
        border-bottom: 2px solid #333;
        padding-bottom: 1rem;
    }

    /* Signature lines */
    .print-footer {
        display: block !important;
        margin-top: 3rem;
        padding-top: 1rem;
        border-top: 1px solid #ccc;
    }

    .signature-area {
        margin-top: 2rem;
        display: flex;
        justify-content: space-between;
    }

    .signature-line {
        border-top: 1px solid #000;
        width: 200px;
        text-align: center;
        padding-top: 5px;
        margin-top: 50px;
    }
}

/* Hide print-only elements by default on screen */
.print-header,
.print-footer {
    display: none;
}

/* Dashboard Widgets */
.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}