* {
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: #1f2430;
}

/* ---------- Login page ---------- */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-image: url("../images/frontpage_12.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
    padding: 40px 44px;
}

.login-logo {
    display: block;
    max-width: 260px;
    margin: 0 auto 24px;
}

.login-card h1 {
    text-align: center;
    font-size: 1.6rem;
    margin: 0 0 28px;
    color: #1f2430;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #eaf0fb;
    font-size: 1rem;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: #dc2626;
    background: #f2f6fd;
}

.show-password-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: #dc2626;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary:hover {
    background: #b91c1c;
}

.login-error {
    background: #fdecea;
    color: #b91c1c;
    border: 1px solid #f3c1bf;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* ---------- Dashboard shell ----------
   Colors/sizes below are lifted from the production reference
   (dtr_navigation_1.php + index.php's inline <style> block) rather than
   guessed, then applied through our own class names. */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    /* Stays put as the page content scrolls, instead of scrolling away
       with it — the sidebar scrolls internally on its own if its own
       nav content (many expanded groups) is taller than the viewport. */
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-nav {
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 10px 8px 12px;
}

.sidebar-nav li {
    margin: 4px 6px;
}

.sidebar-nav a,
.sidebar-bottom a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    background: transparent;
    transition: background 0.15s ease;
}

.sidebar-nav a:hover,
.sidebar-bottom a:hover {
    background: rgba(255, 255, 255, 0.22);
}

.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.sidebar-bottom {
    margin: 12px 6px 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.menu-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
    line-height: 1;
}

/* ---------- Sidebar nav groups (collapsible submenus) ----------
   Adapted from production's .nav-group / .nav-group-toggle /
   .nav-group-items / .nav-group-chevron pattern (dtr_navigation_1.php),
   renamed into our .sidebar-nav-* convention. */

.sidebar-nav-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.sidebar-nav-group-toggle:hover {
    background: rgba(255, 255, 255, 0.22);
}

.sidebar-nav-badge {
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 999px;
    min-width: 10px;
    text-align: center;
}

.sidebar-nav-group-chevron {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.8;
    transition: transform 0.15s ease;
}

.sidebar-nav-group.open .sidebar-nav-group-chevron {
    transform: rotate(180deg);
}

.sidebar-nav-group-items {
    display: none;
    list-style: none;
    margin: 0;
    padding: 4px 0 4px 14px;
}

.sidebar-nav-group.open .sidebar-nav-group-items {
    display: block;
}

.sidebar-nav-group-items li {
    margin: 2px 6px;
}

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

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 50px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.system-badge {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 0.9rem;
}

/* ---------- User menu (top-right name/role dropdown) ---------- */

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1565c0;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.user-text {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    text-align: right;
}

.user-name {
    font-weight: 700;
}

.user-role {
    color: #666666;
}

.chev {
    font-size: 14px;
    color: #1565c0;
    user-select: none;
    transition: transform 0.2s ease;
}

.user-menu.open .chev {
    transform: rotate(180deg);
}

.role-switch {
    position: absolute;
    right: 0;
    top: 46px;
    min-width: 170px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    padding: 4px;
    z-index: 1000;
    display: none;
}

.user-menu.open .role-switch {
    display: block;
}

.role-switch button {
    width: 100%;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    border-radius: 4px;
    font-size: 14px;
    color: #1f2937;
    cursor: pointer;
    text-align: left;
    display: block;
}

.role-switch button:hover {
    background: #f3f4f6;
}

.role-switch button.active {
    background: #eef2ff;
    color: #0d47a1;
    font-weight: 600;
}

.preview-banner {
    background: #fff4e5;
    color: #8a5a00;
    border-bottom: 1px solid #f3d9a4;
    padding: 8px 28px;
    font-size: 0.85rem;
    text-align: center;
}

.content {
    flex: 1;
    padding: 40px 28px;
    background-image: url("../images/frontpage_12.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
}

/* ---------- Clock-in/out card ---------- */

.clock-card {
    width: 100%;
    max-width: 640px;
    height: fit-content;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06);
    padding: 28px 32px;
    text-align: center;
}

.clock-card h2 {
    margin: 0 0 14px;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

/* Small circular clock button — no glyph, just a glossy colored dot,
   matching production's .clock-icon exactly. */
.clock-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    font-size: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 6px auto 12px;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.clock-button::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 8px;
    width: 18px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    pointer-events: none;
}

.clock-button:hover {
    transform: translateY(-1px);
}

.clock-button:active {
    transform: translateY(0);
}

.clock-button.clock-in {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 16px rgba(22, 163, 74, 0.35);
}

.clock-button.clock-out {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 16px rgba(220, 38, 38, 0.35);
}

.clock-button.done {
    background: #9aa1ac;
    cursor: default;
    font-size: 14px;
    color: #ffffff;
}

.clock-button.done::after {
    content: none;
}

.attendance-timer {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 4px;
}

.clock-status-time {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.clock-hint {
    color: #6b7280;
    font-size: 15px;
    margin: 6px 0 18px;
}

.clock-help-link {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 0;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
}

.clock-help-link:hover {
    color: #b91c1c;
    text-decoration: underline;
}

.location-help-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.location-help-section h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 800;
    color: #111827;
}

.location-help-section ol {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
}

.clock-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    font-size: 14px;
    color: #374151;
}

