/* Employee Portal - single stylesheet (P1-14).
   Brand colours live only in these variables; swap them when the logo arrives. */
:root {
    --emp-primary: #1d4ed8;
    --emp-primary-dark: #1e3a8a;
    --emp-sidebar-bg: #0f172a;
    --emp-sidebar-text: #e2e8f0;
    --emp-sidebar-active: #1e293b;
    --emp-bg: #f4f6f9;
    --emp-surface: #ffffff;
    --emp-border: #e5e7eb;
    --emp-text: #1f2937;
    --emp-muted: #6b7280;
    --emp-sidebar-width: 248px;
    --bs-primary: #1d4ed8;
    --bs-primary-rgb: 29, 78, 216;
    --bs-link-color: #1d4ed8;
    --bs-link-color-rgb: 29, 78, 216;
}

body {
    background: var(--emp-bg);
    color: var(--emp-text);
}

.btn-primary {
    --bs-btn-bg: var(--emp-primary);
    --bs-btn-border-color: var(--emp-primary);
    --bs-btn-hover-bg: var(--emp-primary-dark);
    --bs-btn-hover-border-color: var(--emp-primary-dark);
    --bs-btn-active-bg: var(--emp-primary-dark);
    --bs-btn-active-border-color: var(--emp-primary-dark);
}

.emp-skip {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 2000;
    background: #fff;
    padding: 6px 12px;
    border-radius: 6px;
}

/* ---- Shell ---- */
.emp-shell {
    display: flex;
    min-height: 100vh;
}

.emp-sidebar {
    background: var(--emp-sidebar-bg);
    color: var(--emp-sidebar-text);
}

@media (min-width: 992px) {
    /* Bootstrap 5.3 sets .offcanvas-lg { background-color: transparent !important }
       at this width, which let the light page background show behind the
       light menu text. This more specific rule keeps the sidebar dark. */
    .emp-sidebar.offcanvas-lg {
        background-color: var(--emp-sidebar-bg) !important;
        color: var(--emp-sidebar-text);
    }

    .emp-sidebar {
        width: var(--emp-sidebar-width);
        flex: 0 0 var(--emp-sidebar-width);
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 991.98px) {
    .emp-sidebar.offcanvas-lg {
        --bs-offcanvas-width: var(--emp-sidebar-width);
        --bs-offcanvas-bg: var(--emp-sidebar-bg);
    }
}

.emp-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
}

.emp-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--emp-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex: 0 0 auto;
}

/* Company logo (assets/img/logo-*.png: round, transparent corners). */
.emp-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: contain;
    flex: 0 0 auto;
}

.emp-logo-lg {
    width: 80px;
    height: 80px;
    display: inline-block;
}

.emp-brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 2px;
    flex: 0 0 auto;
}

.emp-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.emp-brand-title {
    color: #fff;
    font-weight: 600;
    line-height: 1.2;
}

.emp-brand-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emp-nav {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.emp-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--emp-sidebar-text);
    text-decoration: none;
    font-size: 0.95rem;
}

.emp-nav-link:hover,
.emp-nav-link:focus-visible {
    background: var(--emp-sidebar-active);
    color: #fff;
}

.emp-nav-link.active {
    background: var(--emp-primary);
    color: #fff;
}

.emp-nav-link i {
    color: #93c5fd;
}

.emp-nav-link:hover i,
.emp-nav-link:focus-visible i,
.emp-nav-link.active i {
    color: #fff;
}

/* The "Employee portal (Manage)" sidebar entry is a <button> (POST + CSRF). */
button.emp-nav-link {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    font-family: inherit;
}

.emp-nav-link.disabled {
    opacity: 0.45;
    cursor: default;
}

.emp-nav-link.disabled:hover {
    background: transparent;
    color: var(--emp-sidebar-text);
}

.emp-nav-soon {
    margin: 14px 12px 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.emp-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.emp-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: var(--emp-surface);
    border-bottom: 1px solid var(--emp-border);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.emp-topbar-title {
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 0;
}

.emp-content {
    padding: 24px;
    flex: 1 1 auto;
}

.emp-content:focus {
    outline: none;
}

.emp-footer {
    padding: 12px 24px;
    font-size: 0.8rem;
    color: var(--emp-muted);
}

@media (max-width: 575.98px) {
    .emp-topbar,
    .emp-content,
    .emp-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ---- Cards and grids ---- */
.card {
    border-color: var(--emp-border);
    border-radius: 12px;
}

.card-header {
    background: var(--emp-surface);
    font-weight: 600;
}

.emp-stat {
    display: flex;
    align-items: center;
    gap: 14px;
}

.emp-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(29, 78, 216, 0.1);
    color: var(--emp-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex: 0 0 auto;
}

/* Scrollable grid with a sticky header (same idea as the Tracker's tt-grid-scroll). */
.emp-grid-scroll {
    max-height: 65vh;
    overflow: auto;
}

.emp-grid-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    box-shadow: inset 0 -1px 0 var(--emp-border);
    white-space: nowrap;
}

.emp-grid-scroll .table {
    margin-bottom: 0;
}

.emp-actions {
    white-space: nowrap;
}

.emp-image-preview {
    max-width: 180px;
    max-height: 90px;
    object-fit: contain;
    background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 16px 16px;
    border: 1px solid var(--emp-border);
    border-radius: 8px;
    padding: 4px;
}

/* ---- Employees ---- */
.min-w-0 {
    min-width: 0;
}

.emp-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    background: #e2e8f0;
}

.emp-avatar-lg {
    width: 112px;
    height: 112px;
    font-size: 2rem;
}

.emp-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(29, 78, 216, 0.12);
    color: var(--emp-primary-dark);
    font-weight: 600;
}

.emp-person-card:hover,
.emp-person-card:focus-visible {
    border-color: var(--emp-primary);
    box-shadow: 0 0 0 0.2rem rgba(29, 78, 216, 0.12);
}

.emp-tabs {
    scrollbar-width: thin;
}

@media (min-width: 1200px) {
    .emp-sticky-card {
        position: sticky;
        top: 76px;
    }
}

/* ---- Directory columns, import, export (Phase 3) ---- */
.emp-col-menu {
    min-width: 260px;
    max-height: 70vh;
    overflow-y: auto;
}

.emp-cell-long {
    min-width: 220px;
    max-width: 360px;
    white-space: normal;
}

.emp-import-details {
    min-width: 260px;
}

.emp-import-details > div + div {
    margin-top: 2px;
}

[data-sensitive-box] {
    opacity: 0.75;
}

[data-sensitive-box].emp-sensitive-active {
    opacity: 1;
    border-width: 2px;
}

/* ---- Letters (Phase 5) ---- */
.emp-letter-wrap {
    background: #e9edf3;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}

.emp-letter-wrap .letter-sheet {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.emp-quill {
    background: #fff;
    min-height: 360px;
    max-height: 70vh;
    overflow-y: auto;
}

.emp-quill .ql-editor {
    min-height: 340px;
    font-size: 0.95rem;
}

.emp-placeholder-list {
    max-height: 420px;
    overflow-y: auto;
}

.emp-placeholder-list .btn-link {
    text-decoration: none;
}

details.card > summary {
    cursor: pointer;
}

/* ---- Dashboard (Phase 6) ---- */
.emp-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.emp-list-compact .list-group-item {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.emp-chart-box {
    position: relative;
    height: 260px;
}

/* ---- Auth pages ---- */
.emp-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.emp-auth-card {
    width: 100%;
    max-width: 420px;
}
