/* === Employee Profile Styles === */

/* Section cards within tabs */
.ep-section {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.ep-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.ep-section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.ep-section-header .ep-actions {
    display: flex;
    gap: 0.375rem;
}

/* Display/edit mode toggle */
.ep-section .ep-display { display: block; }
.ep-section .ep-edit-form { display: none; }
.ep-section.ep-section--editing .ep-display { display: none; }
.ep-section.ep-section--editing .ep-edit-form { display: block; }

/* Form layout within sections */
.ep-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .ep-form-grid {
        grid-template-columns: 1fr;
    }
}

.ep-form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

/* Key-value display grid */
.ep-kv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 2rem;
}

@media (max-width: 768px) {
    .ep-kv-grid {
        grid-template-columns: 1fr;
    }
}

.ep-kv-item dt {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    margin: 0;
}

.ep-kv-item dd {
    font-size: 0.9375rem;
    color: #111827;
    margin: 0.125rem 0 0;
}

/* Inline success/error feedback */
.ep-feedback {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    margin-top: 0.5rem;
    display: none;
}

.ep-feedback--success {
    display: block;
    background: #dcfce7;
    color: #166534;
    animation: ep-fade-out 3s forwards;
}

.ep-feedback--error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

@keyframes ep-fade-out {
    0%, 80% { opacity: 1; }
    100% { opacity: 0; display: none; }
}

/* Card list styles (for future phases: contacts, identifications, etc.) */
.ep-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.ep-card-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: box-shadow 0.15s;
}

.ep-card-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ep-card-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.ep-card-item-header h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0;
}

/* Empty state */
.ep-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    color: #9ca3af;
}

.ep-empty-state i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.ep-empty-state p {
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

/* Profile page spacing for tabs under profile card */
.ep-profile-tabs {
    margin-top: 1.5rem;
}

/* Conditional field toggle (hidden by default, shown by JS) */
.ep-conditional {
    display: none;
}

.ep-conditional.ep-conditional--visible {
    display: block;
}

/* Card list editing state */
.ep-card-item--editing {
    border-color: #3b82f6;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.ep-card-item--editing .ep-form-grid {
    margin-bottom: 0.5rem;
}

/* Card item actions (edit/delete buttons) */
.ep-card-item-actions {
    display: flex;
    gap: 0.25rem;
}

/* Inline delete confirmation */
.ep-delete-confirm {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.8125rem;
    color: #991b1b;
}

.ep-delete-confirm span {
    font-weight: 500;
}

/* Card form actions (Save/Cancel inside card form) */
.ep-card-form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
    margin-top: 0.5rem;
}

/* Communication Preferences layout */
.ep-comm-prefs-grid {
    display: grid;
    gap: 0.75rem;
}

.ep-comm-pref-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fafafa;
}

.ep-comm-pref-row .form-check {
    min-width: 140px;
    margin: 0;
}

.ep-comm-pref-row .form-check-label {
    font-weight: 500;
    font-size: 0.9375rem;
}

.ep-comm-pref-row .form-select {
    max-width: 200px;
    font-size: 0.875rem;
}

/* Card body key-value display */
.ep-card-kv {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.375rem 1.5rem;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .ep-card-kv {
        grid-template-columns: 1fr;
    }
}

.ep-card-kv dt {
    color: #6b7280;
    font-weight: 500;
    font-size: 0.8125rem;
    margin: 0;
}

.ep-card-kv dd {
    color: #111827;
    margin: 0 0 0.25rem;
}

/* Card header badges alignment */
.ep-card-item-header .badge {
    font-size: 0.75rem;
}

.ep-card-item-header .d-flex {
    gap: 0.375rem;
}

/* Identification card specifics */
.ep-ident-number {
    font-size: 1.125rem;
    font-weight: 600;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.05em;
    color: #111827;
    margin: 0.25rem 0 0.5rem;
}

.ep-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #166534;
    background: #dcfce7;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
}

.ep-verified-badge i {
    font-size: 0.75rem;
}