.clock-stats div {
    text-align: center;
    line-height: 1.35;
}

.clock-stats .stat-label {
    display: block;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 6px;
}

.clock-stats .stat-value {
    font-weight: 400;
}

/* ---------- Floating "+" quick-actions button ----------
   Ported from production's .fab-wrapper / .fab-main / .fab-menu / .fab-btn
   / .fab-overlay pattern (index.php's inline <style>), renamed into our
   .quick-actions-* convention. */

.quick-actions-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.quick-actions-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 900;
}

.quick-actions-wrapper.open .quick-actions-overlay {
    opacity: 1;
    visibility: visible;
}

.quick-actions-main {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border: none;
    font-size: 34px;
    line-height: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55), background 0.3s;
    z-index: 1001;
    position: relative;
}

.quick-actions-main:hover {
    background: #b91c1c;
}

.quick-actions-main.active {
    transform: rotate(225deg);
}

.quick-actions-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: scale(0);
    transform-origin: bottom right;
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.25s ease;
    z-index: 1000;
}

.quick-actions-wrapper.open .quick-actions-menu {
    transform: scale(1);
    opacity: 1;
}

.quick-actions-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    letter-spacing: 0.2px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quick-actions-btn:hover {
    transform: translateY(-2px);
}

.quick-actions-btn.red {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.quick-actions-btn.darkred {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
}

.quick-actions-btn.crimson {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
}

.quick-actions-btn.maroon {
    background: linear-gradient(180deg, #b91c1c 0%, #7f1d1d 100%);
}

/* ---------- Leave request form ----------
   Adapted from production's .toff-* classes (dtr_request_time_off.php's
   inline <style>), renamed into our .leave-* convention. Card shape/
   button shape are now deliberately unified with the "ui-*" kit below
   (see that section's own comment) so a .leave-card page and a .ui-panel
   page are visually indistinguishable — same radius, border, shadow. The
   .leave-* names stay (renaming every request/HR form's markup across the
   app for naming purity alone wasn't worth the churn/risk), but the
   pixels now match. */

.leave-card {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    padding: 24px 26px;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.leave-back {
    display: inline-block;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #7f1d1d;
    text-decoration: none;
}

.leave-back:hover {
    text-decoration: underline;
}

.leave-title {
    font-weight: 700;
    font-size: 24px;
    line-height: 1.2;
    margin: 0 0 14px;
    color: #111827;
}

.leave-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 20px;
}

.leave-chip {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #7f1d1d;
}

.leave-chip b {
    font-weight: 800;
}

.leave-grid-3 {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 14px;
}

@media (max-width: 900px) {
    .leave-grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .leave-grid-3 {
        grid-template-columns: 1fr;
    }
}

.leave-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 600px) {
    .leave-grid-2 {
        grid-template-columns: 1fr;
    }
}

.leave-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 6px 0 6px;
}

.leave-select,
.leave-input,
.leave-text {
    width: 100%;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    background: #ffffff;
    outline: none;
    height: 40px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea.leave-text {
    height: auto;
    padding-top: 9px;
}

.leave-select:focus,
.leave-input:focus,
.leave-text:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.28);
}

.leave-submit {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    min-width: 130px;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.28);
    transition: filter 0.15s, transform 0.03s;
}

.leave-submit:hover {
    filter: brightness(0.97);
}

.leave-submit:active {
    transform: translateY(1px);
}

