/* 2CRSI Edge - design system v2 (2026-07-04 visual revamp).
   Grey/orange brand identity, centralised nav shell (see _AppLayout.cshtml
   and _Header.cshtml), responsive throughout. Replaces the v1 "minimal
   starting theme" - see DECISIONS.md for the brief §11 lineage (clean
   light layout, orange accent; chrome now grey per direct user request,
   content areas stay white/light as originally decided). */

:root {
    --ink-900: #202124;
    --ink-800: #3a3b3f;
    --ink-700: #4d4e52;
    --ink-600: #6b6c70;
    --orange-600: #f2801f;
    --orange-700: #d66c0f;
    --orange-100: #fef1e2;
    --bg: #f4f5f6;
    --surface: #ffffff;
    --border: #e2e3e6;
    --text: #202124;
    --muted: #6b6c70;
    --green: #2f8f4e;
    --green-bg: #eaf6ee;
    --red: #c0392b;
    --red-bg: #fdecea;
    --grey-chip: #eceef0;
    --font-sans: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-mono: "Cascadia Code", "SF Mono", Consolas, monospace;

    /* legacy variable names - still referenced by a handful of inline
       styles across older pages; keep pointed at the new palette rather
       than hunting down every literal reference. */
    --edge-orange: var(--orange-600);
    --edge-orange-dark: var(--orange-700);
    --edge-text: var(--text);
    --edge-muted: var(--muted);
    --edge-border: var(--border);
    --edge-bg: var(--bg);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

svg {
    display: block;
}

/* ================= Login / ChangePin ================= */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    padding: 2rem 1rem;
}

.login-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 10px 40px rgba(32, 33, 36, 0.08);
}

.login-brand {
    text-align: center;
    margin-bottom: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.login-brand img.brand-logo {
    height: 32px;
    width: auto;
}

.brand-2crsi, .brand-edge {
    /* retained for any leftover literal usage; superseded by the logo image */
    font-weight: 700;
}

.brand-edge {
    color: var(--orange-600);
}

.login-field {
    margin-bottom: 1rem;
}

.login-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.login-input {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-sans);
    background: #fff;
    color: var(--text);
}

.login-input:focus {
    outline: none;
    border-color: var(--orange-600);
    box-shadow: 0 0 0 3px var(--orange-100);
}

.login-validation {
    display: block;
    color: var(--red);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.login-error {
    background: var(--red-bg);
    border: 1px solid #f5c6cb;
    color: #a4293a;
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.login-button {
    width: 100%;
    background: var(--orange-600);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    font-family: var(--font-sans);
}

.login-button:hover {
    background: var(--orange-700);
}

/* ================= App shell ================= */

.app-body {
    margin: 0;
    background: var(--bg);
    min-height: 100vh;
}

.topnav {
    background: linear-gradient(180deg, var(--ink-700), var(--ink-800));
    color: #fff;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topnav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 16px;
    max-width: 1280px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 1px;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    text-decoration: none;
    color: #fff;
}

.brand .o {
    color: var(--orange-600);
}

.brand .w {
    color: #fff;
}

.portal-pills {
    display: flex;
    gap: 4px;
}

.portal-pills a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.68);
    font-size: 13.5px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.portal-pills a svg {
    width: 16px;
    height: 16px;
}

.portal-pills a.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.portal-pills a:hover {
    color: #fff;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-chip {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
}

.user-chip .avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--orange-600);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 12.5px;
    cursor: pointer;
    font-family: var(--font-sans);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.logout-btn svg {
    width: 15px;
    height: 15px;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
}

.mobile-drawer {
    display: none;
    background: var(--ink-800);
    padding: 8px 16px 14px;
}

.mobile-drawer.open {
    display: block;
}

.mobile-drawer a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 10px 6px;
    font-size: 14px;
    font-weight: 600;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-drawer a:first-child {
    border-top: none;
}

.mobile-drawer a svg {
    width: 17px;
    height: 17px;
}

.mobile-drawer a.active {
    color: var(--orange-600);
}

.page-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.page-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.page-header .crumb {
    font-size: 12.5px;
    color: var(--muted);
    margin: 0 0 3px;
}

.page-header h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.page-header .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.content {
    padding: 22px 24px 48px;
    max-width: 1280px;
    margin: 0 auto;
}

/* ================= Buttons & badges ================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--orange-600);
    color: #fff;
}

.btn-primary:hover {
    background: var(--orange-700);
}

.btn-secondary {
    background: #fff;
    color: var(--ink-800);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: #f6f7f8;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.pending { background: var(--orange-100); color: var(--orange-700); }
.badge.bad { background: var(--red-bg); color: var(--red); }
.badge.neutral { background: var(--grey-chip); color: var(--ink-700); }

/* ================= Sub-navigation tabs (used by Leave, Attendance,
   Training, HR Training/Capabilities, HR Attendance, Manager) ================= */

