:root {
    /* CDERL.org Color Palette */
    --primary: #F39220;
    /* CDERL Orange */
    --primary-hover: #E67E00;
    --secondary: #00529B;
    /* Institutional Blue */
    --accent: #F39220;
    --bg-main: #F8F7F5;
    /* Off-white background */
    --bg-card: #FFFFFF;
    --text-main: #3C3C3B;
    /* Dark grey heading text */
    --text-muted: #64748B;
    /* Slate body text */
    --border: #E2E8F0;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* Shadows */
    --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);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

h1,
h2,
h3,
htag,
.sidebar-brand {
    font-family: 'Inter', sans-serif;
    /* Fallback from Century Gothic if not available, but using Poppins for modern look */
    font-weight: 800;
    color: var(--text-main);
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

input,
select,
textarea {
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    width: 100%;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(243, 146, 32, 0.15);
    outline: none;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: #FFFFFF;
    /* White sidebar */
    border-right: 1px solid var(--border);
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    padding-left: 0.5rem;
}

.sidebar-brand {
    padding: 2.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    color: var(--secondary);
    letter-spacing: -0.5px;
}

.logo-container img {
    height: 32px;
}

.logo-container span {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    letter-spacing: -0.025em;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.875rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    border-right: 3px solid transparent;
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(243, 146, 32, 0.05);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

/* Sidebar Footer */
.sidebar .nav-links {
    flex: 1;
    overflow-y: auto;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.sidebar-user-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #fee2e2;
    border-color: #f87171;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.title-group h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
}

.title-group p {
    color: var(--text-muted);
}

/* Cards & Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.stat-info .stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Specialized Views */
.view-container {
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
    display: none;
}

.view-container.active {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(243, 146, 32, 0.39);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 146, 32, 0.23);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-main);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.39);
}

.btn-success:hover {
    background: #059669;
    /* Emerald 600 */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.23);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.39);
}

.btn-danger:hover {
    background: #DC2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.23);
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--bg-main);
    padding: 1rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status-draft {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
}

.status-published {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.donor-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid currentColor;
}

.donor-ue {
    color: #003399;
}

.donor-usaid {
    color: #BA0C2F;
}

.donor-aecid {
    color: #E4002B;
}

/* Approval Timeline */
.approval-flow {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.approval-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.approval-status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Candidate Grid */
.candidate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.candidate-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}

.candidate-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.candidate-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.candidate-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
}

.score-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Evaluation & Hiring Styles */
.eval-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.score-input {
    width: 80px;
    text-align: center;
    font-weight: 700;
}

.doc-upload-list {
    display: grid;
    gap: 0.75rem;
}

.doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-main);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
}

.doc-status-ok {
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.contract-preview {
    padding: 2rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: 'Times New Roman', serif;
    color: #333;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}

.notif-bubble {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.notif-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.notif-info {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* Induction & Performance Styles */
.induction-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

.mission-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.onboarding-list {
    display: grid;
    gap: 1rem;
}

.onboarding-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.onboarding-item:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.02);
}

.onboarding-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    accent-color: var(--primary);
}

.performance-meter {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.meter-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.6s ease-out;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.team-member {
    text-align: center;
    padding: 1rem;
    background: var(--bg-main);
    border-radius: var(--radius-md);
}

.team-member img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
}

/* Strengthening (Fortalecimiento) Styles */
.training-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.training-card {
    background: var(--bg-card);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-tag {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.certificate-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--secondary);
    font-weight: 600;
}

.plan-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.plan-item:last-child {
    border-bottom: none;
}

/* Certificate & Scheduler Styles */
.certificate-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.certificate-canvas {
    width: 800px;
    height: 600px;
    background: white;
    padding: 3rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 20px solid var(--border);
    background-image: url('https://www.transparenttextures.com/patterns/white-paper.png');
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-family: 'Times New Roman', serif;
}

.cert-border-inner {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 10px;
    right: 10px;
    border: 2px solid var(--primary);
    pointer-events: none;
}

.cert-logo {
    margin-bottom: 2rem;
}

.cert-title {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 2rem;
    font-weight: bold;
}

.cert-text {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #444;
}

.cert-name {
    font-size: 2.5rem;
    text-decoration: underline;
    margin-bottom: 2rem;
    color: #111;
}

.cert-course {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 3rem;
}

.cert-footer {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: auto;
}

.cert-sig {
    border-top: 1px solid #333;
    padding-top: 0.5rem;
    width: 200px;
    font-size: 0.8rem;
}

/* Scheduler Table */
.schedule-manager {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.schedule-month {
    padding: 1rem;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.schedule-month-name {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.25rem;
}

.schedule-event {
    font-size: 0.75rem;
    background: white;
    padding: 0.4rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    border-left: 3px solid var(--secondary);
}

/* Forms & Steppers */
.step-container {
    max-width: 800px;
    margin: 0 auto;
}

.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.stepper::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-main);
    padding: 0 1rem;
}

.step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
}

.step.active .step-circle {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.step.completed .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.step.active .step-label {
    color: var(--primary);
}

/* Form Elements */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Premium Glassmorphism */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-md);
}