.ep-unverified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
}

/* Dependent card conditional tags */
.ep-dep-tags {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.ep-dep-tag-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.ep-dep-tag-row .text-muted {
    font-size: 0.8125rem;
}

/* Nomination scheme section */
.ep-nom-scheme {
    margin-bottom: 1.25rem;
}

/* Progress bar */
.ep-nom-progress {
    flex: 1;
    max-width: 120px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.ep-nom-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s, background 0.3s;
}

.ep-nom-progress--ok {
    background: #22c55e;
}

.ep-nom-progress--under {
    background: #f59e0b;
}

.ep-nom-progress--over {
    background: #ef4444;
}

.ep-nom-share-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
}

/* Share percentage display on card */
.ep-nom-share {
    font-size: 1rem;
    font-weight: 700;
    color: #2563eb;
}

/* Nominee card footer (dates + status tags) */
.ep-nom-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.8125rem;
    flex-wrap: wrap;
}

/* Nomination edit area */
.ep-nom-edit-area {
    margin-top: 0.5rem;
}

/* Nominee form row */
.ep-nom-row {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #fafafa;
}

.ep-nom-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.ep-nom-row-title {
    font-weight: 600;
    font-size: 0.9375rem;
}

/* Edit area actions (Add Row + Save/Cancel) */
.ep-nom-edit-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
    margin-top: 0.5rem;
}

/* ================================ */
/* Dark Mode                        */
/* ================================ */

html[data-theme="dark"] .ep-section {
    background: #161B22;
    border-color: #21262D;
}

html[data-theme="dark"] .ep-section-header {
    border-bottom-color: #21262D;
}

html[data-theme="dark"] .ep-form-actions {
    border-top-color: #21262D;
}

html[data-theme="dark"] .ep-kv-item dt {
    color: #8B949E;
}

html[data-theme="dark"] .ep-kv-item dd {
    color: #E6EDF3;
}

html[data-theme="dark"] .ep-feedback--success {
    background: rgba(63, 185, 80, 0.15);
    color: #3FB950;
}

html[data-theme="dark"] .ep-feedback--error {
    background: rgba(248, 81, 73, 0.15);
    color: #F85149;
}

html[data-theme="dark"] .ep-card-item {
    border-color: #21262D;
    background: #161B22;
}

html[data-theme="dark"] .ep-card-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .ep-empty-state {
    color: #6E7681;
}

html[data-theme="dark"] .ep-card-item--editing {
    border-color: #58A6FF;
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.15);
}

html[data-theme="dark"] .ep-delete-confirm {
    color: #F85149;
}

html[data-theme="dark"] .ep-card-form-actions {
    border-top-color: #21262D;
}

html[data-theme="dark"] .ep-comm-pref-row {
    border-color: #21262D;
    background: #0D1117;
}

html[data-theme="dark"] .ep-card-kv dt {
    color: #8B949E;
}

html[data-theme="dark"] .ep-card-kv dd {
    color: #E6EDF3;
}

html[data-theme="dark"] .ep-ident-number {
    color: #E6EDF3;
}

html[data-theme="dark"] .ep-verified-badge {
    color: #3FB950;
    background: rgba(63, 185, 80, 0.15);
}

html[data-theme="dark"] .ep-unverified-badge {
    color: #8B949E;
    background: #21262D;
}

html[data-theme="dark"] .ep-nom-progress {
    background: #21262D;
}

html[data-theme="dark"] .ep-nom-share-label {
    color: #8B949E;
}

html[data-theme="dark"] .ep-nom-share {
    color: #58A6FF;
}

html[data-theme="dark"] .ep-nom-card-footer {
    border-top-color: #21262D;
}

html[data-theme="dark"] .ep-nom-row {
    border-color: #21262D;
    background: #0D1117;
}

html[data-theme="dark"] .ep-nom-row-header {
    border-bottom-color: #21262D;
}

html[data-theme="dark"] .ep-nom-edit-actions {
    border-top-color: #21262D;
}
