/*
 * HeartWoodHR design layer (commercial edition).
 *
 * Loaded after every other stylesheet, so it restyles the shared building
 * blocks (shell, cards, buttons, inputs, tables, modals) for every page at
 * once. Colours come from the active theme (primary-* in the Tailwind
 * config); this file sets shape, type, spacing and surfaces.
 */

:root {
    --pd-accent: var(--primary-600, #0f766e);
    --pd-accent-hover: var(--primary-700, #115e59);
    --pd-accent-soft: var(--primary-300, #e6faf6);
    --pd-ink: #0f172a;
    --pd-ink-2: #334155;
    --pd-muted: #64748b;
    --pd-line: #e6e8ef;
    --pd-surface: #ffffff;
    --pd-canvas: #f6f7fb;
    --pd-radius: 10px;
    --pd-radius-lg: 14px;
    --pd-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.02);
    --pd-shadow-pop: 0 12px 32px -8px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.06);
}

/* ---- Type ------------------------------------------------------------- */
html body {
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif !important;
    /* Inter's alternate digits and single-storey a: reads crisper in tables. */
    font-feature-settings: "cv11", "ss01", "ss03", "tnum";
    color: var(--pd-ink-2);
    background: var(--pd-canvas);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, .oh-main__titlebar-title, .oh-modal__dialog-title {
    color: var(--pd-ink);
    letter-spacing: -0.015em;
}

/* ---- App shell -------------------------------------------------------- */
.oh-main-content,
#ohMainContent {
    background: var(--pd-canvas);
}

html body #sidebar {
    background: #fbfbfe !important;
    border-right: 1px solid var(--pd-line) !important;
}
html body #sidebar .sideboxmain {
    border-radius: 8px;
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
    color: var(--pd-ink-2);
}
html body #sidebar .sideboxmain .oh-sidebar-label {
    font-weight: 500;
    font-size: 13.5px;
}
/* Current page: soft tint with an accent bar instead of a solid block. */
html body #sidebar .sideboxmain.sidebox-current {
    background: var(--pd-accent-soft) !important;
    box-shadow: inset 3px 0 0 var(--pd-accent);
}
html body #sidebar .sideboxmain.sidebox-current .oh-sidebar-label,
html body #sidebar .sideboxmain.sidebox-current .sidebar-chevron {
    color: var(--pd-accent) !important;
}
html body #sidebar .sideboxmain.sidebox-current img {
    filter: none !important;
}
html body #sidebar .sideboxmain:hover:not(.sidebox-current) {
    background: #f1f2f8 !important;
}
html body #sidebar .sideboxmain:hover img {
    filter: none !important;
}
html body #sidebar .sidebar-subnav-link {
    border-radius: 6px;
    color: var(--pd-muted);
}
html body #sidebar .sidebar-subnav-link:hover {
    color: var(--pd-ink);
    background: #f1f2f8;
}
.pd-sidebar-icon {
    width: 18px;
    flex-shrink: 0;
    text-align: center;
    font-size: 15px;
    color: #8b93a7;
    transition: color 0.15s ease;
}
html body #sidebar .sideboxmain:hover .pd-sidebar-icon {
    color: var(--pd-ink-2);
}
html body #sidebar .sideboxmain.sidebox-current .pd-sidebar-icon {
    color: var(--pd-accent);
}
.pd-sidebar-section {
    margin: 1rem 0.75rem 0.35rem;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa3b5;
    white-space: nowrap;
}
html body #sidebar:not(:hover):not(.sidebar-pinned) .pd-sidebar-section {
    /* Collapsed rail: a thin divider keeps the grouping visible. */
    height: 1px;
    margin: 0.6rem 0.9rem;
    background: var(--pd-line);
    font-size: 0;
    opacity: 1 !important;
}

#mainHeader {
    background: rgba(255, 255, 255, 0.86) !important;
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--pd-line) !important;
    box-shadow: none !important;
}

/* ---- Surfaces --------------------------------------------------------- */
.shadow-card,
.oh-card,
.oh-wrapper .bg-white.rounded-md,
.oh-wrapper .bg-white.rounded-lg {
    box-shadow: var(--pd-shadow) !important;
    border: 1px solid var(--pd-line);
    border-radius: var(--pd-radius-lg) !important;
}
.oh-dropdown__menu,
.oh-modal__dialog {
    border-radius: var(--pd-radius-lg) !important;
    border: 1px solid var(--pd-line);
    box-shadow: var(--pd-shadow-pop) !important;
}
.oh-modal__dialog-header {
    border-bottom: 1px solid var(--pd-line);
}

