/* New Leaf back office: brand colours from the mobile app (leaf green + warm amber). */
:root {
    --nl-green: #2E7D4F;
    --nl-green-dark: #1B4D32;
    --nl-green-deep: #143A26;
    --nl-green-light: #E3F1E7;
    --nl-amber: #F2A93B;
    --nl-amber-light: #FFF1DA;
    --nl-amber-ink: #8A5A00;
    --nl-cream: #FAF7F0;
    --nl-ink: #1F2A24;
    --nl-muted: #5E6B63;
    --nl-line: #E2DED3;

    --bs-primary: var(--nl-green);
    --bs-primary-rgb: 46, 125, 79;
    --bs-link-color: var(--nl-green);
    --bs-link-color-rgb: 46, 125, 79;
    --bs-link-hover-color: var(--nl-green-dark);
    --bs-body-font-family: 'Nunito Sans', system-ui, sans-serif;
    --bs-body-color: var(--nl-ink);
    --bs-body-bg: var(--nl-cream);
    --bs-border-color: var(--nl-line);
}

h1, h2, h3, h4, h5, .page-title, .brand b, .kpi .value { font-family: 'Nunito', system-ui, sans-serif; }

.btn-primary {
    --bs-btn-bg: var(--nl-green); --bs-btn-border-color: var(--nl-green);
    --bs-btn-hover-bg: var(--nl-green-dark); --bs-btn-hover-border-color: var(--nl-green-dark);
    --bs-btn-active-bg: var(--nl-green-deep); --bs-btn-active-border-color: var(--nl-green-deep);
    --bs-btn-disabled-bg: var(--nl-green); --bs-btn-disabled-border-color: var(--nl-green);
}
.btn-outline-primary {
    --bs-btn-color: var(--nl-green); --bs-btn-border-color: var(--nl-green);
    --bs-btn-hover-bg: var(--nl-green); --bs-btn-hover-border-color: var(--nl-green);
    --bs-btn-active-bg: var(--nl-green-dark);
}
.btn-amber { background: var(--nl-amber); border-color: var(--nl-amber); color: var(--nl-green-deep); font-weight: 700; }
.btn-amber:hover { background: #e39a2a; border-color: #e39a2a; color: var(--nl-green-deep); }
.form-check-input:checked { background-color: var(--nl-green); border-color: var(--nl-green); }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #7fb595; box-shadow: 0 0 0 .2rem rgba(46, 125, 79, .2);
}

/* ---------- layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px; flex-shrink: 0; background: var(--nl-green-deep); color: #C9DED0;
    display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 4px 8px 20px; }
.brand b { display: block; font-size: 1.25rem; font-weight: 900; line-height: 1.1; }
.brand small { display: block; color: var(--nl-amber); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sidebar .nav-heading { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #7FA58E; margin: 18px 10px 6px; font-weight: 700; }
.sidebar .nav-link {
    color: #DCEADF; border-radius: 10px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; font-weight: 600;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar .nav-link.active { background: var(--nl-green); color: #fff; }
.sidebar-foot { margin-top: auto; font-size: .75rem; color: #7FA58E; padding: 16px 10px 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 18px 32px; background: #fff; border-bottom: 1px solid var(--nl-line); position: sticky; top: 0; z-index: 10;
}
.page-title { font-size: 1.5rem; font-weight: 800; margin: 0; color: var(--nl-green-dark); }
.content { padding: 28px 32px 48px; max-width: 1400px; }

@media (max-width: 900px) {
    .app { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .content, .topbar { padding-left: 16px; padding-right: 16px; }
}

/* ---------- cards & KPIs */
.card { border: 1px solid var(--nl-line); border-radius: 18px; box-shadow: 0 1px 2px rgba(20,58,38,.04); }
.card-header { background: transparent; border-bottom: 1px solid var(--nl-line); font-weight: 800; font-family: 'Nunito', sans-serif; padding: 14px 20px; }
.card-body { padding: 20px; }
.kpi { padding: 20px; }
.kpi .label { color: var(--nl-muted); font-weight: 600; font-size: .9rem; }
.kpi .value { font-size: 2rem; font-weight: 900; color: var(--nl-green-dark); line-height: 1.1; }
.kpi .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem;
    background: var(--nl-green-light); color: var(--nl-green); }
.kpi .icon.amber { background: var(--nl-amber-light); color: var(--nl-amber-ink); }

