/* Employee Portal — premium shell (English UI only) */
:root {
    --ess-ink: #0f172a;
    --ess-muted: #64748b;
    --ess-line: rgba(15, 23, 42, 0.08);
    --ess-surface: #ffffff;
    --ess-bg0: #eef2f6;
    --ess-bg1: #f7f9fc;
    --ess-brand: #0b3a5c;
    --ess-brand-2: #0f766e;
    --ess-accent: #c2410c;
    --ess-ok: #047857;
    --ess-warn: #b45309;
    --ess-danger: #b91c1c;
    /* Attendance palette: no universal mandatory standard exists; keep one enforced semantic mapping. */
    --att-present: #38bdf8;
    --att-present-dark: #0284c7;
    --att-late: #f97316;
    --att-late-dark: #c2410c;
    --att-leave: #22c55e;
    --att-leave-dark: #15803d;
    --att-absent: #ef4444;
    --att-absent-dark: #b91c1c;
    --att-weekend: #3b82f6;
    --att-weekend-dark: #1d4ed8;
    --att-holiday: #808000;
    --att-holiday-light: #a3a338;
    --ess-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    --ess-radius: 18px;
    --ess-font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    --ess-display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.ess-body {
    font-family: var(--ess-font);
    color: var(--ess-ink);
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(15, 118, 110, 0.12), transparent 55%),
        radial-gradient(900px 420px at 100% 0%, rgba(11, 58, 92, 0.14), transparent 50%),
        linear-gradient(180deg, var(--ess-bg1), var(--ess-bg0));
}

.ess-shell { min-height: 100vh; display: flex; flex-direction: column; }

.ess-topbar {
    position: sticky; top: 0; z-index: 40;
    backdrop-filter: blur(12px);
    background: rgba(11, 58, 92, 0.92);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ess-topbar-inner {
    max-width: 1120px; margin: 0 auto;
    padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.ess-brand {
    display: flex; align-items: baseline; gap: 10px;
    font-weight: 700; letter-spacing: -0.02em;
}
.ess-brand-mark {
    font-family: var(--ess-display);
    font-size: 1.35rem; font-weight: 600;
}
.ess-brand-sub { font-size: 0.78rem; opacity: 0.72; font-weight: 500; }
.ess-top-meta { display: flex; align-items: center; gap: 14px; font-size: 0.9rem; }
.ess-top-meta a {
    color: #fff; text-decoration: none;
    border: 1px solid rgba(255,255,255,0.28);
    padding: 6px 12px; border-radius: 999px;
    transition: background .2s ease, border-color .2s ease;
}
.ess-top-meta a:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.45); }