/* Secondary/ghost action — used for Cancel/Delete/Remove/small Save
   buttons across the HR Employee Info tabs. This class was referenced in
   several views but never actually defined, so those buttons silently
   rendered as unstyled browser defaults; fixed here as the shared ghost-
   button look (visually identical to .ui-btn-ghost). */
.leave-secondary-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #111827;
    border: 1px solid #d1d5db;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.leave-secondary-button:hover {
    background: #f9fafb;
}

/* ---------- OT/UT info note (amber guide box) ----------
   Adapted from production's .ot-note (dtr_ot_form.php / dtr_ut_form.php's
   inline <style>), reused for both OT and UT filing guides. */

.info-note {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 13px;
    line-height: 1.55;
}

.info-note strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #7c2d12;
}

.info-note ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.info-note li {
    margin: 4px 0;
}

.hidden-gap {
    display: none;
}

/* ---------- Rest-day picker (Add Account page) ----------
   Simplified adaptation of production's checkbox-pill rest-day picker
   (dtr_employee_add_account.php), reusing this app's existing red palette
   instead of a separate --brand variable. */

.rest-day-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 10px;
}

@media (max-width: 640px) {
    .rest-day-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.rest-day-option {
    position: relative;
}

.rest-day-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rest-day-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    margin: 0;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.rest-day-option input:checked + label {
    border-color: #dc2626;
    background: #fff1f2;
    color: #7f1d1d;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}

.rest-day-error {
    display: none;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fff1f2;
    color: #991b1b;
    font-size: 13px;
    font-weight: 700;
}

/* =========================================================
   UNIVERSAL ADMIN PAGE KIT ("ui-*")
   ---------------------------------------------------------
   Introduced for the Loan Management page (Hr\LoanController /
   hr.loans.index) as a reusable design system, not a one-off — every
   future admin/data-heavy page (payroll, more HR modules, etc.) should
   reach for these classes instead of the ad hoc inline styles and raw
   <table border="1"> markup earlier admin pages (overtime/undertime/
   leave/schedule approval lists) used. This is loosely modeled on
   production's dtr_loans_admin.php inline <style> block (card/table/
   badge shapes) but deliberately generalized and namespaced under
   "ui-" instead of "loan-", and re-themed onto this app's own existing
   red palette (#dc2626/#b91c1c) rather than introducing a separate
   --brand token, so it visually matches the rest of the app (sidebar,
   .leave-* forms, etc.) instead of looking like a bolted-on page.
   ========================================================= */

.ui-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ui-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.ui-page-title {
    font-weight: 800;
    font-size: clamp(22px, 2.6vw, 30px);
    color: #111827;
    margin: 0 0 8px;
}

.ui-page-accent {
    height: 4px;
    width: 72px;
    border-radius: 8px;
    background: linear-gradient(90deg, #dc2626, #7f1d1d);
}

.ui-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.ui-alert {
    border-radius: 10px;
    padding: 11px 15px;
    font-weight: 600;
    font-size: 14px;
}

.ui-alert-success {
    background: #eaf7ee;
    color: #0b7a4b;
    border: 1px solid #bfe9cd;
}

.ui-alert-danger {
    background: #fdecec;
    color: #b42318;
    border: 1px solid #f6c8c8;
}

.ui-alert-warning {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.ui-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    padding: 24px 26px;
}

.ui-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: #111827;
    margin: 0 0 16px;
}

.ui-panel-title::before {
    content: "";
    width: 6px;
    height: 22px;
    border-radius: 8px;
    background: linear-gradient(180deg, #dc2626, #7f1d1d);
}

.ui-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ui-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 900px) {
    .ui-grid-2,
    .ui-grid-3 {
        grid-template-columns: 1fr;
    }
}

.ui-field-full {
    grid-column: 1 / -1;
}

.ui-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 6px;
}

.ui-input,
.ui-select,
.ui-textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    background: #ffffff;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ui-textarea {
    min-height: 90px;
    resize: vertical;
}

.ui-input:focus,
.ui-select:focus,
.ui-textarea:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.ui-input:read-only {
    background: #f9fafb;
    color: #6b7280;
}

.ui-hint {
    color: #6b7280;
    font-size: 12.5px;
    margin-top: 6px;
}

.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: filter 0.15s, transform 0.03s, box-shadow 0.15s;
}

.ui-btn:active {
    transform: translateY(1px);
}

.ui-btn-primary {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.28);
}

.ui-btn-primary:hover {
    filter: brightness(0.97);
}

.ui-btn-danger {
    background: #e11d48;
    color: #ffffff;
}

