/* ===== El Conquistador Recruitment - CoreUI Custom Styles ===== */

@font-face {
    font-family: 'FontAwesome';
    src: url('/lib/font-awesome/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),
         url('/lib/font-awesome/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

a.navbar-brand {
    white-space: normal;
    text-align: center;
    word-break: break-all;
}

a {
    color: #0077cc;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.border-top {
    border-top: 1px solid #e5e5e5;
}

.border-bottom {
    border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

button.accept-policy {
    font-size: 1rem;
    line-height: inherit;
}

/* Job listing cards */
.job-card { transition: box-shadow .2s, transform .2s; }
.job-card:hover { box-shadow: 0 .25rem .75rem rgba(0,0,0,.12); transform: translateY(-2px); color: inherit; }

/* ===== Jobs page — modern redesign ===== */

/* Hero banner */
.jobs-hero {
    background: linear-gradient(135deg, #1e3a6e 0%, #2d5be3 50%, #5ea3ff 100%);
    border-radius: 1rem;
    padding: 2rem 2.25rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.jobs-hero::before {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
}
.jobs-hero-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}
.jobs-hero-title {
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
}
.jobs-hero-sub {
    opacity: 0.75;
    font-size: 0.95rem;
}
.jobs-hero-badge {
    text-align: center;
    flex-shrink: 0;
}
.jobs-count {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
}
.jobs-count-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: 0.7;
}

/* Vacancy cards */
.jobs-card {
    display: flex;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 0.75rem;
    margin-bottom: 0.85rem;
    overflow: hidden;
    border: 1px solid var(--cui-border-color, #d8dbe0);
    transition: box-shadow .25s, transform .25s;
}
.jobs-card:hover, .jobs-card:focus-visible {
    box-shadow: 0 8px 24px rgba(45, 91, 227, .14);
    transform: translateY(-3px);
    color: inherit;
    border-color: #2d5be3;
}
.jobs-card-accent {
    width: 5px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #2d5be3, #5ea3ff);
}
.jobs-card:hover .jobs-card-accent {
    width: 6px;
}
.jobs-card-body {
    flex: 1;
    padding: 1.1rem 1.25rem;
}
.jobs-card-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: #1e3a6e;
}
.jobs-card-arrow {
    color: #b0b8c8;
    font-size: 0.85rem;
    transition: transform .2s, color .2s;
}
.jobs-card:hover .jobs-card-arrow {
    color: #2d5be3;
    transform: translateX(3px);
}

/* Pills */
.jobs-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.jobs-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #f0f4ff;
    color: #3c4b64;
    font-size: 0.76rem;
    font-weight: 500;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
}
.jobs-pill .fa {
    font-size: 0.72rem;
    color: #2d5be3;
    opacity: 0.7;
}

/* Salary highlight */
.jobs-salary {
    color: #0d8a3e;
    font-weight: 700;
    font-size: 0.88rem;
}

/* Empty state */
.jobs-empty-card {
    border-radius: 0.75rem;
}

/* Sidebar step card */
.jobs-steps-card {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.jobs-step {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.6rem;
    font-size: 0.88rem;
    color: #3c4b64;
}
.jobs-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d5be3, #5ea3ff);
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Location card */
.jobs-location-card {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* CTA gradient card */
.jobs-cta-card {
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #1e3a6e 0%, #2d5be3 60%, #5ea3ff 100%);
    overflow: hidden;
    position: relative;
}
.jobs-cta-card::before {
    content: '';
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 140px;
    height: 140px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
}
.jobs-cta-body {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

@media (max-width: 576px) {
    .jobs-hero { padding: 1.25rem 1rem; border-radius: 0.75rem; }
    .jobs-hero-title { font-size: 1.2rem; }
    .jobs-hero-inner { flex-direction: column; text-align: center; }
    .jobs-count { font-size: 2rem; }
    .jobs-card-body { padding: 0.85rem 1rem; }
    .jobs-pill { font-size: 0.7rem; padding: 0.2rem 0.5rem; }
}

/* ===== Details page — modern redesign ===== */

/* Hero */
.detail-hero {
    background: linear-gradient(135deg, #1e3a6e 0%, #2d5be3 50%, #5ea3ff 100%);
    border-radius: 1rem;
    padding: 2rem 2.25rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.detail-hero::before {
    content: '';
    position: absolute;
    right: -50px;
    top: -50px;
    width: 220px;
    height: 220px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
}
.detail-hero-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}
.detail-back-link {
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 0.5rem;
    transition: color .2s;
}
.detail-back-link:hover {
    color: #fff;
}
.detail-hero-title {
    font-weight: 800;
    font-size: 1.65rem;
    letter-spacing: -0.02em;
    margin: 0 0 0.6rem;
}
.detail-hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.detail-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.9);
    font-size: 0.76rem;
    font-weight: 500;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}
.detail-hero-pill .fa {
    font-size: 0.72rem;
    opacity: 0.7;
}
.detail-hero-actions {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-end;
}
.detail-salary-badge {
    background: rgba(255,255,255,.15);
    color: #b8ffc9;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0.45rem 1rem;
    border-radius: 0.6rem;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

/* Summary callout */
.detail-summary {
    background: #f0f4ff;
    border-left: 4px solid #2d5be3;
    border-radius: 0 0.6rem 0.6rem 0;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    color: #1e3a6e;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Content sections */
.detail-section {
    background: #fff;
    border: 1px solid var(--cui-border-color, #d8dbe0);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden;
}
.detail-section-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--cui-border-color, #d8dbe0);
    background: #fafbfc;
    color: #1e3a6e;
}
.detail-section-title .fa {
    color: #2d5be3;
    margin-right: 0.3rem;
}
.detail-section-body {
    padding: 1.1rem 1.25rem;
    line-height: 1.7;
    color: #3c4b64;
}
.detail-section-body p {
    margin-bottom: 0;
}

/* Sidebar docs card */
.detail-docs-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.detail-doc-item {
    display: flex;
    gap: 0.7rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid #f0f2f5;
}
.detail-doc-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.detail-doc-item:first-child {
    padding-top: 0;
}
.detail-doc-icon {
    width: 32px;
    height: 32px;
    border-radius: 0.45rem;
    background: #f0f4ff;
    color: #2d5be3;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

/* CTA card */
.detail-cta-card {
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #1e3a6e 0%, #2d5be3 60%, #5ea3ff 100%);
    overflow: hidden;
    position: relative;
}
.detail-cta-card::before {
    content: '';
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 130px;
    height: 130px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
}
.detail-cta-body {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Location card */
.detail-location-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

@media (max-width: 576px) {
    .detail-hero { padding: 1.25rem 1rem; border-radius: 0.75rem; }
    .detail-hero-title { font-size: 1.25rem; }
    .detail-hero-inner { flex-direction: column; }
    .detail-hero-actions { align-items: flex-start; }
}

/* Skip link */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100%;
    background: var(--cui-primary);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 0.4rem;
    z-index: 2000;
}
.skip-link:focus {
    top: 1rem;
}

/* Sidebar brand */
.sidebar-brand-full {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

/* Sidebar logo icon */
.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 0.55rem;
    background: linear-gradient(135deg, #2d5be3, #5ea3ff);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.sidebar-logo-icon--sm {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
}

/* Sidebar background modernized */
#sidebar.sidebar-dark {
    background: linear-gradient(180deg, #0f1b2d 0%, #162a46 100%);
    border-right: none !important;
}
#sidebar .sidebar-header {
    border-bottom-color: rgba(255,255,255,.08) !important;
}

/* Section titles */
.sidebar-section-title {
    font-size: 0.68rem !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase;
    color: rgba(255,255,255,.35) !important;
    padding-top: 1.2rem !important;
}

/* Nav link modernized */
.sidebar-link {
    border-radius: 0.5rem !important;
    margin: 2px 0.65rem !important;
    padding: 0.55rem 0.75rem !important;
    font-size: 0.88rem !important;
    font-weight: 500;
    color: rgba(255,255,255,.7) !important;
    transition: background .2s, color .2s !important;
}
.sidebar-link:hover {
    background: rgba(255,255,255,.08) !important;
    color: #fff !important;
}
.sidebar-link.active,
.sidebar .nav-link.active {
    background: rgba(45, 91, 227, .22) !important;
    color: #5ea3ff !important;
}
.sidebar-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 0.92rem;
    opacity: 0.7;
}
.sidebar-link:hover .nav-icon,
.sidebar-link.active .nav-icon {
    opacity: 1;
}

/* Sidebar footer */
.sidebar-footer {
    margin-top: auto;
    border-top-color: rgba(255,255,255,.08) !important;
}

/* Header bar modernized */
.header.header-sticky {
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* Avatar circle (user dropdown) */
.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d5be3 0%, #5ea3ff 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Header toggler icon sizing */
#sidebarToggle {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    color: #3c4b64;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    text-decoration: none;
}
#sidebarToggle:hover { color: #1e3a6e; }

/* Language switcher */
.lang-globe {
    color: #3c4b64;
    font-size: 1rem;
}
.lang-select {
    background: #ffffff;
    border: 1px solid #c6ccd6;
    border-radius: 6px;
    color: #2f3a4a;
    font-size: .78rem;
    font-weight: 700;
    padding: 3px 8px;
    cursor: pointer;
    outline: none;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.lang-select:hover, .lang-select:focus {
    background: #f8fafc;
    border-color: #8ea0b5;
    box-shadow: 0 0 0 2px rgba(45, 91, 227, .12);
}
.lang-select option {
    background: #ffffff;
    color: #2f3a4a;
}

/* Logout button in dropdown */
.logout-btn {
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    padding: 0.25rem 1rem;
    color: inherit;
    cursor: pointer;
    font-size: inherit;
}
.logout-btn:hover {
    background-color: var(--cui-dropdown-link-hover-bg, #f0f0f0);
}

/* Card header with icon + title */
.card-header strong {
    font-weight: 600;
}

/* KPI stat cards */
a.stat-card { transition: transform .2s, box-shadow .2s; cursor: pointer; }
a.stat-card:hover { transform: translateY(-3px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.2); color: inherit; }
.stat-card .card-body {
    padding: 1.25rem;
}
.stat-card .fs-4 {
    line-height: 1.2;
}

/* Document well for Apply page */
.doc-well {
    border: 1px solid var(--cui-border-color, #d8dbe0);
    border-radius: var(--cui-border-radius, 0.375rem);
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--cui-tertiary-bg, #f8f9fa);
}

/* Reveal animation */
.reveal-up {
    opacity: 0;
    transform: translateY(10px);
    animation: reveal-up 540ms ease forwards;
}
@keyframes reveal-up {
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */
footer.footer {
    position: relative !important;
    font-size: 0.85rem;
    color: #374151;
    justify-content: center;
}

footer.footer .footer-content {
    width: 100%;
    text-align: center;
}

footer.footer a {
    color: #0b57b7;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Contrast fixes (Lighthouse AA) */
.text-success,
.small.text-success,
.small.mt-1.text-success,
.fs-4.fw-bold.text-success {
    color: #146c43 !important;
}

.bg-success,
.badge.bg-success,
span.badge.bg-success.fs-6.px-3.py-2 {
    background-color: #146c43 !important;
    color: #ffffff !important;
}

.card.border-success,
div.card.mb-4.border-success {
    border-color: #146c43 !important;
}

.bg-success.bg-opacity-10 {
    background-color: #d9f2e3 !important;
}

.border-success.border-opacity-25 {
    border-color: #146c43 !important;
}

/* Fix: offset main content from fixed sidebar */
html:not([dir="rtl"]) .sidebar-fixed ~ .wrapper {
    margin-left: 256px;
}

@media (min-width: 992px) {
    #sidebar {
        transition: margin-left .3s cubic-bezier(.4,0,.2,1);
    }

    .wrapper {
        transition: margin-left .3s cubic-bezier(.4,0,.2,1);
    }

    html:not([dir="rtl"]).sidebar-collapsed #sidebar.sidebar-fixed {
        margin-left: -256px;
    }

    html:not([dir="rtl"]).sidebar-collapsed .sidebar-fixed ~ .wrapper {
        margin-left: 0;
    }
}

/* ===== Mobile responsive overrides ===== */

/* Sidebar backdrop overlay */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1039;
    opacity: 0;
    transition: opacity .25s;
}
.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

@media (max-width: 991.98px) {
    /* Remove fixed sidebar margin on tablet/mobile */
    html:not([dir="rtl"]) .sidebar-fixed ~ .wrapper {
        margin-left: 0 !important;
    }
    /* Sidebar: CoreUI already hides with margin-left:-256px and shows with .show class.
       We just ensure proper z-index and smooth transition. */
    #sidebar {
        z-index: 1040;
        transition: margin-left .3s cubic-bezier(.4,0,.2,1);
    }
    /* Header shows full-width */
    .header.header-sticky {
        margin-left: 0 !important;
    }
    /* Header email truncate */
    .header-nav .dropdown-toggle {
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    /* Full-width container */
    .container-lg { padding-left: 1rem; padding-right: 1rem; }
    /* Stack columns vertically */
    .row > [class*="col-lg"] { flex: 0 0 100%; max-width: 100%; }
    /* Footer stacks */
    footer.footer .footer-content { font-size: 0.78rem; }
}

@media (max-width: 767.98px) {
    /* Header compact */
    .header .container-fluid { padding-left: 0.75rem; padding-right: 0.75rem; }
    /* Header items compact */
    .header-nav { gap: 0.25rem; }
    .header-nav .dropdown-toggle {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.82rem;
        padding: 0.4rem 0.5rem;
    }
    .header-nav .dropdown-toggle .avatar-circle { flex-shrink: 0; }
    /* Hide email text on very small, show only avatar */
    .lang-globe { font-size: 0.85rem; }
    /* Smaller page titles */
    h4 { font-size: 1.15rem; }
    h4 small { display: block; margin-top: 0.25rem; font-size: 0.82rem; }
    /* Tables scroll horizontally */
    .table-responsive { -webkit-overflow-scrolling: touch; }
    /* Cards reduce padding */
    .card-body { padding: 0.85rem; }
    .card-header { padding: 0.65rem 0.85rem; font-size: 0.88rem; }
    /* Forms: full width on mobile */
    .row.g-2 > [class*="col-md"],
    .row.g-3 > [class*="col-md"] { flex: 0 0 100%; max-width: 100%; }
    /* Stat cards stack nicer */
    a.stat-card .card-body { padding: 0.85rem; text-align: center; }
    /* Detail hero mobile */
    .detail-hero { padding: 1rem; border-radius: 0.75rem; }
    .detail-hero-title { font-size: 1.2rem; }
    .detail-hero-inner { flex-direction: column; gap: 1rem; }
    .detail-hero-actions { align-items: stretch; flex-direction: row; gap: 0.5rem; }
    .detail-hero-pills { gap: 0.3rem; }
    .detail-hero-pill { font-size: 0.7rem; padding: 0.22rem 0.55rem; }
    .detail-salary-badge { font-size: 0.92rem; padding: 0.35rem 0.75rem; text-align: center; }
    /* Section body mobile */
    .detail-section-body { padding: 0.85rem; font-size: 0.9rem; }
    .detail-section-title { padding: 0.7rem 0.85rem; font-size: 0.88rem; }
    /* Doc well compact */
    .doc-well { padding: 0.75rem; }
    /* Language select compact */
    .lang-select { font-size: 0.72rem; padding: 2px 6px; }
}

@media (max-width: 575.98px) {
    /* Prevent horizontal scroll */
    body, html { overflow-x: hidden; }
    .body.flex-grow-1 { overflow-x: hidden; }
    /* Jobs hero ultra-compact */
    .jobs-hero { padding: 1rem 0.85rem; border-radius: 0.65rem; margin-left: -0.25rem; margin-right: -0.25rem; }
    .jobs-hero-title { font-size: 1.1rem; }
    .jobs-hero-sub { font-size: 0.78rem; }
    .jobs-hero-inner { flex-direction: column; text-align: center; gap: 0.75rem; }
    .jobs-count { font-size: 1.8rem; }
    .jobs-count-label { font-size: 0.65rem; }
    /* Job cards full bleed */
    .jobs-card { border-radius: 0.5rem; }
    .jobs-card-body { padding: 0.75rem 0.85rem; }
    .jobs-card-title { font-size: 1rem; }
    .jobs-pills { gap: 0.3rem; }
    .jobs-pill { font-size: 0.68rem; padding: 0.18rem 0.45rem; }
    .jobs-salary { font-size: 0.82rem; }
    /* Header: hide email text, show only avatar */
    .header-nav .dropdown-toggle span:not(.avatar-circle) {
        display: none;
    }
    .header-nav .dropdown-toggle { gap: 0 !important; max-width: none; }
    /* Buttons stack on small */
    .btn { font-size: 0.88rem; }
    .btn-lg { padding: 0.6rem 0.85rem; font-size: 0.92rem; }
    /* Avatar smaller */
    .avatar-circle { width: 28px; height: 28px; font-size: 11px; }
    /* Sidebar brand compact */
    .sidebar-brand-full { font-size: 0.92rem; }
    .sidebar-logo-icon { width: 28px; height: 28px; font-size: 0.6rem; }
}

/* ===== Table → Card conversion on mobile ===== */
@media (max-width: 767.98px) {
    .table-card-mobile thead { display: none; }
    .table-card-mobile tbody tr {
        display: block;
        background: var(--cui-body-bg, #fff);
        border: 1px solid var(--cui-border-color, #dee2e6);
        border-radius: 0.5rem;
        margin-bottom: 0.75rem;
        padding: 0.65rem 0.85rem;
        box-shadow: 0 1px 3px rgba(0,0,0,.06);
    }
    .table-card-mobile tbody tr.table-warning {
        border-left: 4px solid var(--cui-warning, #ffc107);
    }
    .table-card-mobile tbody td {
        display: grid;
        grid-template-columns: 5.75rem minmax(0, 1fr);
        align-items: start;
        padding: 0.3rem 0;
        border: none;
        gap: 0.45rem 0.65rem;
        white-space: normal !important;
    }
    .table-card-mobile tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78rem;
        color: var(--cui-body-color-secondary, #6c757d);
        white-space: normal;
        min-width: 0;
        line-height: 1.2;
    }
    .table-card-mobile tbody td > * {
        min-width: 0;
    }
    .table-card-mobile tbody td small,
    .table-card-mobile tbody td a,
    .table-card-mobile tbody td span,
    .table-card-mobile tbody td strong {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    .table-card-mobile tbody td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    .table-card-mobile tbody td:first-child {
        padding-top: 0;
    }
    .table-card-mobile tbody td[data-label=""] {
        display: block;
    }
    .table-card-mobile tbody td[data-label=""]::before {
        display: none;
    }
    /* Full-width actions in card mode */
    .table-card-mobile tbody td .btn {
        width: 100%;
        justify-content: center;
    }
    .table-card-mobile tbody td .d-flex.gap-2 {
        flex-direction: column;
        width: 100%;
    }
    .table-card-mobile tbody td .d-flex.gap-2 .form-select {
        max-width: none !important;
    }
    /* Hide edit rows (DocumentTemplates) — show as full-width block */
    .table-card-mobile tbody tr[id^="template-edit-"] {
        padding: 0;
    }
    .table-card-mobile tbody tr[id^="template-edit-"] td {
        display: block;
        padding: 0.85rem;
    }
    .table-card-mobile tbody tr[id^="template-edit-"] td::before {
        display: none;
    }
}

.clickable-row:focus-visible {
    outline: 3px solid #1a73e8;
    outline-offset: -3px;
}

/* Touch-friendly link/button targets */
@media (pointer: coarse) {
    .nav-link, .sidebar-link, .btn, .dropdown-item, .form-select, .lang-select {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    .table-card-mobile td {
        min-height: 44px;
    }
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* prevents iOS zoom */
    }
}