/* ---- Buttons ---------------------------------------------------------- */
.oh-btn {
    border-radius: 8px !important;
    font-weight: 500;
    letter-spacing: -0.005em;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.oh-btn--secondary,
.oh-btn--primary {
    background: var(--pd-accent) !important;
    border-color: var(--pd-accent) !important;
    color: #fff !important;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--pd-accent) 25%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.oh-btn--secondary:hover,
.oh-btn--primary:hover {
    background: var(--pd-accent-hover) !important;
}
.oh-btn--light-bkg {
    background: var(--pd-surface) !important;
    border: 1px solid var(--pd-line) !important;
    color: var(--pd-ink-2) !important;
}
.oh-btn--light-bkg:hover {
    background: #f4f5fa !important;
}

/* ---- Forms ------------------------------------------------------------ */
.oh-input,
.oh-select,
.oh-select-2 + .select2 .select2-selection,
input[type="text"].oh-input,
textarea.oh-input {
    border-radius: 8px !important;
    border-color: #dfe2ea !important;
    background-color: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.oh-input:focus,
.oh-select:focus,
textarea.oh-input:focus {
    border-color: var(--pd-accent) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pd-accent) 15%, transparent) !important;
    outline: none;
}
.oh-label {
    color: var(--pd-ink-2);
    font-weight: 500;
}

/* ---- Tables ----------------------------------------------------------- */
.oh-sticky-table__th {
    background: #f8f9fc !important;
    color: var(--pd-muted) !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--pd-line) !important;
}
.oh-sticky-table__td {
    border-bottom: 1px solid #eef0f5 !important;
}
.oh-sticky-table__tr:hover .oh-sticky-table__td {
    background: #fafbff !important;
}

/* ---- Badges and alerts ------------------------------------------------ */
.oh-badge,
.badge {
    border-radius: 999px !important;
    font-weight: 500;
}
.oh-alert {
    border-radius: var(--pd-radius) !important;
    box-shadow: var(--pd-shadow-pop);
}

/* ---- Dark mode -------------------------------------------------------- */
body.dark {
    --pd-ink: #f1f5f9;
    --pd-ink-2: #cbd5e1;
    --pd-muted: #94a3b8;
    --pd-line: #263044;
    --pd-surface: #111827;
    --pd-canvas: #0b1120;
    --pd-accent-soft: rgba(20,184,166, 0.16);
}
html body.dark #sidebar {
    background: #0f1626 !important;
}
body.dark #mainHeader {
    background: rgba(15, 22, 38, 0.86) !important;
}
body.dark .oh-sticky-table__th {
    background: #121a2b !important;
}
body.dark .oh-sticky-table__tr:hover .oh-sticky-table__td {
    background: #131c30 !important;
}
html body.dark #sidebar .sideboxmain:hover:not(.sidebox-current),
html body.dark #sidebar .sidebar-subnav-link:hover {
    background: #172036 !important;
}

/* Font Awesome sidebar icons: the theme's image filters must not touch them. */
html body #sidebar nav .sideboxmain .pd-sidebar-icon {
    filter: none !important;
}
html body #sidebar .sideboxmain.sidebox-current {
    background-color: var(--pd-accent-soft) !important;
}