.ui-btn-danger:hover {
    filter: brightness(0.95);
}

.ui-btn-ghost {
    background: #ffffff;
    color: #111827;
    border: 1px solid #d1d5db;
}

.ui-btn-ghost:hover {
    background: #f9fafb;
}

.ui-btn-sm {
    padding: 7px 11px;
    font-size: 12.5px;
    border-radius: 8px;
}

.ui-filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 18px;
}

.ui-filter-field {
    flex: 1;
    min-width: 220px;
}

.ui-edit-panel {
    border: 1px dashed #d1d5db;
    border-radius: 16px;
    padding: 16px 18px;
    margin: 0 0 18px;
    background: #fafafa;
}

.ui-table-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
}

.ui-table {
    width: 100%;
    border-collapse: collapse;
}

.ui-table thead th {
    background: #fafafa;
    color: #374151;
    font-weight: 700;
    font-size: 13px;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.ui-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f2f4;
    vertical-align: middle;
    font-size: 13.5px;
}

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

.ui-table tbody tr:hover td {
    background: #fcfcfd;
}

.ui-text-end {
    text-align: right;
}

.ui-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.ui-badge-success {
    background: #e7f2ff;
    color: #0b62c6;
}

.ui-badge-danger {
    background: #fdecec;
    color: #b42318;
}

.ui-badge-warning {
    background: #fff7ed;
    color: #9a3412;
}

.ui-badge-neutral {
    background: #f3f4f6;
    color: #4b5563;
}

.ui-sort-link {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.ui-sort-link:hover {
    color: #dc2626;
    text-decoration: underline;
}

@media (max-width: 900px) {
    .ui-panel {
        padding: 18px;
    }

    .ui-table-wrap {
        border: none;
    }

    .ui-table thead {
        display: none;
    }

    .ui-table tbody tr {
        display: block;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
        padding: 10px;
        margin: 0 0 12px;
    }

    .ui-table tbody td {
        display: grid;
        grid-template-columns: 130px 1fr;
        gap: 10px;
        padding: 8px 6px;
        border-bottom: 0;
    }

    .ui-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #374151;
    }

    .ui-text-end {
        text-align: left;
    }
}

.ui-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1200;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px;
}

.ui-modal-overlay.open {
    display: flex;
}

.ui-modal {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 20px 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.ui-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.ui-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #111827;
}

.ui-modal-close {
    border: 0;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
}

.ui-modal-sub {
    margin: 6px 0 16px;
    color: #6b7280;
    font-size: 13px;
}

.ui-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

/* Plain inline text link inside table cells ("View", "Manage access") —
   replaces the ad hoc inline color:#dc2626 styles each page used to write
   for the same thing. */
.ui-link {
    color: #dc2626;
    font-weight: 700;
    text-decoration: none;
}

.ui-link:hover {
    text-decoration: underline;
}

/* ---------- Identity header + tabs (HR Employee Info) ----------
   Shared by any future record-with-tabs page, not just Employee Info:
   an avatar + name/subtitle block, and an underline-style tab strip. */

.ui-identity {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.ui-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    flex-shrink: 0;
}

.ui-identity-name {
    font-size: 22px;
    font-weight: 800;
    color: #1f2937;
}

.ui-identity-sub {
    color: #6b7280;
    margin-top: 2px;
    font-size: 13.5px;
}

.ui-identity-meta {
    color: #9ca3af;
    font-size: 13px;
    margin-top: 2px;
}

.ui-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin: 18px 0 0;
    border-bottom: 1px solid #e5e7eb;
}

.ui-tab {
    padding: 10px 16px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    color: #6b7280;
    border-radius: 10px 10px 0 0;
    margin-bottom: -1px;
    border: 1px solid transparent;
}

.ui-tab:hover {
    color: #111827;
    background: #f9fafb;
}

.ui-tab.active {
    color: #b91c1c;
    background: #fff5f5;
    border-color: #e5e7eb;
    border-bottom-color: #fff5f5;
}

.ui-section-heading {
    font-weight: 700;
    font-size: 16px;
    color: #111827;
    margin: 0 0 14px;
}

.ui-section-heading.spaced {
    margin-top: 26px;
}

.ui-form-actions {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Read-only key/value display grid — for pages that show data with no
   edit capability at all (e.g. My Profile's Employment tab), as opposed
   to .leave-grid-2's disabled-until-Edit form inputs. */
.ui-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 14px 24px;
}

@media (max-width: 900px) {
    .ui-detail-grid {
        grid-template-columns: 1fr;
    }
}

.ui-detail-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
}