.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: .8rem 1rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--nl-muted); font-weight: 700; background: #FCFBF7; }
.table-hover tbody tr:hover { --bs-table-hover-bg: #F6FAF7; }
.row-link { cursor: pointer; }

/* ---------- badges */
.group-badge { background: var(--nl-amber-light); color: var(--nl-amber-ink); font-weight: 700; border-radius: 20px; padding: .35em .7em; }
.badge.soft-success { background: var(--nl-green-light); color: var(--nl-green-dark); }
.badge.soft-muted { background: #EFEBE1; color: var(--nl-muted); }
.badge { font-weight: 700; }
.avatar {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    background: var(--nl-green-light); color: var(--nl-green); font-weight: 800; font-family: 'Nunito', sans-serif;
}
.avatar.lg { width: 64px; height: 64px; font-size: 1.4rem; }
.avatar.amber { background: var(--nl-amber-light); color: var(--nl-amber-ink); }

/* ---------- pipeline */
.pipeline { display: flex; gap: 8px; flex-wrap: wrap; }
.pipeline a {
    flex: 1; min-width: 110px; text-decoration: none; border: 1px solid var(--nl-line); border-radius: 14px;
    padding: 10px 14px; background: #fff; color: var(--nl-ink);
}
.pipeline a.active { border-color: var(--nl-green); background: var(--nl-green-light); }
.pipeline .n { font-family: 'Nunito', sans-serif; font-size: 1.5rem; font-weight: 900; display: block; }
.pipeline .l { font-size: .82rem; color: var(--nl-muted); font-weight: 600; }

/* ---------- bars */
.bar { height: 10px; background: #EFEBE1; border-radius: 6px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--nl-amber); border-radius: 6px; }

/* ---------- private / shared sections of an applicant */
.shared-tag { font-size: .78rem; font-weight: 700; border-radius: 20px; padding: .2em .65em; }
.shared-tag.on { background: var(--nl-green-light); color: var(--nl-green-dark); }
.shared-tag.off { background: #EFEBE1; color: var(--nl-muted); }
.private-box { background: repeating-linear-gradient(45deg, #FAF8F2, #FAF8F2 10px, #F3F0E7 10px, #F3F0E7 20px);
    border-radius: 12px; padding: 14px 16px; color: var(--nl-muted); }

/* ---------- conversation */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 85%; border-radius: 16px; padding: 10px 14px; }
.msg .text { white-space: pre-line; }
.msg.employer { align-self: flex-end; background: var(--nl-green-light); border-bottom-right-radius: 4px; }
.msg.seeker { align-self: flex-start; background: #fff; border: 1px solid var(--nl-line); border-bottom-left-radius: 4px; }
.msg .meta { font-size: .75rem; color: var(--nl-muted); margin-top: 4px; }

/* ---------- phone preview of a job/post as seen in the app */
.phone-preview { border: 8px solid var(--nl-ink); border-radius: 28px; background: var(--nl-cream); padding: 14px; max-width: 320px; }
.phone-preview .app-card { background: #fff; border-radius: 16px; padding: 14px; }
.pin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.pin.orange { background: #F57C00; }
.pin.green { background: #2E9E4F; }
.pin.red { background: #D93A30; }

/* ---------- login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: var(--nl-green-deep); color: #DCEADF; padding: 64px; display: flex; flex-direction: column; justify-content: center; }
.login-hero h1 { color: #fff; font-weight: 900; font-size: 3rem; }
.login-hero .tag { color: var(--nl-amber); font-weight: 800; font-size: 1.25rem; font-family: 'Nunito', sans-serif; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 420px; }
.demo-accounts td { padding: .35rem .5rem !important; font-size: .85rem; }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { padding: 32px; } }

.empty { text-align: center; padding: 40px 16px; color: var(--nl-muted); }
.empty i { font-size: 2rem; display: block; margin-bottom: 8px; color: #B9C6BD; }
.small-muted { font-size: .85rem; color: var(--nl-muted); }

/* ---------- chat (website and employer portal) ---------- */
.chat-avatar { width: 44px; height: 44px; border-radius: 50%; background: #E3F1E7; color: #1B4D32;
    display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 260px); min-height: 420px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px 16px; background: #FAF7F0; }
.chat-row { display: flex; margin: 4px 0; }
.chat-row.mine { justify-content: flex-end; }
.chat-bubble { max-width: min(560px, 78%); padding: 8px 12px; border-radius: 14px; background: #F4F1EA;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.chat-row.mine .chat-bubble { background: #E3F1E7; }
.chat-from { font-size: .8rem; font-weight: 700; color: #2E7D4F; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-meta { font-size: .75rem; color: #5E6B63; margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.chat-photo { max-width: 260px; max-height: 260px; border-radius: 10px; display: block; }
.chat-doc { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 10px; padding: 8px 10px;
    text-decoration: none; color: inherit; }
.chat-bubble audio { max-width: 260px; height: 36px; }
.chat-composer { border-top: 1px solid #E2DED3; background: #fff; }
.chat-composer textarea { resize: none; max-height: 140px; }
@media (max-width: 576px) {
    .chat-card { height: calc(100vh - 220px); }
    .chat-bubble { max-width: 88%; }
}
