:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --indigo: #6366f1;
    --bg: #f1f5f9;
    --card-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --card-shadow-hover: 0 4px 6px rgba(0,0,0,.07), 0 10px 15px rgba(0,0,0,.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: #1e293b;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #1d4ed8 100%);
}

.logo-icon {
    width: 72px;
    height: 72px;
    background: var(--primary-light);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform .3s ease;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand h4 {
    color: #fff;
    font-weight: 700;
    letter-spacing: -.5px;
}

.sidebar-brand small {
    color: rgba(255,255,255,.5);
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-item {
    margin: 2px 0;
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,.65);
    padding: .65rem 1.5rem;
    font-size: .875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.05);
    border-left-color: rgba(255,255,255,.2);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(37,99,235,.2);
    border-left-color: var(--primary);
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,.08);
}

.main-content {
    margin-left: 260px;
    min-height: 100vh;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: .75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.page-content {
    padding: 1.5rem;
}

.stat-card {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: all .2s;
    overflow: hidden;
}

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

.stat-card .card-body {
    padding: 1.25rem;
}

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

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}

.stat-label {
    font-size: .8rem;
    color: var(--secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.card-custom {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.card-custom .card-header {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .85rem;
    color: #fff;
    flex-shrink: 0;
}

.progress-bar-custom {
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
}

.progress-bar-custom .progress-bar {
    border-radius: 4px;
}

.badge {
    font-weight: 500;
    padding: .35em .65em;
    font-size: .75rem;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: .5rem 1rem;
    font-size: .875rem;
    transition: all .2s;
}

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

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

.form-control, .form-select {
    border-radius: 8px;
    border-color: #e2e8f0;
    font-size: .875rem;
    padding: .5rem .75rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.input-group-text {
    border-radius: 8px;
    border-color: #e2e8f0;
}

.table {
    font-size: .875rem;
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    font-size: .7rem;
    letter-spacing: .5px;
    padding: .75rem 1rem;
    border-bottom: 2px solid #f1f5f9;
}

.table td {
    padding: .75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f8fafc;
}

.table tr:hover td {
    background: #f8fafc;
}

.nav-tabs .nav-link {
    color: var(--secondary);
    font-weight: 500;
    font-size: .875rem;
    border: none;
    padding: .75rem 1rem;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border: none;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    background: transparent;
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: .5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: .35rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: #fff;
}

.timeline-item .time {
    font-size: .75rem;
    color: var(--secondary);
}

.fc { font-size: .875rem; }
.fc .fc-toolbar-title { font-size: 1.1rem; font-weight: 600; }
.fc .fc-button { border-radius: 8px !important; padding: .35rem .75rem !important; font-size: .8rem !important; }
.fc .fc-button-primary { background: var(--primary) !important; border-color: var(--primary) !important; }
.fc .fc-daygrid-day { cursor: pointer; }
.fc .fc-daygrid-day:hover { background: #f8fafc; }
.fc .fc-event { border-radius: 6px; padding: 3px 6px; font-size: .8rem; cursor: pointer; }

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 999;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .page-content {
        padding: 1rem;
    }
    .stat-value {
        font-size: 1.4rem;
    }
}

@media (min-width: 769px) {
    .sidebar-toggle, .sidebar-overlay {
        display: none !important;
    }
}

.list-group-item-action {
    cursor: pointer;
    border-radius: 8px !important;
    border: 1px solid #f1f5f9;
    margin-bottom: 4px;
}

.list-group-item-action:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 0;
}

.checklist-item .form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    border: 2px solid #cbd5e1;
}

.checklist-item .form-check-input:checked {
    background-color: var(--success);
    border-color: var(--success);
}

.checklist-item .form-check-label {
    cursor: pointer;
    font-size: .9rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: .5;
}

.alert-card {
    border-left: 4px solid;
    border-radius: 8px;
    background: #fff;
    padding: 1rem;
    margin-bottom: .5rem;
    box-shadow: var(--card-shadow);
}

.alert-card.alert-warning-custom { border-left-color: var(--warning); }
.alert-card.alert-danger-custom { border-left-color: var(--danger); }
.alert-card.alert-info-custom { border-left-color: var(--info); }

.animate-in {
    animation: fadeInUp .3s ease;
}

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