.ess-navwrap {
    background: rgba(255,255,255,0.72);
    border-bottom: 1px solid var(--ess-line);
    backdrop-filter: blur(10px);
}
.ess-nav {
    max-width: 1120px; margin: 0 auto;
    padding: 10px 16px;
    display: flex; gap: 6px; overflow-x: auto;
}
.ess-nav a {
    flex: 0 0 auto;
    text-decoration: none; color: var(--ess-muted);
    padding: 10px 14px; border-radius: 999px;
    font-size: 0.92rem; font-weight: 600;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.ess-nav a:hover { background: rgba(11, 58, 92, 0.06); color: var(--ess-brand); transform: translateY(-1px); }
.ess-nav a.active {
    background: var(--ess-brand);
    color: #fff;
    box-shadow: 0 10px 24px rgba(11, 58, 92, 0.25);
}

.ess-main {
    width: 100%; max-width: 1120px;
    margin: 0 auto; padding: 28px 20px 48px;
    flex: 1;
}

.ess-hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
    animation: essRise .55s ease both;
}
@keyframes essRise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
.ess-panel {
    background: var(--ess-surface);
    border: 1px solid var(--ess-line);
    border-radius: var(--ess-radius);
    box-shadow: var(--ess-shadow);
    padding: 22px;
}
.ess-panel h2, .ess-panel h3 {
    margin: 0 0 14px;
    font-family: var(--ess-display);
    font-weight: 600;
    letter-spacing: -0.02em;
}
.ess-kicker {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--ess-muted); font-weight: 700; margin-bottom: 8px;
}
.ess-title {
    font-family: var(--ess-display);
    font-size: clamp(1.6rem, 2.4vw, 2.2rem);
    margin: 0 0 6px; letter-spacing: -0.03em;
}
.ess-sub { margin: 0; color: var(--ess-muted); font-size: 0.95rem; }
.ess-attendance-pills {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ess-pill--time {
    background: #f8fafc;
    color: #334155;
    border: 1px solid rgba(148, 163, 184, 0.22);
}
.ess-pill--status.is-present { background: #e0f2fe; color: #0369a1; }
.ess-pill--status.is-late { background: #ffedd5; color: var(--att-late-dark); }
.ess-pill--status.is-leave { background: #dcfce7; color: var(--att-leave-dark); }
.ess-pill--status.is-absent { background: #fee2e2; color: var(--att-absent-dark); }
.ess-pill--status.is-weekend { background: #dbeafe; color: var(--att-weekend-dark); }
.ess-pill--status.is-holiday { background: #f1f2c7; color: #606000; }
.ess-pill--status.is-none { background: #f1f5f9; color: #64748b; }

.ess-month-overview {
    background:
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.08), transparent 42%),
        var(--ess-surface);
}
.ess-month-overview-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    margin-bottom: 14px;
}
.ess-month-overview-head h2 { margin: 0; }
.ess-month-overview-head > span {
    flex: none;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(11, 58, 92, 0.07);
    color: var(--ess-brand);
    font-size: 0.68rem;
    font-weight: 800;
}
.ess-month-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.ess-summary-chip {
    position: relative;
    min-width: 0;
    padding: 10px 10px 9px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
}
.ess-summary-chip::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #94a3b8;
}
.ess-summary-chip span {
    display: block;
    overflow: hidden;
    color: var(--ess-muted);
    font-size: 0.62rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ess-summary-chip strong {
    display: block;
    margin-top: 3px;
    color: var(--ess-ink);
    font-family: var(--ess-display);
    font-size: 1.25rem;
    line-height: 1;
}
.ess-summary-chip.is-present::before { background: var(--att-present); }
.ess-summary-chip.is-late::before { background: var(--att-late); }
.ess-summary-chip.is-leave::before { background: var(--att-leave); }
.ess-summary-chip.is-absent::before { background: var(--att-absent); }
.ess-summary-chip.is-weekend::before { background: var(--att-weekend); }
.ess-summary-chip.is-holiday::before { background: var(--att-holiday); }

.ess-leave-balance-panel {
    margin-top: 18px;
    background:
        radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.06), transparent 34%),
        var(--ess-surface);
}
.ess-leave-page-balance .ess-leave-balance-panel {
    margin-top: 0;
    margin-bottom: 18px;
}
.ess-leave-balance-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.ess-leave-balance-head h2 { margin-bottom: 5px; }
.ess-year-badge {
    flex: none;
    padding: 6px 11px;
    border: 1px solid rgba(11, 58, 92, 0.08);
    border-radius: 999px;
    background: rgba(11, 58, 92, 0.06);
    color: var(--ess-brand);
    font-size: 0.72rem;
    font-weight: 800;
}
.ess-leave-widget-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.ess-leave-widget {
    --leave-accent: #0ea5e9;
    --leave-soft: #f0f9ff;
    position: relative;
    min-width: 0;
    padding: 15px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    background: linear-gradient(145deg, #fff 38%, var(--leave-soft));
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}
.ess-leave-widget::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--leave-accent);
}
.ess-leave-widget.is-al { --leave-accent: #0284c7; --leave-soft: #e0f2fe; }
.ess-leave-widget.is-cl { --leave-accent: #16a34a; --leave-soft: #dcfce7; }
.ess-leave-widget.is-sl { --leave-accent: #dc2626; --leave-soft: #fee2e2; }
.ess-leave-widget.is-ml { --leave-accent: #db2777; --leave-soft: #fce7f3; }
.ess-leave-widget.is-el { --leave-accent: #d97706; --leave-soft: #fef3c7; }
.ess-leave-widget.is-pl { --leave-accent: #4f46e5; --leave-soft: #e0e7ff; }
.ess-leave-widget-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.ess-leave-widget-head > div:first-child { min-width: 0; }
.ess-leave-code {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 7px;
    background: var(--leave-soft);
    color: var(--leave-accent);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}
.ess-leave-widget h3 {
    margin: 7px 0 0;
    overflow: hidden;
    color: var(--ess-ink);
    font-family: var(--ess-font);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ess-leave-total {
    flex: none;
    text-align: right;
}
.ess-leave-total span,
.ess-leave-metrics span {
    display: block;
    color: var(--ess-muted);
    font-size: 0.56rem;
    font-weight: 700;
}
.ess-leave-total strong {
    color: var(--leave-accent);
    font-family: var(--ess-display);
    font-size: 1.65rem;
    line-height: 1;
}
.ess-leave-total small {
    color: var(--ess-muted);
    font-size: 0.54rem;
    font-weight: 700;
}
.ess-leave-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 14px;
}
.ess-leave-metrics > div {
    min-width: 0;
    padding: 8px 5px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
}
.ess-leave-metrics span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ess-leave-metrics strong {
    display: block;
    margin-top: 4px;
    color: var(--ess-ink);
    font-family: var(--ess-display);
    font-size: 1.05rem;
    line-height: 1;
}
.ess-leave-metrics .is-negative strong { color: var(--ess-danger); }

.ess-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.ess-stat {
    background: var(--ess-surface);
    border: 1px solid var(--ess-line);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: var(--ess-shadow);
    position: relative;
    overflow: hidden;
    animation: essRise .55s ease both;
}
.ess-stat:nth-child(2) { animation-delay: .05s; }
.ess-stat:nth-child(3) { animation-delay: .1s; }
.ess-stat:nth-child(4) { animation-delay: .15s; }
.ess-stat::after {
    content: "";
    position: absolute; inset: auto -20% -40% auto;
    width: 120px; height: 120px; border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.14), transparent 70%);
}
.ess-stat .label { font-size: 0.78rem; color: var(--ess-muted); font-weight: 600; }
.ess-stat .value {
    font-family: var(--ess-display);
    font-size: 1.7rem; margin-top: 6px; letter-spacing: -0.03em;
}
.ess-stat .meta { margin-top: 8px; font-size: 0.82rem; color: var(--ess-muted); }

.ess-chart-wrap { min-height: 230px; }
.ess-attendance-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 12px; flex-wrap: wrap;
}
.ess-attendance-head h2 { margin: 0; }
.ess-attendance-scroll {
    width: 100%;
    margin-top: 20px;
    overflow: hidden;
    padding: 2px;
}
.ess-attendance-heatmap {
    --ess-label-size: clamp(30px, 5vw, 52px);
    display: grid;
    grid-template-rows: 28px 24px 32px;
    column-gap: clamp(1px, 0.35vw, 5px);
    row-gap: 5px;
    align-items: center;
    width: 100%;
    min-width: 0;
}
.ess-heatmap-label {
    align-self: stretch;
    display: flex; align-items: center;
    padding-right: clamp(2px, 0.5vw, 8px);
    color: var(--ess-muted);
    font-size: clamp(0.48rem, 0.72vw, 0.66rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.ess-heatmap-label--date { grid-row: 1; }
.ess-heatmap-label--day { grid-row: 2; }
.ess-heatmap-label--status { grid-row: 3; }
.ess-heatmap-date,
.ess-heatmap-weekday {
    display: flex; align-items: center; justify-content: center;
    min-width: 0;
    color: var(--ess-muted);
    font-size: clamp(0.42rem, 0.72vw, 0.67rem);
    font-weight: 700;
}
.ess-heatmap-date {
    height: 26px;
    border-radius: 7px;
}
.ess-heatmap-date.is-today {
    color: #fff;
    background: var(--ess-brand);
    box-shadow: 0 5px 12px rgba(11, 58, 92, 0.2);
}
.ess-heatmap-weekday {
    font-size: clamp(0.34rem, 0.62vw, 0.58rem);
    font-weight: 600;
    color: #94a3b8;
}
.ess-heatmap-cell {
    width: 100%;
    max-width: 32px;
    aspect-ratio: 1;
    justify-self: center;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    border-radius: clamp(2px, 0.55vw, 6px);
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: #edf1f5;
    transition: transform .15s ease, box-shadow .15s ease;
}
.ess-heatmap-cell:hover {
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 7px 14px rgba(15, 23, 42, 0.13);
}
.ess-heatmap-cell.is-present {
    background: linear-gradient(145deg, #7dd3fc, var(--att-present));
    border-color: rgba(2, 132, 199, 0.22);
}
.ess-heatmap-cell.is-late {
    background: linear-gradient(145deg, #fb923c, var(--att-late-dark));
    border-color: rgba(194, 65, 12, 0.22);
}
.ess-heatmap-cell.is-leave {
    background: linear-gradient(145deg, #4ade80, var(--att-leave-dark));
    border-color: rgba(21, 128, 61, 0.24);
}
.ess-heatmap-cell.is-absent {
    background: linear-gradient(145deg, #f87171, var(--att-absent-dark));
    border-color: rgba(185, 28, 28, 0.22);
}
.ess-heatmap-cell.is-weekend {
    background: linear-gradient(145deg, #60a5fa, var(--att-weekend-dark));
    border-color: rgba(29, 78, 216, 0.22);
}
.ess-heatmap-cell.is-holiday {
    background: linear-gradient(145deg, var(--att-holiday-light), var(--att-holiday));
    border-color: rgba(128, 128, 0, 0.26);
}
.ess-heatmap-cell.is-none { background: #edf1f5; }
.ess-heatmap-cell.is-today {
    outline: 2px solid var(--ess-brand);
    outline-offset: 2px;
}
.ess-heatmap-cell.is-selected {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ess-brand), 0 8px 15px rgba(15, 23, 42, 0.2);
    transform: translateY(-1px);
}
.ess-heatmap-cell:focus-visible {
    outline: 2px solid var(--ess-brand);
    outline-offset: 2px;
}
.ess-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; font-size: 0.8rem; color: var(--ess-muted); }
.ess-legend span::before {
    content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 999px; margin-right: 6px; vertical-align: middle;
}
.ess-legend .lg-present::before { background: var(--att-present); }
.ess-legend .lg-late::before { background: var(--att-late); }
.ess-legend .lg-leave::before { background: var(--att-leave); }
.ess-legend .lg-absent::before { background: var(--att-absent); }
.ess-legend .lg-weekend::before { background: var(--att-weekend); }
.ess-legend .lg-holiday::before { background: var(--att-holiday); }

.ess-profile-hero {
    display: grid; grid-template-columns: 140px 1fr; gap: 22px; align-items: center;
}
.ess-avatar {
    width: 132px; height: 132px; border-radius: 28px; object-fit: cover;
    border: 3px solid #fff; box-shadow: var(--ess-shadow); background: #dbe4ee;
}
.ess-avatar-fallback {
    display: flex; align-items: center; justify-content: center;
    font-family: var(--ess-display); font-size: 2.4rem; color: var(--ess-brand);
    background: linear-gradient(145deg, #dbeafe, #ccfbf1);
}
.ess-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
    background: rgba(15, 118, 110, 0.1); color: var(--ess-brand-2);
}
.ess-detail-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.ess-detail-item {
    border: 1px solid var(--ess-line); border-radius: 14px; padding: 14px 16px; background: #fbfcfe;
}
.ess-detail-item .lbl { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ess-muted); font-weight: 700; }
.ess-detail-item .val { margin-top: 6px; font-weight: 600; font-size: 0.98rem; }

.ess-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ess-table th, .ess-table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--ess-line); }
.ess-table th { color: var(--ess-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border-radius: 12px; border: none; cursor: pointer;
    background: var(--ess-brand); color: #fff; text-decoration: none;
    font-weight: 700; font-size: 0.9rem;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(11, 58, 92, 0.22); color: #fff; }
.btn-secondary { background: #334155; }
.btn-ghost {
    background: transparent; color: var(--ess-brand);
    border: 1px solid rgba(11, 58, 92, 0.2);
}
.btn-sm { padding: 7px 12px; font-size: 0.8rem; border-radius: 10px; }

.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 0.92rem; }
.alert-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #f0f9ff; color: #075985; border: 1px solid #bae6fd; }

.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; color: var(--ess-muted); }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; max-width: 420px; padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, 0.12); border-radius: 12px;
    background: #fff; font: inherit;
}

.ess-preview-shell {
    display: grid; grid-template-columns: 280px 1fr; gap: 16px; min-height: 640px;
}
.ess-preview-shell--dropdown {
    grid-template-columns: 1fr;
    min-height: 0;
}
.ess-month-select-wrap {
    display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.ess-month-select-wrap label {
    margin: 0; font-size: 0.78rem; font-weight: 700; color: var(--ess-muted);
    text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}
.ess-month-select {
    appearance: none; -webkit-appearance: none;
    min-width: 180px; max-width: 280px; width: 100%;
    padding: 9px 36px 9px 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, transparent 50%, #0b3a5c 50%),
        linear-gradient(135deg, #0b3a5c 50%, transparent 50%);
    background-position:
        calc(100% - 16px) calc(50% - 3px),
        calc(100% - 10px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    font: inherit; font-weight: 600; color: var(--ess-ink);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    cursor: pointer;
}
.ess-month-select:focus {
    outline: none;
    border-color: rgba(11, 58, 92, 0.45);
    box-shadow: 0 0 0 3px rgba(11, 58, 92, 0.12);
}
.ess-month-list { display: flex; flex-direction: column; gap: 8px; max-height: 640px; overflow: auto; }
.ess-month-item {
    border: 1px solid var(--ess-line); border-radius: 12px; padding: 12px 14px;
    cursor: pointer; background: #fff; text-align: left; width: 100%;
    font: inherit; font-weight: 600; color: var(--ess-ink);
    transition: border-color .15s ease, background .15s ease;
}
.ess-month-item:hover, .ess-month-item.is-active {
    border-color: rgba(11, 58, 92, 0.35);
    background: rgba(11, 58, 92, 0.04);
}
.ess-preview-frame-wrap {
    border: 1px solid var(--ess-line); border-radius: 16px; overflow: hidden;
    background: #0f172a; min-height: 640px; position: relative;
}
.ess-preview-toolbar {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 14px; background: rgba(255,255,255,0.96); border-bottom: 1px solid var(--ess-line);
}
.ess-preview-frame { width: 100%; height: 600px; border: 0; background: #525659; }
.ess-preview-empty {
    position: absolute; inset: 56px 0 0; display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.72); font-weight: 600; padding: 24px; text-align: center;
}

/* Leave request */
.ess-leave-request-panel {
    position: relative;
    overflow: hidden;
    margin-bottom: 18px;
    padding: clamp(20px, 3vw, 30px);
    border-color: rgba(14, 116, 144, 0.16);
    background:
        radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.09), transparent 32%),
        linear-gradient(145deg, #ffffff 0%, #fbfdff 100%);
}
.ess-leave-request-panel::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #0ea5e9, #0f766e);
}
.ess-leave-request-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}
.ess-leave-request-head h2 { margin-bottom: 5px; }
.ess-leave-request-head .ess-sub { margin: 0; max-width: 680px; }
.ess-secure-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: 999px;
    background: rgba(240, 253, 250, 0.92);
    color: #0f766e;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}
.ess-secure-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}
.ess-leave-form-grid {
    display: grid;
    grid-template-columns: minmax(190px, 1.2fr) repeat(2, minmax(160px, 1fr)) minmax(120px, .6fr);
    gap: 18px;
    align-items: start;
}
.ess-leave-field { min-width: 0; margin: 0; }
.ess-leave-field label {
    margin-bottom: 8px;
    color: #334155;
    font-size: 0.78rem;
    letter-spacing: 0.015em;
}
.ess-leave-field label span { color: #dc2626; }
.ess-leave-field input,
.ess-leave-field select,
.ess-leave-field textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-height: 46px;
    border: 1px solid #d8e1ea;
    border-radius: 12px;
    background-color: #fff;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.ess-leave-field textarea {
    min-height: 92px;
    resize: vertical;
    font-weight: 500;
    line-height: 1.55;
}
.ess-leave-field input:focus,
.ess-leave-field select:focus,
.ess-leave-field textarea:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}
.ess-leave-field input[readonly] {
    cursor: default;
    border-color: #dbe5eb;
    background: linear-gradient(135deg, #f0f9ff, #f8fafc);
    color: #075985;
    font-weight: 800;
}
.ess-field-meta {
    display: block;
    min-height: 16px;
    margin-top: 6px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
}
.ess-leave-reason { grid-column: 1 / -1; }
.ess-leave-range-note {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(14, 116, 144, 0.12);
    border-radius: 12px;
    background: rgba(240, 249, 255, 0.72);
    color: #475569;
    font-size: 0.79rem;
    line-height: 1.55;
}
.ess-leave-range-note strong { color: #075985; }
.ess-leave-form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}
.ess-leave-submit {
    min-width: 158px;
    min-height: 44px;
    background: linear-gradient(135deg, #075985, #0f766e);
    box-shadow: 0 10px 24px rgba(7, 89, 133, 0.16);
}
.ess-leave-submit:disabled { cursor: wait; opacity: .82; transform: none; }
.ess-leave-submit.is-loading::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ess-leave-spin .7s linear infinite;
}
.ess-submit-status { color: #64748b; font-size: 0.75rem; font-weight: 600; line-height: 1.5; }
@keyframes ess-leave-spin { to { transform: rotate(360deg); } }

@media (max-width: 960px) {
    .ess-hero, .ess-profile-hero, .ess-preview-shell:not(.ess-preview-shell--dropdown), .ess-stat-grid, .ess-detail-grid {
        grid-template-columns: 1fr;
    }
    .ess-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ess-leave-widget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ess-leave-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ess-preview-frame { height: 70vh; }
}
@media (max-width: 560px) {
    .ess-stat-grid { grid-template-columns: 1fr; }
    .ess-leave-widget-grid { grid-template-columns: 1fr; }
    .ess-leave-form-grid { grid-template-columns: 1fr; gap: 15px; }
    .ess-leave-request-head { display: block; }
    .ess-secure-badge { margin-top: 13px; }
    .ess-leave-form-actions { align-items: stretch; flex-direction: column; }
    .ess-leave-submit { width: 100%; }
    .ess-topbar-inner { padding: 12px 14px; }
    .ess-chart-wrap { padding-left: 14px; padding-right: 14px; }
    .ess-attendance-head { align-items: flex-start; }
    .ess-attendance-head .ess-legend { margin-top: 4px; gap: 9px; font-size: 0.7rem; }
    .ess-attendance-heatmap {
        --ess-label-size: 30px;
        grid-template-rows: 22px 18px 24px;
        column-gap: 1px;
        row-gap: 3px;
    }
    .ess-heatmap-label { letter-spacing: 0; }
    .ess-heatmap-date { height: 20px; border-radius: 3px; }
    .ess-heatmap-cell.is-today { outline-width: 1px; outline-offset: 1px; }
}

/* Login */
.ess-login-body {
    margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(20, 184, 166, 0.18), transparent 55%),
        radial-gradient(900px 420px at 100% 0%, rgba(37, 99, 235, 0.16), transparent 50%),
        linear-gradient(180deg, #e8eef5 0%, #f4f7fb 45%, #eef2f6 100%);
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    color: #0f172a;
}
.ess-login-card {
    width: 100%; max-width: 420px; margin: 24px;
    background: #fff; border-radius: 22px; padding: 28px 26px 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12); border: 1px solid rgba(15, 23, 42, 0.06);
}
.ess-login-brand {
    font-family: Fraunces, Georgia, serif; font-size: 1.65rem; font-weight: 650; color: #0b3a5c;
}
.ess-login-sub { margin: 6px 0 18px; color: #64748b; font-size: 0.92rem; }
.ess-login-submit { width: 100%; margin-top: 6px; }
.ess-login-options { margin: 4px 0 14px; }
.ess-check {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.86rem; color: #475569; font-weight: 600; cursor: pointer;
}
.ess-check input { width: auto; margin: 0; }
.ess-login-divider {
    display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: #94a3b8; font-size: 0.78rem; font-weight: 700;
}
.ess-login-divider::before, .ess-login-divider::after {
    content: ""; flex: 1; height: 1px; background: rgba(15, 23, 42, 0.1);
}
.ess-login-sso-btn { width: 100%; }
.ess-pwd-wrap { position: relative; display: block; }
.ess-pwd-wrap input { padding-right: 72px !important; width: 100%; max-width: none; box-sizing: border-box; }
.ess-pwd-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: #0b3a5c; font-weight: 700; font-size: 0.78rem;
    cursor: pointer; padding: 6px 8px; border-radius: 8px;
}
.ess-pwd-toggle:hover { background: rgba(11, 58, 92, 0.06); }
.ess-sso-panel { text-align: center; }
.ess-sso-qr-frame {
    display: inline-flex; align-items: center; justify-content: center;
    width: 220px; height: 220px; margin: 8px auto 12px;
    border: 1px solid rgba(15, 23, 42, 0.1); border-radius: 16px; background: #f8fafc;
}
.ess-sso-qr-frame img { max-width: 200px; max-height: 200px; }
.ess-sso-status { font-weight: 700; font-size: 0.92rem; margin: 0 0 4px; }
.ess-sso-timer { color: #64748b; font-size: 0.82rem; margin: 0 0 10px; }
.ess-sso-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