.subnav-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.subnav-tabs a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 13.5px;
    padding: 0.6rem 0.9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.subnav-tabs a.active {
    color: var(--text);
    border-bottom-color: var(--orange-600);
}

.subnav-tabs a:hover {
    color: var(--text);
}

.filter-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.25rem;
}

.filter-pills a {
    text-decoration: none;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: #fff;
    white-space: nowrap;
}

.filter-pills a.active {
    color: #fff;
    background: var(--ink-700);
    border-color: var(--ink-700);
}

.filter-pills a.accent.active {
    background: var(--orange-600);
    border-color: var(--orange-600);
}

/* ================= Dashboard cards ================= */

.edge-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.edge-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.15s, transform 0.15s;
}

.edge-card:hover {
    box-shadow: 0 6px 20px rgba(32, 33, 36, 0.10);
    transform: translateY(-1px);
}

.edge-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--orange-100);
    color: var(--orange-700);
    display: flex;
    align-items: center;
    justify-content: center;
}

.edge-card-icon svg {
    width: 20px;
    height: 20px;
}

.edge-card h3 {
    margin: 0 0 0.4rem 0;
    font-size: 15px;
    font-weight: 700;
}

.edge-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

/* ================= KPI row ================= */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 1.5rem;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: none;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--grey-chip);
    color: var(--ink-700);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon svg {
    width: 18px;
    height: 18px;
}

.kpi-label {
    font-size: 0.72rem;
    color: var(--muted);
    margin: 0 0 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-value {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    font-variant-numeric: tabular-nums;
}

/* ================= Panels & forms ================= */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.panel > h2 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ================= Data tables ================= */

.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 640px;
    background: var(--surface);
}

table.data th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 11px 14px;
    background: #fafbfb;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.data td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

table.data tbody tr:last-child td {
    border-bottom: none;
}

table.data tbody tr:hover {
    background: #fafbfb;
}

table.data .mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 12.5px;
    color: var(--muted);
}

table.data .row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

table.data .row-actions form {
    display: inline;
}

/* ================= Leave calendar ================= */

.leave-page {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 0 3rem;
}

.calendar-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: none;
    padding: 1.75rem;
}

.cal-nav-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cal-nav-v2 h2 {
    margin: 0;
    font-size: 1.2rem;
}

.cal-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
    white-space: nowrap;
}

.cal-nav-btn:hover {
    background: #f0f0f0;
}

.cal-grid-v2 {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cal-day-header-v2 {
    text-align: center;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-bottom: 0.5rem;
}

.cal-day-v2 {
    aspect-ratio: 1.15;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.cal-day-v2:hover {
    box-shadow: 0 2px 8px rgba(32, 33, 36, 0.12);
}

.cal-day-v2.cal-today {
    outline: 2px solid var(--ink-800);
    outline-offset: -2px;
}

.cal-working-v2 { background: #fff; color: var(--text); }
.cal-nonworking-v2 { background: #e9eaec; color: #8d8e92; cursor: default; }
.cal-outside-v2 { background: #f6f6f7; color: #cfcfd1; cursor: default; border-color: #f0f0f1; }
.cal-pending-v2 { background: var(--orange-600); color: #fff; border-color: var(--orange-600); }
.cal-approved-v2 { background: var(--green); color: #fff; border-color: var(--green); }

.cal-legend-v2 {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text);
}

.swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 0.4rem;
    vertical-align: middle;
    border: 1px solid var(--border);
}

.cal-dialog {
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 360px;
    width: calc(100% - 2rem);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.cal-dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.mgr-day { background: var(--green); }
.mgr-day.mgr-pending { background: var(--orange-600); }
.mgr-day.mgr-approved { background: var(--red); }
.mgr-day.mgr-clear { background: var(--green); }
.mgr-clear-v2 { background: var(--green); color: #fff; border-color: var(--green); }
.mgr-pending-v2 { background: var(--orange-600); color: #fff; border-color: var(--orange-600); }
.mgr-approved-v2 { background: var(--red); color: #fff; border-color: var(--red); }

/* ================= Responsive ================= */

@media (max-width: 760px) {
    .portal-pills { display: none; }
    .hamburger { display: inline-flex; }
    .nav-right .user-chip span.chip-text { display: none; }
    .field-row { grid-template-columns: 1fr; }
    .page-header { padding: 14px 16px; }
    .page-header h1 { font-size: 17px; }
    .content { padding: 16px 14px 40px; }
    .panel { padding: 16px; }
    .cal-day-v2 { font-size: 0.75rem; padding: 0.3rem; border-radius: 6px; }
    .cal-grid-v2 { gap: 4px; }
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .edge-cards { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .kpi-row { grid-template-columns: 1fr; }
    .login-card { padding: 1.75rem 1.25rem; }
}