.ui-detail-label {
    font-size: 11.5px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 700;
    margin-bottom: 6px;
}

.ui-detail-value {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
}

/* ---------- Payslip document ----------
   Read from production's dtr_payslip_summary_admin_view.php as a design
   guide (the real company payslip UI: a bordered document card, not a
   generic dashboard panel) — colors reuse this app's existing red
   palette instead of the reference's own inline styles. */

.payslip-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 14px;
}

.payslip-wrap {
    max-width: 860px;
    margin: 0 auto 40px;
}

.payslip-card {
    background: #ffffff;
    border: 2px solid #111827;
    border-radius: 6px;
    padding: 22px 26px 34px;
}

.payslip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.payslip-title {
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.2px;
    color: #111827;
}

.payslip-sub {
    font-weight: 700;
    font-size: 12px;
    margin-top: 3px;
    color: #b91c1c;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.payslip-right {
    text-align: right;
    font-size: 12px;
}

.payslip-idbox {
    display: inline-block;
    min-width: 140px;
    border: 1px solid #111827;
    padding: 6px 10px;
    font-weight: 800;
    background: #f3f4f6;
    margin-top: 4px;
}

.payslip-hrline {
    border-top: 2px solid #111827;
    margin: 14px 0;
}

.payslip-meta {
    display: grid;
    grid-template-columns: 180px 1fr;
    row-gap: 7px;
    column-gap: 12px;
    font-size: 13px;
}

.payslip-meta .lbl {
    font-weight: 800;
    color: #374151;
}

.payslip-meta .val {
    font-weight: 700;
    color: #111827;
}

.payslip-meta .name-red {
    color: #b91c1c;
    font-weight: 900;
}

.payslip-section-bar {
    margin: 16px 0 6px;
    background: #f3f4f6;
    border: 1px solid #111827;
    font-weight: 900;
    padding: 5px 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #111827;
}

.payslip-section-bar.deductions {
    background: #fee2e2;
    color: #7f1d1d;
    border-color: #b91c1c;
}

.payslip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.payslip-table td {
    padding: 4px 6px;
    vertical-align: top;
}

.payslip-table .desc {
    width: 52%;
}

.payslip-table .qty {
    width: 16%;
    text-align: right;
    white-space: nowrap;
    color: #4b5563;
}

.payslip-table .amt {
    width: 32%;
    text-align: right;
    white-space: nowrap;
    font-weight: 800;
    color: #111827;
}

.payslip-table .redline td {
    color: #b91c1c !important;
    font-weight: 800;
}

.payslip-total-row td {
    border-top: 2px solid #111827;
    padding-top: 8px;
    font-weight: 900;
    color: #111827;
}

.payslip-note {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

.payslip-net-box {
    border-top: 3px double #111827;
    margin-top: 16px;
    padding-top: 12px;
}

.payslip-net-row {
    display: flex;
    justify-content: space-between;
    font-size: 17px;
    font-weight: 900;
    color: #111827;
}

.payslip-footer-note {
    margin-top: 10px;
    font-size: 11px;
    color: #6b7280;
}

@media print {
    body * {
        visibility: hidden;
    }

    .payslip-card,
    .payslip-card * {
        visibility: visible;
    }

    .payslip-card {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        border: 2px solid #111827;
    }

    .payslip-actions,
    .sidebar,
    .topbar {
        display: none !important;
    }

    .main-area,
    .content {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ---------- Report a Problem — attachment thumbnail ---------- */
.report-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* ---------- Generate Report — report-center card grid ---------- */
.ui-report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.ui-report-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ui-report-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #fee2e2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 8px;
}

.ui-report-card h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.ui-report-card p {
    margin: 4px 0 12px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
    flex-grow: 1;
}

/* ---------- Generate Report — .xls-styled preview/export tables ---------- */
.report-doc-title {
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    background: #7f1d1d;
    color: #ffffff;
    padding: 8px;
}

.report-doc-subtitle {
    text-align: center;
    background: #fee2e2;
    font-weight: 700;
    padding: 6px;
}

.report-doc-header {
    background: #dc2626;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
}

.report-doc-total {
    font-weight: 800;
    background: #f3f4f6;
}

.report-doc-alert {
    background: #fecaca;
    color: #991b1b;
    font-weight: 700;
}
