/* Logo — transparent background, sizing */
.logo-img {
    object-fit: contain;
    background: transparent !important;
    mix-blend-mode: multiply;
}
.welcome-page .logo-img { mix-blend-mode: normal; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15)); }
.logo-home { max-width: 420px; width: 85%; margin: 0 auto; display: block; }
.logo-sidebar { max-width: 100%; width: 100%; display: block; margin: 0 auto; }
.logo-auth { max-width: 400px; width: 90%; }
.logo-auth-large { max-width: 520px !important; width: 95% !important; }
.welcome-logo.logo-home { max-width: 320px; }
.home-logo .logo-home { max-width: 480px; width: 90%; }

/* Fonts */
.font-lexend body, .font-lexend { font-family: 'Lexend', system-ui, sans-serif; }
.font-funnel body, .font-funnel { font-family: 'Funnel Sans', system-ui, sans-serif; }
.font-system body, .font-system { font-family: 'Segoe UI', system-ui, sans-serif; }

/* Themes */
.theme-light { --bg: #f8fafc; --card: #fff; --primary: #0c4a6e; --accent: #0284c7; --sidebar-bg: #fff; --text: #0f172a; --border: #e2e8f0; --input-readonly: #f1f5f9; }
.theme-dark { --bg: #0f172a; --card: #1e293b; --primary: #38bdf8; --accent: #0ea5e9; --sidebar-bg: #1e293b; --text: #f1f5f9; --border: #334155; --muted: #94a3b8; --input-readonly: #334155; }
.theme-dark .sidebar, .theme-dark .card, .theme-dark .auth-card { color: var(--text); }
.theme-dark .form-control { background: #0f172a; color: var(--text); border-color: var(--border); }
.theme-ocean { --bg: #f0f9ff; --card: #fff; --primary: #0c4a6e; --accent: #0ea5e9; --sidebar-bg: #fff; --input-readonly: #f1f5f9; }

.sidebar { background: var(--sidebar-bg, #fff); }
.sidebar-header { padding: 1rem 0.75rem 0.5rem; }

/* Modern buttons */
.btn-modern {
    border-radius: 10px;
    padding: 0.55rem 1.15rem;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.btn-modern:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.btn-primary.btn-modern { background: linear-gradient(120deg, #4f46e5, #0ea5e9); color: #fff; }
.btn-accent.btn-modern { background: linear-gradient(120deg, #0d9488, #22d3ee); color: #fff; }
.btn-secondary.btn-modern { background: #e2e8f0; color: #334155; }
.btn-danger.btn-modern { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; }
.btn-ghost.btn-modern { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-block { width: 100%; }
.btn-lg-modern { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-group-modern { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }

/* Export format modal — top-right close + Excel / PDF choices */
.export-format-box { min-width: 340px; padding-top: 2.4rem; }
.export-format-hint { margin: 0.35rem 0 1.25rem; color: var(--muted); font-size: 0.95rem; }
.export-format-actions .btn {
    flex: 1;
    min-width: 130px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}
.modal-close-x {
    position: absolute;
    top: 0.85rem;
    right: 0.9rem;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.modal-close-x:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: rotate(90deg);
}
.btn-icon {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--card); cursor: pointer; font-size: 1.1rem; font-weight: 700;
}
.btn-icon:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.filter-toolbar {
    display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end;
}
.filter-toolbar .form-group { flex: 1; min-width: 140px; margin: 0; }
.filter-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Nav styling handled in modern-ui.css */

.table-modern th { background: #f1f5f9; font-weight: 600; }
.text-center { text-align: center; }
.text-center-muted { text-align: center; color: var(--muted); padding: 2rem; }

/* Productive hours warning */
#productive_time_minutes.productive-low {
    background: #fee2e2 !important;
    color: #991b1b !important;
    font-weight: 700;
}

/* Success modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
    backdrop-filter: blur(4px);
}
.modal-success-box {
    position: relative;
    background: var(--card); border-radius: 16px; padding: 2rem 2.5rem;
    text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.2); max-width: 90%;
}
.modal-success-icon {
    width: 72px; height: 72px; border-radius: 50%; background: #059669;
    color: #fff; font-size: 2.5rem; line-height: 72px; margin: 0 auto 1rem;
    animation: popIn 0.35s ease;
}
@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.auth-lockout-modal {
    display: flex;
}

.auth-lockout-box {
    width: min(420px, 92vw);
}

.auth-lockout-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    animation: popIn 0.35s ease;
}

.auth-lockout-box h3 {
    margin: 0 0 0.75rem;
    color: #991b1b;
}

.auth-lockout-box p {
    margin: 0 0 1.25rem;
    color: #334155;
    line-height: 1.5;
}

/* Permissions grid */
.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}
.perm-check {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 8px;
    cursor: pointer; font-size: 0.9rem;
}
.perm-check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* Currency */
.currency-wrap { display: flex; align-items: stretch; }
.currency-prefix {
    padding: 0.65rem 0.75rem; background: #e0f2fe; border: 1px solid var(--border);
    border-right: 0; border-radius: 8px 0 0 8px; font-weight: 700; color: var(--primary);
}
.currency-input { border-radius: 0 8px 8px 0 !important; }

.weekday-row.on-leave td { opacity: 0.6; }
.weekday-row.on-leave .day-priority { background: #f1f5f9; }

.footer-credit { font-size: 0.75rem; color: var(--muted); margin-top: 0.5rem; }
.settings-card { margin-bottom: 1.25rem; }
.filter-card { margin-bottom: 1.25rem; }

.user-mgmt-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.filter-actions-inline { flex-direction: row !important; align-items: center; gap: 0.5rem; }

/* Welcome animation sequence */
.welcome-page { flex-direction: column; color: #ffffff; }
.welcome-page .welcome-big-text, .welcome-page .welcome-redirect-text { color: #ffffff; }
.welcome-sequence { position: relative; min-height: 50vh; display: flex; align-items: center; justify-content: center; width: 100%; }
.welcome-step { position: absolute; opacity: 0; transform: scale(0.85); transition: opacity 0.7s ease, transform 0.7s ease; pointer-events: none; width: 100%; text-align: center; }
.welcome-step.active { opacity: 1; transform: scale(1); pointer-events: auto; }
.welcome-big-text { font-size: clamp(3rem, 12vw, 7rem); font-weight: 800; letter-spacing: 0.02em; text-shadow: 0 8px 32px rgba(0,0,0,0.25); margin: 0; }
.welcome-logo-final { animation: logoReveal 0.8s ease forwards; }
.welcome-footer { width: 100%; max-width: 320px; margin-top: 2rem; }
.welcome-redirect-text { opacity: 0.9; font-size: 0.95rem; margin-top: 0.75rem; }
@keyframes logoReveal { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }

/* Login */
.auth-left-logo-only h2, .auth-left-logo-only p { display: none !important; }

/* =====================================================================
   Animated landing intro overlay (plays on every login load/refresh)
   ===================================================================== */
.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(1200px 800px at 18% 12%, rgba(56, 189, 248, 0.28), transparent 55%),
        radial-gradient(1000px 700px at 85% 88%, rgba(45, 212, 191, 0.26), transparent 55%),
        linear-gradient(135deg, #f0f9ff 0%, #e6f6fb 40%, #ecfdf5 100%);
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

.intro-overlay.intro-hide {
    opacity: 0;
    visibility: hidden;
}

/* Soft pulsing light */
.intro-overlay::before {
    content: "";
    position: absolute;
    width: 130vmax;
    height: 130vmax;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at center, rgba(14, 116, 144, 0.10), transparent 60%);
    animation: introGlow 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes introGlow {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
}

/* Rising bubbles */
.intro-bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.intro-bubbles span {
    position: absolute;
    bottom: -80px;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.13);
    box-shadow: inset 0 0 12px rgba(14, 116, 144, 0.20);
    animation: introRise linear infinite;
}

.intro-bubbles span:nth-child(1) { left: 8%;  width: 26px; height: 26px; animation-duration: 9s;  animation-delay: 0s; }
.intro-bubbles span:nth-child(2) { left: 20%; width: 16px; height: 16px; animation-duration: 7s;  animation-delay: 1.4s; }
.intro-bubbles span:nth-child(3) { left: 33%; width: 40px; height: 40px; animation-duration: 11s; animation-delay: 0.6s; }
.intro-bubbles span:nth-child(4) { left: 46%; width: 12px; height: 12px; animation-duration: 6.5s;animation-delay: 2s; }
.intro-bubbles span:nth-child(5) { left: 58%; width: 30px; height: 30px; animation-duration: 10s; animation-delay: 1s; }
.intro-bubbles span:nth-child(6) { left: 69%; width: 18px; height: 18px; animation-duration: 8s;  animation-delay: 0.3s; }
.intro-bubbles span:nth-child(7) { left: 80%; width: 34px; height: 34px; animation-duration: 12s; animation-delay: 1.8s; }
.intro-bubbles span:nth-child(8) { left: 90%; width: 14px; height: 14px; animation-duration: 7.5s;animation-delay: 0.9s; }
.intro-bubbles span:nth-child(9) { left: 14%; width: 20px; height: 20px; animation-duration: 9.5s;animation-delay: 2.4s; }

@keyframes introRise {
    0%   { transform: translateY(0) scale(0.9); opacity: 0; }
    10%  { opacity: 1; }
    100% { transform: translateY(-118vh) scale(1.25); opacity: 0; }
}

.intro-stage {
    position: relative;
    z-index: 2;
    min-height: 42vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-step {
    position: absolute;
    opacity: 0;
    transform: translateY(24px) scale(0.92);
    transition: opacity 0.7s ease, transform 0.7s ease;
    text-align: center;
}

.intro-step.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.intro-word {
    font-family: 'Funnel Sans', system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 13vw, 7.5rem);
    letter-spacing: -0.03em;
    line-height: 1;
    background: linear-gradient(135deg, #0c4a6e 0%, #0e7490 50%, #0891b2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 12px 32px rgba(14, 116, 144, 0.18);
}

.intro-overlay .intro-logo.logo-img {
    mix-blend-mode: normal;
    max-width: 560px;
    width: 80vw;
    filter: drop-shadow(0 18px 44px rgba(14, 116, 144, 0.28));
}

.intro-tagline {
    margin: 1.25rem 0 0;
    color: #0e7490;
    font-weight: 600;
    font-size: clamp(0.8rem, 2.4vw, 1.1rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.intro-progress {
    position: absolute;
    bottom: 9%;
    z-index: 2;
    width: min(280px, 62vw);
    height: 4px;
    border-radius: 999px;
    background: rgba(14, 116, 144, 0.18);
    overflow: hidden;
}

.intro-progress span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #0891b2, #22d3ee);
    animation: introBar 3.8s linear forwards;
}

@keyframes introBar {
    to { width: 100%; }
}

.intro-skip {
    position: absolute;
    top: 1.35rem;
    right: 1.6rem;
    z-index: 3;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    border: 1px solid rgba(14, 116, 144, 0.30);
    background: rgba(255, 255, 255, 0.65);
    color: #0e7490;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background 0.2s ease, transform 0.2s ease;
}

.intro-skip:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
    .intro-bubbles, .intro-overlay::before { display: none; }
    .intro-step { transition: opacity 0.3s ease; transform: none; }
}

/* Enlarged login logo with animated gradient border frame */
.login-logo-frame {
    position: relative;
    width: 96%;
    max-width: 720px;
    padding: 2.4rem;
    border-radius: 30px;
    background: transparent;
}

.login-logo-frame .logo-auth,
.login-logo-frame .logo-auth-large {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    display: block;
    position: relative;
    z-index: 1;
}

@media (max-width: 640px) {
    .login-logo-frame { padding: 1.6rem; border-radius: 22px; }
}

/* Auth split — same logo : form ratio on login, forgot-password, register */
:root {
    --auth-logo-flex: 1;
    --auth-form-flex: 1;
}

.auth-door-root .auth-split,
.auth-split.auth-register {
    min-height: 100dvh;
}

.auth-split .auth-left {
    flex: var(--auth-logo-flex) 1 0;
    min-width: 0;
}

.auth-split .auth-right {
    flex: var(--auth-form-flex) 1 0;
    min-width: 0;
}

/* Auth door-swirl — right form panel only; logo stays static */
.auth-door-root .auth-split {
    perspective: 1400px;
    overflow-x: hidden;
}

.auth-door-panel {
    transform-style: preserve-3d;
    transform-origin: left center;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.auth-door-panel.auth-door-enter.auth-door-forward {
    animation: authDoorEnterForward 0.68s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-door-panel.auth-door-enter.auth-door-back {
    animation: authDoorEnterBack 0.68s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-door-panel.auth-door-exit.auth-door-forward {
    animation: authDoorExitForward 0.52s cubic-bezier(0.55, 0, 0.45, 1) both;
    pointer-events: none;
}

.auth-door-panel.auth-door-exit.auth-door-back {
    animation: authDoorExitBack 0.52s cubic-bezier(0.55, 0, 0.45, 1) both;
    pointer-events: none;
}

@keyframes authDoorEnterForward {
    from { transform: rotateY(-82deg) scale(0.92); opacity: 0.25; filter: brightness(0.85); }
    to   { transform: rotateY(0deg) scale(1); opacity: 1; filter: brightness(1); }
}

@keyframes authDoorEnterBack {
    from { transform: rotateY(82deg) scale(0.92); opacity: 0.25; filter: brightness(0.85); }
    to   { transform: rotateY(0deg) scale(1); opacity: 1; filter: brightness(1); }
}

@keyframes authDoorExitForward {
    to { transform: rotateY(82deg) scale(0.92); opacity: 0.15; filter: brightness(0.8); }
}

@keyframes authDoorExitBack {
    to { transform: rotateY(-82deg) scale(0.92); opacity: 0.15; filter: brightness(0.8); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-door-panel.auth-door-enter,
    .auth-door-panel.auth-door-exit {
        animation: none !important;
    }
}

/* Registration — fit viewport; same split ratio as login */
.auth-register-page {
    overflow: hidden;
    height: 100dvh;
    max-height: 100dvh;
}

.auth-split.auth-register {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.auth-split.auth-register .auth-right {
    overflow: hidden;
}

.auth-card-compact {
    max-width: 560px;
    width: 100%;
    padding: clamp(1.15rem, 2.2vh, 1.65rem) clamp(1.35rem, 2.5vw, 2rem);
    max-height: calc(100dvh - clamp(1rem, 2vh, 2rem));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card-compact h2 {
    font-size: clamp(1.35rem, 2.2vh, 1.55rem);
    margin-bottom: clamp(0.5rem, 1vh, 0.85rem);
}

.auth-card-compact .alert {
    padding: 0.55rem 0.75rem;
    margin-bottom: clamp(0.5rem, 1vh, 0.75rem);
    font-size: 0.875rem;
}

.register-form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(0.15rem, 0.4vh, 0.35rem);
}

.register-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: clamp(0.85rem, 1.8vw, 1.25rem);
    row-gap: clamp(0.35rem, 0.8vh, 0.55rem);
}

.auth-card-compact .form-group {
    margin-bottom: clamp(0.65rem, 1.2vh, 0.9rem);
}

.auth-card-compact .form-group label {
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}

.auth-register .form-control-sm {
    padding: clamp(0.5rem, 1vh, 0.6rem) clamp(0.7rem, 1.2vw, 0.85rem);
    font-size: 0.925rem;
    line-height: 1.35;
}

.password-rules-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem clamp(0.5rem, 1vw, 0.75rem);
    font-size: clamp(0.72rem, 1.1vh, 0.8rem);
    margin: clamp(0.15rem, 0.5vh, 0.35rem) 0 clamp(0.45rem, 1vh, 0.7rem);
    padding: clamp(0.35rem, 0.8vh, 0.5rem) clamp(0.5rem, 1vw, 0.65rem);
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.password-rules-compact li {
    padding: 0.15rem 0;
}

.form-actions-compact {
    margin-top: clamp(0.55rem, 1.2vh, 0.85rem);
    gap: 0.65rem;
}

.btn-register {
    width: auto;
    padding: clamp(0.55rem, 1.1vh, 0.65rem) clamp(1.15rem, 2vw, 1.35rem);
    font-size: 0.925rem;
}

.auth-links-compact {
    margin-top: clamp(0.55rem, 1vh, 0.75rem);
    font-size: 0.9rem;
}

/* Shorter viewports: tighten slightly so the page still fits without scroll */
@media (max-height: 760px) {
    .auth-card-compact {
        padding: 0.95rem 1.15rem;
    }
    .auth-card-compact h2 {
        font-size: 1.3rem;
        margin-bottom: 0.45rem;
    }
    .auth-card-compact .form-group {
        margin-bottom: 0.55rem;
    }
    .auth-card-compact .form-group label {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }
    .auth-register .form-control-sm {
        padding: 0.45rem 0.65rem;
        font-size: 0.875rem;
    }
    .password-rules-compact {
        margin-bottom: 0.4rem;
        padding: 0.3rem 0.45rem;
        font-size: 0.7rem;
    }
    .form-actions-compact {
        margin-top: 0.45rem;
    }
    .register-grid-2 {
        row-gap: 0.25rem;
        column-gap: 0.65rem;
    }
}

@media (max-height: 680px) {
    .auth-card-compact .form-group {
        margin-bottom: 0.45rem;
    }
    .password-rules-compact {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .auth-register-page {
        overflow-y: auto;
        height: auto;
        max-height: none;
    }
    .auth-split.auth-register {
        flex-direction: column;
        height: auto;
        max-height: none;
    }
    .auth-split .auth-left,
    .auth-split.auth-register .auth-left {
        flex: none;
        padding: 1.5rem 1rem 0.5rem;
        min-height: 140px;
    }
    .auth-split .auth-left .logo-img,
    .auth-split.auth-register .auth-left .logo-img {
        max-width: 200px;
    }
    .auth-split .auth-right,
    .auth-split.auth-register .auth-right {
        flex: none;
        padding: 1rem;
    }
    .auth-card-compact {
        max-height: none;
        overflow: visible;
    }
    .register-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .password-rules-compact {
        grid-template-columns: 1fr 1fr;
    }
}
.btn-captcha-refresh {
    width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border);
    background: #e0f2fe; color: var(--primary); cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-captcha-refresh:hover { background: var(--accent); color: #fff; }

/* Sidebar mini / resize */
.sidebar.mini .nav-label,
.sidebar.mini .sidebar-user-card .sidebar-user-info,
.sidebar.mini .footer-credit { display: none; }
.sidebar.mini .sidebar-user-card {
    justify-content: center;
    padding: 0.4rem;
    margin: 0 0.45rem 0.4rem;
}
.sidebar.mini .sidebar-user-avatar {
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.6rem;
}
.sidebar.mini .sidebar-header { padding: 0.5rem; }
.sidebar.mini .logo-sidebar { max-width: 52px; margin: 0 auto; }
.sidebar.mini .nav-item { justify-content: center; padding: 0.75rem; }
.sidebar.mini .nav-item i { font-size: 1.25rem; margin: 0; }
.sidebar.mini .sidebar-footer .btn .nav-label { display: none; }
.sidebar-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 210;
    touch-action: none;
}
.sidebar-resizer:hover,
.sidebar-resizer:active { background: rgba(14, 165, 233, 0.4); }
@media (max-width: 992px) {
    .sidebar-resizer { display: none; }
}

/* User mgmt icons */
.btn-icon-action {
    width: 38px; height: 38px; border-radius: 11px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.05rem; line-height: 1;
    border: 1px solid transparent;
    background: var(--icon-tint, #f1f5f9);
    color: var(--icon-color, #475569);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.btn-icon-action i { transition: transform 0.16s ease; }
.btn-icon-action:hover {
    background: var(--icon-color, #475569);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px var(--icon-shadow, rgba(71, 85, 105, 0.35));
}
.btn-icon-action:hover i { transform: scale(1.12); }
.btn-icon-action:active { transform: translateY(0); box-shadow: none; }
.btn-icon-action:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--icon-shadow, rgba(71, 85, 105, 0.3));
}

.btn-approve {
    --icon-tint: #ecfdf5; --icon-color: #059669; --icon-shadow: rgba(5, 150, 105, 0.35);
    border-color: #a7f3d0;
}
.btn-edit {
    --icon-tint: #eff6ff; --icon-color: #2563eb; --icon-shadow: rgba(37, 99, 235, 0.32);
    border-color: #bfdbfe;
}

.btn-reject {
    --icon-tint: #fef2f2; --icon-color: #dc2626; --icon-shadow: rgba(220, 38, 38, 0.35);
    border-color: #fecaca;
}
.btn-lock {
    --icon-tint: #fffbeb; --icon-color: #d97706; --icon-shadow: rgba(217, 119, 6, 0.35);
    border-color: #fde68a;
}
.btn-unlock {
    --icon-tint: #f0fdfa; --icon-color: #0f766e; --icon-shadow: rgba(15, 118, 110, 0.35);
    border-color: #99f6e4;
}

.relieving-date {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.2rem 0.6rem; border-radius: 999px;
    background: #fef2f2; border: 1px solid #fecaca;
    color: #b91c1c; font-weight: 600; font-size: 0.8rem;
}

.admin-row-actions { display: inline-flex; gap: 0.4rem; align-items: center; }

/* UAM date filter */
.uam-filter {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem;
    padding: 0.85rem 1rem; margin-bottom: 0.25rem;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
}
.uam-filter-field { display: flex; flex-direction: column; gap: 0.3rem; }
.uam-filter-field label {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: #64748b;
    display: inline-flex; align-items: center; gap: 0.3rem;
}
.uam-filter .form-control-sm { min-width: 150px; }
.uam-filter #uamClear { margin-bottom: 1px; }

/* UAM stat cards */
.uam-stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 1rem; margin-bottom: 1.5rem;
}
@media (max-width: 820px) { .uam-stats { grid-template-columns: repeat(2, 1fr); } }
.uam-stat {
    display: flex; align-items: center; gap: 0.85rem;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 1rem 1.1rem; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.uam-stat:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08); }
.uam-stat-icon {
    width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.stat-blue { background: #e0f2fe; color: #0369a1; }
.stat-green { background: #d1fae5; color: #047857; }
.stat-red { background: #fee2e2; color: #b91c1c; }
.stat-amber { background: #fef3c7; color: #b45309; }
.uam-stat-body { display: flex; flex-direction: column; line-height: 1.15; }
.uam-stat-num { font-size: 1.5rem; font-weight: 800; color: #0f172a; }
.uam-stat-label { font-size: 0.78rem; font-weight: 600; color: #64748b; }

/* User cell with avatar */
.user-cell { display: flex; align-items: center; gap: 0.7rem; }
.user-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.82rem; font-weight: 700; color: #fff; letter-spacing: 0.02em;
    background: linear-gradient(135deg, #0f766e, #0ea5e9);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-weight: 600; color: #0f172a; }
.user-meta small { color: #94a3b8; font-size: 0.78rem; }

/* Status badge with dot */
.status-badge {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.25rem 0.7rem; border-radius: 999px;
    font-size: 0.78rem; font-weight: 600;
}
.status-badge .status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-active { background: #ecfdf5; color: #047857; }
.status-active .status-dot { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.status-locked { background: #fef2f2; color: #b91c1c; }
.status-locked .status-dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }

/* On-leave marker in weekly daily breakdown */
.leave-tag {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.15rem 0.6rem; border-radius: 999px;
    background: #fef3c7; color: #92400e; font-weight: 600; font-size: 0.78rem;
}
.row-on-leave { background: #fffbeb !important; }

/* Permissions with tick */
.perm-check { position: relative; transition: border-color 0.2s, background 0.2s; }
.perm-check-on { border-color: #059669 !important; background: #ecfdf5; }
.perm-tick {
    width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cbd5e1;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    font-size: 0.85rem; color: transparent;
}
.perm-check-on .perm-tick { background: #059669; border-color: #059669; color: #fff; }
.perm-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.settings-security .card-header { background: #c2410c !important; }

/* Admin report details */
.filter-actions-inline .btn { min-width: 110px; }

.admin-report-results-card .card-body.report-detail-list {
    padding: 1rem;
    background: #f1f5f9;
}

.report-detail-block {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.report-detail-block:last-child { margin-bottom: 0; }
.report-detail-block[open] {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.report-summary {
    cursor: pointer;
    padding: 0.9rem 1.1rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    font-size: 0.88rem;
    list-style: none;
}
.report-summary::-webkit-details-marker { display: none; }

.report-summary-left,
.report-summary-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.report-id-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: #1e3a5f;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.report-summary-identity {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.report-summary-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.92rem;
}

.report-summary-sep {
    color: #94a3b8;
    font-weight: 400;
}

.report-summary-date {
    font-size: 0.8rem;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.report-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.8rem;
    white-space: nowrap;
}

.report-stat-pill--accent {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
    font-weight: 600;
}

.report-summary-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    flex-shrink: 0;
    transition: transform 0.2s ease, background 0.2s ease;
}
.report-detail-block[open] .report-summary-chevron {
    transform: rotate(180deg);
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
}

.report-detail-body {
    padding: 1.1rem 1.15rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.report-meta-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.25rem;
}

.report-meta-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.report-meta-card--highlight {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.report-meta-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.report-meta-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
}

.report-detail-section {
    margin-top: 1.1rem;
    padding-top: 0.15rem;
}

.report-detail-section:first-of-type {
    margin-top: 0.75rem;
}

.detail-section-title {
    margin: 0 0 0.6rem;
    color: #1e3a5f;
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding-bottom: 0.45rem;
    border-bottom: 2px solid #e2e8f0;
}
.detail-section-title i {
    color: #0ea5e9;
    font-size: 0.95rem;
}

.report-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.admin-report-table {
    margin: 0;
    min-width: 480px;
}

.admin-report-table thead th {
    background: #f1f5f9;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #475569;
    padding: 0.55rem 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
}

.admin-report-table thead .col-task,
.admin-report-table thead .col-remarks,
.admin-report-table thead .col-day {
    text-align: left;
}

.admin-report-table tbody td {
    padding: 0.5rem 0.5rem;
    font-size: 0.84rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
}

.admin-report-table tbody .col-task,
.admin-report-table tbody .col-remarks,
.admin-report-table tbody .col-day {
    text-align: left;
}

.admin-report-table .col-index { width: 7%; }
.admin-report-table .col-task { width: 30%; }
.admin-report-table .col-duration { width: 14%; }
.admin-report-table .col-center { width: 14%; }
.admin-report-table .col-remarks { width: 35%; }
.admin-report-table--planned .col-task { width: 26%; }
.admin-report-table--planned .col-remarks { width: 24%; }
.admin-report-table--planned .col-center { width: 12%; }

.admin-report-table--weekly .col-day { width: 12%; }
.admin-report-table--weekly .col-center { width: 12%; }
.admin-report-table--weekly .col-task { width: 26%; }
.admin-report-table--weekly .col-remarks { width: 24%; }

.admin-report-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-report-table tbody tr:hover td {
    background: #f8fafc;
}

.report-status-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.78rem;
    font-weight: 600;
}

.leave-tag-sm {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: #fef3c7;
    color: #b45309;
    font-size: 0.78rem;
    font-weight: 600;
}

.report-notes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 768px) {
    .report-notes-grid { grid-template-columns: 1fr; }
}

.report-note-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    margin-top: 1rem;
}
.report-note-block .detail-section-title {
    border-bottom: none;
    padding-bottom: 0.35rem;
    margin-bottom: 0.35rem;
}

.detail-comments {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    color: #334155;
    margin: 0;
    line-height: 1.55;
    font-size: 0.88rem;
}

.detail-list {
    margin: 0;
    padding-left: 1.15rem;
    color: #334155;
    font-size: 0.86rem;
    line-height: 1.5;
}
.detail-list li + li { margin-top: 0.25rem; }

.report-empty-state {
    padding: 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem 1.25rem; align-items: end; }
.report-meta-grid { margin-bottom: 0.5rem; }
.table-compact th, .table-compact td { font-size: 0.82rem; padding: 0.45rem 0.5rem; }

/* =====================================================================
   Aligned tables — values sit directly under column headers app-wide
   ===================================================================== */
.aligned-table,
.sales-report-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.aligned-table th,
.aligned-table td,
.sales-report-table th,
.sales-report-table td {
    padding: 0.55rem 0.7rem;
    vertical-align: middle;
    word-break: break-word;
}

.aligned-table thead th,
.sales-report-table thead th {
    text-align: left;
    white-space: nowrap;
}

.aligned-table .col-index,
.sales-report-table .col-index {
    width: 5%;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.aligned-table .col-day,
.sales-report-table .col-day {
    width: 12%;
    text-align: left;
}

.aligned-table .col-text,
.sales-report-table .col-text {
    text-align: left;
}

.aligned-table .col-num,
.sales-report-table .col-num {
    width: 12%;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.aligned-table .col-center,
.sales-report-table .col-center {
    width: 14%;
    text-align: center;
}

.aligned-table .col-actions,
.sales-report-table .col-actions {
    width: 10%;
    text-align: center;
    white-space: nowrap;
}

.aligned-table thead .col-num,
.aligned-table thead .col-center,
.aligned-table thead .col-index,
.aligned-table thead .col-actions,
.sales-report-table thead .col-num,
.sales-report-table thead .col-center {
    text-align: center;
}

.aligned-table tbody .col-num,
.sales-report-table tbody .col-num {
    text-align: right;
}

/* Daily reporting — activity card titles left-aligned, vertically centered */
.daily-activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding-left: 1rem;
    padding-right: 0.75rem;
}

.daily-activity-header-title {
    flex: 1;
    text-align: left;
    font-weight: 600;
    line-height: 1.3;
}

.daily-activity-header-tools {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.daily-activity-leave-label {
    font-weight: normal;
    font-size: 0.85rem;
    margin-right: 0.35rem;
    white-space: nowrap;
}

/* Daily reporting — executed / planned activity tables (side-by-side like grid-2) */
.daily-activities-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 992px) {
    .daily-activities-grid {
        grid-template-columns: 1fr;
    }
}

.daily-activity-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.daily-activity-table {
    width: 100%;
    min-width: 520px;
    table-layout: fixed;
}

.daily-activity-table .col-index {
    width: 8%;
    text-align: center;
}

.daily-activity-table .col-task {
    width: 26%;
    text-align: left;
}

.daily-activity-table .col-duration {
    width: 22%;
    text-align: center;
}

.daily-activity-table .col-center {
    width: 16%;
    text-align: center;
}

.daily-activity-table .col-remarks {
    width: 28%;
    text-align: left;
}

.daily-activity-table thead th {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
    line-height: 1.2;
}

.daily-activity-table thead .col-task,
.daily-activity-table thead .col-remarks {
    text-align: left;
}

.daily-activity-table thead .col-duration {
    white-space: nowrap;
    font-size: 0.72rem;
    letter-spacing: -0.02em;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.daily-activity-table tbody td {
    padding: 0.5rem 0.45rem;
    vertical-align: middle;
    text-align: center;
}

.daily-activity-table tbody .col-task,
.daily-activity-table tbody .col-remarks {
    text-align: left;
}

.daily-activity-table tbody .col-index {
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-align: center;
}

.daily-activity-table tbody .col-task .form-control,
.daily-activity-table tbody .col-remarks .form-control {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.daily-activity-table tbody .col-duration .form-control {
    width: 4.25rem;
    max-width: calc(100% - 0.5rem);
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    display: block;
    box-sizing: border-box;
    text-align: center;
    text-align-last: center;
    padding-left: 0.25rem;
    padding-right: 1.25rem;
}

.daily-activity-table tbody .col-center .form-control {
    width: 5.75rem;
    max-width: calc(100% - 0.5rem);
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    display: block;
    box-sizing: border-box;
    text-align: center;
    text-align-last: center;
    padding-left: 0.25rem;
    padding-right: 1.25rem;
}

.daily-activity-table td .form-control {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
}

/* Admin / CRM data tables */
.admin-table.aligned-table,
.admin-table.crm-table {
    table-layout: fixed;
}

.admin-table.aligned-table th,
.admin-table.aligned-table td,
.admin-table.crm-table th,
.admin-table.crm-table td {
    vertical-align: middle;
    word-break: break-word;
}

/* Login attempts */
.aligned-table.login-log-table .col-index { width: 6%; }
.aligned-table.login-log-table .col-center { width: 12%; }

/* UAM — pending requests */
.aligned-table.uam-pending-table th:nth-child(1),
.aligned-table.uam-pending-table td:nth-child(1) { width: 8%; text-align: center; }
.aligned-table.uam-pending-table th:nth-child(4),
.aligned-table.uam-pending-table td:nth-child(4) { width: 11%; text-align: center; }
.aligned-table.uam-pending-table th:nth-child(6),
.aligned-table.uam-pending-table td:nth-child(6) { width: 12%; text-align: center; }

/* UAM — all users */
.aligned-table.uam-users-table th:nth-child(2),
.aligned-table.uam-users-table td:nth-child(2),
.aligned-table.uam-users-table th:nth-child(4),
.aligned-table.uam-users-table td:nth-child(4),
.aligned-table.uam-users-table th:nth-child(5),
.aligned-table.uam-users-table td:nth-child(5),
.aligned-table.uam-users-table th:nth-child(6),
.aligned-table.uam-users-table td:nth-child(6),
.aligned-table.uam-users-table th:nth-child(7),
.aligned-table.uam-users-table td:nth-child(7) { text-align: center; }
.aligned-table.uam-users-table th:nth-child(7),
.aligned-table.uam-users-table td:nth-child(7) { width: 14%; }

/* CRM tickets queue */
.admin-table[data-crm-table="tickets"] th:nth-child(6),
.admin-table[data-crm-table="tickets"] td:nth-child(6),
.admin-table[data-crm-table="tickets"] th:nth-child(7),
.admin-table[data-crm-table="tickets"] td:nth-child(7),
.admin-table[data-crm-table="tickets"] th:nth-child(8),
.admin-table[data-crm-table="tickets"] td:nth-child(8),
.admin-table[data-crm-table="tickets"] th:nth-child(9),
.admin-table[data-crm-table="tickets"] td:nth-child(9) { text-align: center; }

/* CRM deals */
.admin-table[data-crm-table="deals"] th:nth-child(5),
.admin-table[data-crm-table="deals"] td:nth-child(5) { text-align: right; }
.admin-table[data-crm-table="deals"] th:nth-child(6),
.admin-table[data-crm-table="deals"] td:nth-child(6),
.admin-table[data-crm-table="deals"] th:nth-child(7),
.admin-table[data-crm-table="deals"] td:nth-child(7) { text-align: center; }

/* CRM compact — amount / qty / status / pill columns */
.admin-table.crm-table-compact th:last-child,
.admin-table.crm-table-compact td:last-child { text-align: center; }
.admin-table.crm-table-compact th:nth-child(3),
.admin-table.crm-table-compact td:nth-child(3) { text-align: left; }

/* Invoices — amount right, status/pdf center */
.admin-table.crm-invoices-table th:nth-child(3),
.admin-table.crm-invoices-table td:nth-child(3) { text-align: right; }
.admin-table.crm-invoices-table th:nth-child(4),
.admin-table.crm-invoices-table td:nth-child(4),
.admin-table.crm-invoices-table th:nth-child(5),
.admin-table.crm-invoices-table td:nth-child(5),
.admin-table.crm-invoices-table th:nth-child(6),
.admin-table.crm-invoices-table td:nth-child(6) { text-align: center; }

/* Inventory — numeric columns */
.admin-table.crm-inventory-table th:nth-child(3),
.admin-table.crm-inventory-table td:nth-child(3),
.admin-table.crm-inventory-table th:nth-child(4),
.admin-table.crm-inventory-table td:nth-child(4) { text-align: center; }

/* Orders */
.admin-table.crm-orders-table th:nth-child(3),
.admin-table.crm-orders-table td:nth-child(3) { text-align: right; }
.admin-table.crm-orders-table th:nth-child(4),
.admin-table.crm-orders-table td:nth-child(4),
.admin-table.crm-orders-table th:nth-child(5),
.admin-table.crm-orders-table td:nth-child(5),
.admin-table.crm-orders-table th:nth-child(6),
.admin-table.crm-orders-table td:nth-child(6),
.admin-table.crm-orders-table th:nth-child(7),
.admin-table.crm-orders-table td:nth-child(7) { text-align: center; }

/* User tickets list */
.aligned-table.user-tickets-table th:nth-child(4),
.aligned-table.user-tickets-table td:nth-child(4),
.aligned-table.user-tickets-table th:nth-child(5),
.aligned-table.user-tickets-table td:nth-child(5),
.aligned-table.user-tickets-table th:nth-child(6),
.aligned-table.user-tickets-table td:nth-child(6) { text-align: center; }
.perf-badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 6px; font-size: 0.75rem; font-weight: 700; }
.perf-good { background: #d1fae5; color: #065f46; }
.perf-warn { background: #fef3c7; color: #92400e; }
.perf-low { background: #fee2e2; color: #991b1b; }
.insight-box { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.insight-box.perf-good { background: #ecfdf5; border-left: 4px solid #059669; }
.insight-box.perf-warn { background: #fffbeb; border-left: 4px solid #d97706; }
.insight-box.perf-low { background: #fef2f2; border-left: 4px solid #dc2626; }

.weekday-row.on-leave .day-outcome,
.weekday-row.on-leave .day-payment { background: #f1f5f9; pointer-events: none; opacity: 0.65; }

/* —— Weekly sales modern layout —— */
.weekly-modern .card-header i { margin-right: 0.5rem; opacity: 0.95; }

.goals-table {
    table-layout: fixed;
    width: 100%;
}
.goals-table th:nth-child(2),
.goals-table td:nth-child(2) { width: 14%; }
.goals-table th:nth-child(3),
.goals-table td:nth-child(3) { width: 22%; }

.goals-table th,
.weekday-table th {
    background: #f8fafc;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.72rem;
}
.goals-table td { vertical-align: middle; }
.goal-activity {
    display: inline-flex; align-items: center; gap: 0.6rem;
    font-weight: 600; color: var(--text);
}
.goal-activity i {
    width: 30px; height: 30px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; font-size: 0.95rem;
    background: var(--accent-soft); color: var(--primary);
}
.goal-target {
    display: inline-block; min-width: 46px; text-align: center;
    padding: 0.25rem 0.7rem; border-radius: 999px;
    background: #eef2f7; color: var(--text-secondary);
    font-weight: 700; font-size: 0.85rem;
}
.goal-actual { max-width: 160px; text-align: center; font-weight: 600; }
.goals-table tbody tr { transition: background 0.15s; }
.goals-table tbody tr:hover { background: #f8fafc; }

/* Align each Target Goals header directly above its column values */
.goals-table th:first-child,
.goals-table td:first-child { text-align: left; }
.goals-table th:nth-child(2),
.goals-table td:nth-child(2),
.goals-table th:nth-child(3),
.goals-table td:nth-child(3) { text-align: center; }
.goals-table td:nth-child(3) .goal-actual { display: inline-block; width: 100%; max-width: 160px; }

/* Day pill + leave checkbox */
.day-pill {
    display: inline-block; padding: 0.3rem 0.75rem; border-radius: 8px;
    background: linear-gradient(135deg, #155e75, #0e7490); color: #fff;
    font-weight: 700; font-size: 0.8rem; letter-spacing: 0.03em;
}
.weekday-row.on-leave .day-pill { background: #94a3b8; }
.weekday-table {
    table-layout: fixed;
    width: 100%;
}
.weekday-table th:nth-child(1),
.weekday-table td:nth-child(1) { width: 11%; text-align: left; }
.weekday-table th:nth-child(2),
.weekday-table td:nth-child(2) { width: 9%; text-align: center; }
.weekday-table th:nth-child(3),
.weekday-table td:nth-child(3),
.weekday-table th:nth-child(4),
.weekday-table td:nth-child(4),
.weekday-table th:nth-child(5),
.weekday-table td:nth-child(5) { text-align: left; }
.weekday-table td { vertical-align: middle; }
.weekday-table .form-control { width: 100%; }

.leave-check { display: inline-flex; cursor: pointer; margin: 0; }
.leave-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.leave-box {
    width: 26px; height: 26px; border-radius: 7px;
    border: 2px solid var(--border); background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; transition: all 0.15s;
}
.leave-box i { opacity: 0; font-size: 0.95rem; transition: opacity 0.15s; }
.leave-check input:checked + .leave-box {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    border-color: #0d9488;
}
.leave-check input:checked + .leave-box i { opacity: 1; }
.leave-check:hover .leave-box { border-color: var(--accent); }

@media (max-width: 640px) {
    .goal-actual { max-width: none; }
}

@media (max-width: 992px) {
    .grid-3 { grid-template-columns: 1fr; }
}

/* =====================================================================
   PORTAL DESIGN SYSTEM — Funnel Sans + elegant pastel-gradient soft UI
   Central, standard look applied across BOTH the user and admin consoles
   (scoped to .app-shell). Covers reports, UAM, Help, Central Settings,
   Login attempts, daily reporting, weekly sales, etc.
   ===================================================================== */
.app-shell {
    --a-indigo: #6366f1;
    --a-violet: #8b5cf6;
    --a-cyan: #22d3ee;
    --a-teal: #14b8a6;
    --a-sky: #38bdf8;
    --a-grad: linear-gradient(120deg, #818cf8, #22d3ee);
    --a-grad-soft: linear-gradient(135deg, #eef2ff, #e0f7fa);
    --a-radius: 18px;
    --a-shadow: 0 10px 30px -14px rgba(79, 70, 229, 0.22), 0 3px 10px -6px rgba(15, 23, 42, 0.06);
    --a-shadow-hover: 0 20px 44px -18px rgba(34, 211, 238, 0.35), 0 6px 16px -8px rgba(15, 23, 42, 0.09);
}

/* Funnel Sans everywhere in the consoles */
.app-shell,
.app-shell input,
.app-shell select,
.app-shell textarea,
.app-shell button {
    font-family: 'Funnel Sans', 'Segoe UI', system-ui, sans-serif !important;
}

/* Soft pastel page canvas + glassy top bar */
.app-shell .content-area {
    background:
        radial-gradient(1200px 480px at 12% -8%, rgba(129, 140, 248, 0.10), transparent 60%),
        radial-gradient(1000px 420px at 110% 0%, rgba(34, 211, 238, 0.10), transparent 55%),
        linear-gradient(165deg, #f8faff 0%, #eef4ff 45%, #f1fbfb 100%);
}

.app-shell .top-bar {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(243, 247, 255, 0.86));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

/* —— Cards —— */
.app-shell .admin-panel-card,
.app-shell .card {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--a-radius);
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    box-shadow: var(--a-shadow);
    transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.app-shell .admin-panel-card:hover,
.app-shell .card:hover {
    box-shadow: var(--a-shadow-hover);
}

/* Page & section headers — Sales Report accent (bold title + gradient underline) */
.app-shell .page-title,
.app-shell .panel-card-title,
.app-shell .settings-section-title,
.app-shell .internal-crm .crm-form-header h2 {
    color: #1e293b;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.app-shell .page-title {
    position: relative;
    font-size: 1.65rem;
    text-align: left;
    padding-bottom: 0.55rem;
    margin: 0 0 1.25rem;
}

.app-shell .page-title::after,
.app-shell .panel-card-title::after,
.app-shell .settings-section-title::after,
.app-shell .internal-crm .crm-form-header h2::after {
    content: "";
    display: block;
    width: 56px;
    height: 4px;
    border-radius: 999px;
    margin-top: 0.55rem;
    background: var(--a-grad);
}

.app-shell .panel-card-title,
.app-shell .settings-section-title,
.app-shell .internal-crm .crm-form-header h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.55rem;
}

.app-shell .panel-card-title::after,
.app-shell .settings-section-title::after,
.app-shell .internal-crm .crm-form-header h2::after {
    flex-basis: 100%;
    margin-top: 0;
}

.app-shell .panel-card-title i,
.app-shell .settings-section-title i,
.app-shell .internal-crm .crm-form-header h2 i {
    color: #6366f1;
}

/* Colored card headers → elegant gradients */
.app-shell .card-header {
    border-left: none !important;
    letter-spacing: 0.01em;
}

.app-shell .card-header.blue { background: linear-gradient(120deg, #4f46e5, #0ea5e9) !important; }
.app-shell .card-header.orange { background: linear-gradient(120deg, #fb7185, #f59e0b) !important; }
.app-shell .card-header.teal { background: linear-gradient(120deg, #0d9488, #22d3ee) !important; }
.app-shell .card-header.cyan { background: linear-gradient(120deg, #0891b2, #38bdf8) !important; }

/* —— Tables —— */
.app-shell .admin-table thead th {
    background: linear-gradient(180deg, #f8faff, #eef2fb);
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    color: #475569;
}

.app-shell .admin-table tbody tr {
    transition: background 0.15s ease;
}

.app-shell .admin-table tbody tr:hover {
    background: #f4f8ff;
}

.app-shell .table-modern th {
    background: linear-gradient(180deg, #f8faff, #eef2fb) !important;
    color: #475569;
}

/* —— Inputs —— */
.app-shell .form-control {
    border-radius: 10px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.app-shell .form-control:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
    outline: none;
}

/* —— Buttons: gradient fills + dynamic animated border on hover —— */
.app-shell .btn-teal,
.app-shell .btn-primary,
.app-shell .btn-accent {
    position: relative;
    isolation: isolate;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 8px 20px -12px rgba(79, 70, 229, 0.55);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.app-shell .btn-primary { background: linear-gradient(120deg, #4f46e5, #0ea5e9); }
.app-shell .btn-accent { background: linear-gradient(120deg, #0d9488, #22d3ee); }
.app-shell .btn-teal { background: linear-gradient(120deg, #0f766e, #14b8a6); }

.app-shell .btn-teal:hover,
.app-shell .btn-primary:hover,
.app-shell .btn-accent:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
    box-shadow: 0 16px 32px -12px rgba(34, 211, 238, 0.5);
}

.app-shell .btn-teal::before,
.app-shell .btn-primary::before,
.app-shell .btn-accent::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(90deg, #a5b4fc, #22d3ee, #5eead4, #f0abfc, #a5b4fc);
    background-size: 300% 100%;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 2;
}

.app-shell .btn-teal:hover::before,
.app-shell .btn-primary:hover::before,
.app-shell .btn-accent:hover::before {
    opacity: 1;
    animation: aBorderFlow 2.2s linear infinite;
}

@keyframes aBorderFlow {
    to { background-position: 300% 0; }
}

/* —— Tabs —— */
.app-shell .settings-tabs {
    gap: 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.app-shell .settings-tab {
    border-radius: 12px 12px 0 0;
    color: #64748b;
}

.app-shell .settings-tab:hover {
    color: #4f46e5;
    background: linear-gradient(180deg, #eef2ff, #f6f9ff);
}

.app-shell .settings-tab.active {
    color: #4f46e5;
    border-bottom-color: transparent;
    background: linear-gradient(180deg, #eef2ff, #ffffff);
    box-shadow: inset 0 -3px 0 0 #6366f1;
}

/* —— Toggles —— */
.app-shell .toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(120deg, #6366f1, #22d3ee);
}

/* —— Filter toolbar / filter card —— */
.app-shell .filter-card {
    background: linear-gradient(180deg, #ffffff, #f7f9ff);
}

/* —— Pills get a touch more polish —— */
.app-shell .pill-admin { background: linear-gradient(120deg, #4f46e5, #14b8a6); }
.app-shell .pill-user { background: #e0f2fe; color: #0369a1; }

/* —— Alerts: softer, rounded —— */
.app-shell .alert {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

/* —— View / Export action buttons stay side by side —— */
.filter-actions-inline {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 0.5rem;
    width: auto;
}

/* Override main.css `.btn-primary { width: 100% }` so they don't stack */
.filter-actions-inline .btn,
.filter-actions-inline .btn-primary,
.filter-actions-inline .btn-accent {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 120px;
    white-space: nowrap;
}

/* —— Typography (central text scale) —— */
.app-shell {
    --a-text: #334155;
    --a-text-muted: #64748b;
    --a-heading: #1e293b;
    --a-label: #475569;
}

.app-shell .admin-page-header p,
.app-shell .crm-subtle,
.app-shell .text-muted {
    color: var(--a-text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.app-shell .form-label,
.app-shell .form-group label,
.app-shell .admin-panel-card .form-group label {
    color: var(--a-label);
    font-weight: 600;
    font-size: 0.84rem;
    letter-spacing: 0.01em;
    margin-bottom: 0.35rem;
}

.app-shell .form-label.required::after,
.app-shell label.required::after {
    content: " *";
    color: #f43f5e;
}

.app-shell .panel-card-title,
.app-shell .settings-section-title {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.app-shell .page-subtitle {
    margin: -0.75rem 0 1.25rem;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

.app-shell .admin-table td,
.app-shell .table-modern td {
    color: var(--a-text);
    font-size: 0.9rem;
}

.app-shell .admin-table th,
.app-shell .table-modern th {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* —— Sidebar navigation tabs —— */
.app-shell .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.22);
}

.app-shell .sidebar-user-card {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
}

.app-shell .sidebar-user-name {
    color: var(--a-heading);
}

.app-shell .sidebar-user-role {
    background: rgba(59, 130, 246, 0.12);
    color: #1e40af;
}

.app-shell .nav-item {
    border-radius: 12px;
    padding: 0.78rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--a-text-muted);
    border: 1px solid transparent;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.app-shell .nav-item i {
    color: #818cf8;
    font-size: 1.1rem;
}

.app-shell .nav-item:hover {
    background: linear-gradient(90deg, #eef2ff, #f5f3ff);
    color: #4f46e5;
    border-color: transparent;
}

.app-shell .nav-item:hover i {
    color: #6366f1;
}

.app-shell .nav-item.active {
    background: linear-gradient(90deg, #eef2ff, #ecfeff);
    color: #4f46e5;
    border-color: transparent;
    box-shadow: inset 3px 0 0 #6366f1;
}

.app-shell .nav-item.active i {
    color: #4f46e5;
}

.app-shell .toggle-sidebar {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #4f46e5;
}

.app-shell .toggle-sidebar:hover {
    background: #eef2ff;
}

.app-shell .top-bar {
    font-weight: 700;
    color: var(--a-heading);
    letter-spacing: -0.01em;
}

/* —— In-panel tabs (Settings, CRM, etc.) —— */
.app-shell .settings-tab {
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
    padding: 0.72rem 1.1rem;
}

.app-shell .settings-tab i {
    color: #818cf8;
    font-size: 1rem;
}

.app-shell .settings-tab:hover i,
.app-shell .settings-tab.active i {
    color: #6366f1;
}

/* —— All button variants (unified design system) —— */
.app-shell .btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.app-shell .btn-primary,
.app-shell .btn.btn-primary {
    width: auto;
}

.app-shell .btn-secondary,
.app-shell .btn-secondary.btn-modern {
    background: #fff;
    color: var(--a-label);
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 2px 8px -4px rgba(15, 23, 42, 0.12);
}

.app-shell .btn-secondary:hover,
.app-shell .btn-secondary.btn-modern:hover {
    background: #f8faff;
    border-color: #a5b4fc;
    color: #4f46e5;
    transform: translateY(-1px);
}

.app-shell .btn-outline,
.app-shell .btn-outline.btn-sm {
    background: #fff;
    color: #4f46e5;
    border: 1px solid #a5b4fc;
    box-shadow: none;
}

.app-shell .btn-outline:hover {
    background: linear-gradient(180deg, #eef2ff, #ffffff);
    border-color: #6366f1;
    color: #4338ca;
}

.app-shell .btn-danger,
.app-shell .btn-danger.btn-modern {
    background: linear-gradient(120deg, #e11d48, #f43f5e);
    color: #fff;
    border: none;
    box-shadow: 0 8px 20px -12px rgba(225, 29, 72, 0.45);
}

.app-shell .btn-danger:hover,
.app-shell .btn-danger.btn-modern:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.app-shell .btn-sm {
    padding: 0.42rem 0.85rem;
    font-size: 0.82rem;
    border-radius: 10px;
}

.app-shell .btn-modern {
    border-radius: 12px;
}

.app-shell .btn-block {
    width: 100%;
}

/* Card headers on user forms */
.app-shell .card {
    border-radius: var(--a-radius);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: var(--a-shadow);
    overflow: hidden;
}

.app-shell .card-header {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    padding: 0.85rem 1.15rem;
    color: #fff;
}

/* Help & Support hero — match portal pastel system */
.app-shell .help2-hero {
    background:
        radial-gradient(900px 500px at 12% -20%, rgba(255, 255, 255, 0.35), transparent 60%),
        linear-gradient(120deg, #6366f1 0%, #4f46e5 40%, #0ea5e9 100%);
    box-shadow: 0 18px 40px rgba(79, 70, 229, 0.22);
}

.app-shell .help2-section-title {
    color: var(--a-heading);
    font-weight: 700;
}

.app-shell .help2-section-title i {
    color: #6366f1;
}

.app-shell .help2-contact-card .ico {
    color: #6366f1;
    background: linear-gradient(135deg, #eef2ff, #e0f7fa);
}

.app-shell .faq2-item summary {
    color: var(--a-heading);
    font-weight: 600;
    font-size: 0.92rem;
}

.app-shell .faq2-item summary .q-ico {
    color: #6366f1;
}

/* CRM / ticket empty states */
.app-shell .crm-empty,
.app-shell .crm-empty-sm {
    color: var(--a-text-muted);
    font-size: 0.92rem;
}

/* Filter cards & toolbars */
.app-shell .filter-card,
.app-shell .filter-toolbar {
    border-radius: var(--a-radius);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .app-shell .btn-teal:hover::before,
    .app-shell .btn-primary:hover::before,
    .app-shell .btn-accent:hover::before {
        animation: none;
    }
    .app-shell .btn-teal:hover,
    .app-shell .btn-primary:hover,
    .app-shell .btn-accent:hover,
    .app-shell .btn-secondary:hover,
    .app-shell .btn-outline:hover {
        transform: none;
    }
}