/* ---- Sign-in and other auth pages ------------------------------------- */
body.pd-auth {
    margin: 0;
    background: #fff;
}
.pd-auth__layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.pd-auth__brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    color: #ccfbf1;
    background:
        radial-gradient(1200px 600px at -10% 110%, rgba(45,212,191, 0.35), transparent 60%),
        radial-gradient(800px 500px at 110% -10%, rgba(56, 189, 248, 0.25), transparent 60%),
        linear-gradient(160deg, var(--pd-brand, var(--pd-accent)) 0%, var(--pd-brand-deep, var(--primary-900, #042f2e)) 100%);
}
.pd-auth__brand-top {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pd-auth__mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-weight: 700;
}
.pd-auth__product {
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.01em;
}
.pd-auth__headline {
    color: #fff;
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.025em;
    max-width: 16ch;
    margin-bottom: 28px;
}
.pd-auth__points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 14px;
    font-size: 15px;
}
.pd-auth__points li {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pd-auth__points i {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
}
.pd-auth__foot {
    font-size: 12px;
    color: rgba(224, 231, 255, 0.7);
}
.pd-auth__panel {
    display: grid;
    place-items: center;
    padding: 40px 24px;
}
.pd-auth__card {
    width: 100%;
    max-width: 380px;
}
.pd-auth__logo {
    border-radius: 12px;
    margin-bottom: 28px;
}
.pd-auth__title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--pd-ink);
    margin: 0 0 6px;
}
.pd-auth__subtitle {
    color: var(--pd-muted);
    font-size: 14px;
    margin: 0 0 28px;
}
.pd-auth__field {
    margin-bottom: 16px;
}
.pd-auth__field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--pd-ink-2);
    margin-bottom: 6px;
}
.pd-auth__label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.pd-auth__input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
    color: var(--pd-ink);
    border: 1px solid #dfe2ea;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pd-auth__input.oh-input--password {
    padding-right: 44px;
}
.pd-auth__input::placeholder {
    color: #a0a7b8;
}
.pd-auth__input:focus {
    outline: none;
    border-color: var(--pd-brand, var(--pd-accent));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--pd-accent) 14%, transparent);
}
.pd-auth__input--error {
    border-color: #ef4444;
}
.pd-auth__error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 6px;
}
.pd-auth__link {
    font-size: 13px;
    font-weight: 500;
    color: var(--pd-brand, var(--pd-accent));
}
.pd-auth__link:hover {
    text-decoration: underline;
}
.pd-auth__card .oh-password-input--toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: #8b93a7;
}
.pd-auth__submit {
    width: 100%;
    height: 46px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 10px;
    border: 0;
    background: var(--pd-brand, var(--pd-accent));
    color: #fff;
    font-weight: 600;
    font-size: 14.5px;
    cursor: pointer;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--pd-accent) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: filter 0.15s ease, transform 0.05s ease;
}
.pd-auth__submit:hover {
    filter: brightness(0.94);
}
.pd-auth__submit:active {
    transform: translateY(1px);
}
.pd-auth__setup {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--pd-line);
    display: grid;
    gap: 10px;
}
.pd-auth__setup-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--pd-ink-2);
}
.pd-auth__setup-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--pd-accent-soft);
    color: var(--pd-brand, var(--pd-accent));
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
}
.pd-auth__setup-btn--ghost {
    background: #fff;
    border: 1px solid var(--pd-line);
    color: var(--pd-ink-2);
}
@media (max-width: 860px) {
    .pd-auth__layout {
        grid-template-columns: 1fr;
    }
    .pd-auth__brand {
        display: none;
    }
}

/* Single-card auth pages (forgot / reset password). */
body.pd-auth-simple {
    background:
        radial-gradient(900px 500px at 0% 0%, color-mix(in srgb, var(--pd-accent) 10%, transparent), transparent 60%),
        radial-gradient(700px 400px at 100% 100%, rgba(14, 165, 233, 0.08), transparent 60%),
        var(--pd-canvas);
}
.pd-auth-simple__card {
    width: min(420px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid var(--pd-line);
    border-radius: 18px;
    padding: 40px 36px;
    box-shadow: var(--pd-shadow-pop);
}
.pd-auth-simple__card h1 {
    font-size: 24px !important;
    letter-spacing: -0.02em;
}
.pd-auth-simple__card input {
    border-radius: 10px !important;
}
.pd-auth-simple__card button[type="submit"] {
    border-radius: 10px !important;
    font-weight: 600;
}

/* ---- Home dashboard ---------------------------------------------------- */
.pd-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 18px;
}
.pd-quick-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--pd-line);
    background: var(--pd-surface);
    color: var(--pd-ink-2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.pd-quick-action i {
    color: var(--pd-accent);
    font-size: 13px;
}
.pd-quick-action:hover {
    border-color: #99e0d3;
    color: var(--pd-accent);
    box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--pd-accent) 18%, transparent);
}
.pd-quick-action--accent {
    background: var(--pd-accent);
    border-color: var(--pd-accent);
    color: #fff;
}
.pd-quick-action--accent i,
.pd-quick-action--accent:hover {
    color: #fff;
}
.md-header h1#pd-greeting {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.025em;
}
.md-kpi-card {
    border-radius: var(--pd-radius-lg) !important;
    border: 1px solid var(--pd-line) !important;
    box-shadow: var(--pd-shadow) !important;
}
body.dark .md-dashboard {
    background: var(--pd-canvas) !important;
}
body.dark .md-kpi-card,
body.dark .md-card,
body.dark .bg-white {
    background-color: var(--pd-surface) !important;
}

/* ---- Weekly timesheets (Module 7) ---- */
.pd-ts-grid th, .pd-ts-grid td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--pd-border, #E5E7EB); vertical-align: top; }
.pd-ts-grid thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--pd-muted, #64748B); }
.pd-ts-grid .pd-ts-target { min-width: 14rem; width: 100%; }
.pd-ts-cell { width: 4.2rem; text-align: center; padding: 0.35rem 0.25rem !important; font-variant-numeric: tabular-nums; }
.pd-ts-status { display: inline-block; margin-left: 0.4rem; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: #F1F5F9; color: #475569; }
.pd-ts-status--submitted { background: #ccfbf1; color: #134e4a; }
.pd-ts-status--approved { background: #DCFCE7; color: #166534; }
.pd-ts-status--returned { background: #FEF3C7; color: #92400E; }
body.dark .pd-ts-status { background: #1E293B; color: #CBD5E1; }