/* Generic Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    /* Changed from center to align top */
    overflow-y: auto;
    padding: 2rem;
    padding-top: 5vh;
    /* Reduce top spacing */
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 900px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Select */
.header-select {
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: white;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    min-width: 240px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: var(--shadow-sm);
}

.header-select:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(243, 146, 32, 0.1);
}

.header-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(243, 146, 32, 0.2);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
    min-width: 300px;
    max-width: 450px;
    border-left: 6px solid;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    color: #15803d;
    border-color: #22c55e;
}

.toast-success .toast-icon {
    background: #dcfce7;
    color: #16a34a;
}

.toast-error {
    color: #b91c1c;
    border-color: #ef4444;
}

.toast-error .toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.toast-info {
    color: #1d4ed8;
    border-color: #3b82f6;
}

.toast-info .toast-icon {
    background: #dbeafe;
    color: #2563eb;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
}

/* Premium Dropdown Styling - Professional Redesign */
.custom-dd-btn {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 52px;
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.custom-dd-btn:hover {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 4px 12px rgba(243, 146, 32, 0.08);
}

.custom-dd-btn:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(243, 146, 32, 0.12);
}

.custom-dd-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 10px;
    flex-direction: column;
    gap: 6px;
    animation: slideUpFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-dd-menu::-webkit-scrollbar {
    width: 5px;
}

.custom-dd-menu::-webkit-scrollbar-track {
    background: transparent;
}

.custom-dd-menu::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 20px;
}

.custom-dd-label {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    cursor: pointer !important;
    font-size: 0.875rem !important;
    padding: 10px 14px !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    margin: 0 !important;
    color: #475569 !important;
    font-weight: 500 !important;
    position: relative;
    user-select: none;
}

.custom-dd-label:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.custom-dd-label:active {
    transform: scale(0.98);
}

/* Custom UI Checkbox - Professional Style */
.custom-dd-label input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    flex-shrink: 0 !important;
    width: 22px !important;
    height: 22px !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 7px !important;
    background: #ffffff !important;
    cursor: pointer !important;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.custom-dd-label input[type="checkbox"]:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 8px rgba(243, 146, 32, 0.25);
}

.custom-dd-label input[type="checkbox"]:checked::after {
    content: '';
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) translate(-1px, -1px);
    display: block;
}

.custom-dd-label input[type="checkbox"]:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.custom-dd-label input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(243, 146, 32, 0.15);
}

/* Selected state for the whole label row */
.custom-dd-label:has(input:checked) {
    background-color: rgba(243, 146, 32, 0.05);
    color: var(--primary);
}

.custom-dd-label:has(input:checked):hover {
    background-color: rgba(243, 146, 32, 0.08);
}

/* Ficha Integral Accordion Styles */
.ficha-section {
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.ficha-section:hover:not([open]) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(243, 146, 32, 0.3);
}

.ficha-section[open] {
    box-shadow: 0 10px 25px -5px rgba(243, 146, 32, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    border-color: var(--border);
    border-left: 4px solid var(--primary);
    overflow: visible;
    position: relative;
    z-index: 50;
}

.ficha-section summary {
    padding: 1.15rem 1.5rem;
    font-weight: 600;
    color: var(--secondary);
    background: linear-gradient(to right, #ffffff, #fafbfe);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.ficha-section summary::-webkit-details-marker {
    display: none;
}

.ficha-section summary:hover {
    color: var(--primary);
    background: linear-gradient(to right, #fafbfe, #f5f8ff);
}

.ficha-section[open] summary {
    border-bottom-color: var(--border);
    background: linear-gradient(to right, rgba(243, 146, 32, 0.03), rgba(243, 146, 32, 0.005));
    color: var(--primary);
}

.ficha-section summary::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.3s ease, border-color 0.3s ease;
    margin-right: 0.5rem;
}

.ficha-section[open] summary::after {
    transform: rotate(-135deg);
    border-color: var(--primary);
}

.ficha-content {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: #ffffff;
}

.ficha-content input,
.ficha-content select,
.ficha-content textarea {
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    color: var(--text-main);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.ficha-content select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    padding-right: 2.5rem !important;
}

.ficha-content input:hover,
.ficha-content select:hover,
.ficha-content textarea:hover {
    border-color: #94a3b8;
    background-color: #ffffff;
}

.ficha-content input:focus,
.ficha-content select:focus,
.ficha-content textarea:focus {
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(243, 146, 32, 0.12), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.ficha-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.ficha-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.ficha-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.form-label {
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .ficha-grid-2, .ficha-grid-3, .ficha-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Ficha validation shake animation */
@keyframes ficha-shake {
    0%   { transform: translateX(0); }
    15%  { transform: translateX(-7px); }
    30%  { transform: translateX(6px); }
    45%  { transform: translateX(-5px); }
    60%  { transform: translateX(4px); }
    75%  { transform: translateX(-3px); }
    90%  { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

/* Invalid required field highlight */
.ficha-content input.field-error,
.ficha-content select.field-error,
.ficha-content textarea.field-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}