/* Employee web portal — small additions on top of assets/app.css */

/* Login: Android app download link above the copyright line */
.ew-login-app-cta {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.ew-login-app-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #f97316;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.ew-login-app-link i {
    font-size: 15px;
}

.ew-login-app-link:hover,
.ew-login-app-link:focus-visible {
    color: #ea6c0a;
    text-decoration: underline;
}

.employee-web-portal .ew-leave-history-item {
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.employee-web-portal .ew-leave-history-item:last-child {
    border-bottom: 0;
}

.employee-web-portal .ew-request-history-title-row {
    padding-bottom: 0.45rem;
    margin-bottom: 0.55rem;
    border-bottom: 1px solid rgba(251, 146, 60, 0.45);
}

.employee-web-portal .ew-request-history-type {
    font-size: 0.98rem;
    letter-spacing: 0.01em;
}

.login-body .ew-login-app-cta + .login-box-footer {
    margin-top: 10px;
}

.regular-web-face-video,
.regular-web-face-preview {
    width: 100%;
    max-width: 280px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    display: block;
}

.regular-web-avatar,
.regular-web-avatar-placeholder {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
}

.regular-web-avatar-placeholder {
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #94a3b8;
}

.regular-web-signature-pad {
    width: 100%;
    max-width: 100%;
    border: 1px dashed #94a3b8;
    border-radius: 8px;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}

.ew-att-history-table {
    font-size: 0.875rem;
}

.ew-att-history-table tbody tr.ew-att-row--pending {
    background-color: #fef9c3;
}

.ew-att-history-table tbody tr.ew-att-row--pending:hover {
    background-color: #fef08a;
}

.ew-att-history-table tbody tr.ew-att-row--void {
    background-color: #fee2e2;
}

.ew-att-history-table tbody tr.ew-att-row--void:hover {
    background-color: #fecaca;
}

#rwTodayNullVoidWrap p:last-child {
    margin-bottom: 0 !important;
}

.ew-att-punch {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.ew-att-punch-time {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ew-att-holiday-cell {
    font-size: 0.8rem;
    white-space: nowrap;
}

.ew-att-ot-badge {
    background-color: #7c3aed !important;
    color: #fff !important;
    font-size: 0.65rem;
    font-weight: 700;
    vertical-align: middle;
}

.ew-att-holiday-label {
    display: inline-block;
    font-weight: 700;
    color: #b45309;
}

.ew-att-face-btn {
    border: 0;
    padding: 0;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    line-height: 0;
}

.ew-att-face-btn:hover .ew-att-face-thumb {
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.45);
}

.ew-att-face-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #f8fafc;
}

.ew-att-photo-modal-body {
    background: #0f172a;
    text-align: center;
}

.ew-att-photo-modal-img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.rw-gps-strip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #fdba74;
    background: #fff7ed;
    margin-bottom: 12px;
}

.rw-gps-strip--ready {
    border-color: #86efac;
    background: #ecfdf5;
}

.rw-gps-strip--loading {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.rw-gps-strip-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffedd5;
}

.rw-gps-strip--ready .rw-gps-strip-icon {
    background: #d1fae5;
    color: #047857;
    font-size: 1.1rem;
}

.rw-gps-strip-body {
    flex: 1 1 auto;
    min-width: 0;
}

.rw-gps-strip-kicker {
    display: block;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 2px;
}

.rw-gps-strip-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.rw-gps-strip-coords {
    display: block;
    margin-top: 4px;
    font-size: 0.68rem;
    color: #64748b;
}

.rw-gps-strip-retry {
    flex: 0 0 auto;
    font-weight: 700;
    text-decoration: none;
    padding: 0;
}

.rw-gps-map-wrap {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #f1f5f9;
}

/* Frosted card backdrop-filter breaks Leaflet tile compositing — use solid surface on punch card. */
.content-main .card.rw-punch-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.96);
}

.rw-gps-map-frame {
    display: block;
    width: 100%;
    height: 230px;
    border: 0;
    z-index: 1;
    background: #e2e8f0;
}

.rw-gps-map-fallback {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background: #fff7ed;
    color: #7c2d12;
}

.rw-gps-map-fallback.d-none {
    display: none !important;
}

.rw-gps-map-fallback i {
    font-size: 2rem;
    color: #c2410c;
    margin-bottom: 8px;
}

.rw-gps-map-fallback p {
    font-size: 0.78rem;
    color: #92400e;
    max-width: 280px;
}

.ew-payslip-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ew-payslip-card {
    color: inherit;
    border: 1px solid rgba(148, 163, 184, 0.35);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.ew-payslip-card:hover {
    border-color: rgba(249, 115, 22, 0.45);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.ew-payslip-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.ew-payslip-card-hint {
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 2px;
}

.ew-payslip-card-net {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.ew-payslip-card-net-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}

.ew-payslip-card-net-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.ew-payslip-card-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 6px;
}

.ew-payslip-card-row span:last-child {
    color: #334155;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ew-payslip-hero-card {
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.ew-payslip-panel {
    overflow: hidden;
}

.ew-payslip-view-header {
    padding: 1.15rem 1.25rem 1rem;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.ew-payslip-view-kicker {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
    margin: 0;
}

.ew-payslip-view-header-intro {
    margin-bottom: 1rem;
}

.ew-payslip-summary-period {
    font-size: 1.05rem;
    line-height: 1.35;
    font-weight: 700;
    color: #0f172a;
}

.ew-payslip-summary-stats {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.ew-payslip-summary-stats--row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.ew-payslip-summary-stat {
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    background: #ffffff;
    text-align: center;
}

.ew-payslip-summary-stat--gross {
    border-color: rgba(234, 88, 12, 0.32);
    background: rgba(255, 247, 237, 0.85);
}

.ew-payslip-summary-stat--ded {
    border-color: rgba(220, 38, 38, 0.28);
    background: rgba(254, 242, 242, 0.85);
}

.ew-payslip-summary-stat--net {
    border-color: rgba(4, 120, 87, 0.32);
    background: rgba(236, 253, 245, 0.75);
}

.ew-payslip-stat-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 4px;
}

.ew-payslip-stat-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

/* Beat app.css `.content-main .card span { color: inherit }` on employee payslip view */
.employee-web-portal .ew-payslip-view-page .ew-payslip-summary-stat--gross .ew-payslip-stat-label,
.employee-web-portal .ew-payslip-view-page .ew-payslip-summary-stat--gross .ew-payslip-stat-value {
    color: #ea580c;
}

.employee-web-portal .ew-payslip-view-page .ew-payslip-summary-stat--ded .ew-payslip-stat-label,
.employee-web-portal .ew-payslip-view-page .ew-payslip-summary-stat--ded .ew-payslip-stat-value {
    color: #dc2626;
}

.employee-web-portal .ew-payslip-view-page .ew-payslip-summary-stat--net .ew-payslip-stat-label,
.employee-web-portal .ew-payslip-view-page .ew-payslip-summary-stat--net .ew-payslip-stat-value {
    color: #047857;
}

.employee-web-portal .ew-payslip-view-page .ew-payslip-embed {
    display: block;
    min-width: 0;
    padding: 0;
    background: #ffffff;
    overflow: hidden;
}

.employee-web-portal .ew-payslip-frame {
    display: block;
    width: 100%;
    min-height: 200px;
    height: 320px;
    border: 0;
    background: #ffffff;
    overflow: hidden;
}

@media (min-width: 768px) {
    .ew-payslip-view-header {
        padding: 1.35rem 1.5rem 1.15rem;
    }

    .ew-payslip-summary-stats--row {
        gap: 0.85rem;
    }

    .ew-payslip-summary-stat {
        padding: 0.85rem 1rem;
    }

    .ew-payslip-stat-value {
        font-size: 1.15rem;
    }
}

@media (max-width: 575.98px) {
    .ew-payslip-summary-stats--row {
        grid-template-columns: 1fr;
    }

    .ew-payslip-summary-stat {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.75rem;
        text-align: left;
    }

    .ew-payslip-stat-label,
    .ew-payslip-stat-value {
        display: inline;
        margin: 0;
    }

    .ew-payslip-summary-stat--net {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .ew-payslip-summary-stat--net .ew-payslip-stat-label,
    .ew-payslip-summary-stat--net .ew-payslip-stat-value {
        display: block;
    }
}

/* --------------------------------------------------------------------------
   Dashboard welcome hero
   -------------------------------------------------------------------------- */
.employee-web-portal.app-body .ims-page-stack > .dashboard-hero-row {
    margin-bottom: 0;
}

.employee-web-portal.app-body .dashboard-hero {
    flex: none;
    width: 100%;
}

.employee-web-portal.app-body .dashboard-hero-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.employee-web-portal.app-body .dashboard-hero-text {
    flex: 1 1 auto;
    min-width: 0;
}

.employee-web-portal.app-body .dashboard-hero-clock {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    padding: 0.85rem 1.1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(251, 146, 60, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
    min-width: 9rem;
}

.employee-web-portal.app-body .dashboard-hero-clock-time {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.employee-web-portal.app-body .dashboard-hero-clock-zone {
    margin-top: 0.2rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
    font-weight: 700;
    text-align: right;
}

/* --------------------------------------------------------------------------
   Phone / small tablet — app-like layout (employee web only; no logic changes)
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .employee-web-portal.app-body {
        --ew-nav-h: 56px;
        --ew-tab-h: 62px;
        --ims-nav-h: var(--ew-nav-h);
        --ims-subnav-h: var(--ew-tab-h);
        -webkit-tap-highlight-color: transparent;
    }

    /* Compact top bar: logo + avatar only */
    .employee-web-portal.app-body .top-navbar {
        height: var(--ew-nav-h);
        padding: 0 12px;
        padding-top: env(safe-area-inset-top);
    }

    .employee-web-portal.app-body .brand {
        min-width: 0;
        gap: 8px;
    }

    .employee-web-portal.app-body .brand img {
        width: 36px;
        height: 36px;
    }

    .employee-web-portal.app-body .brand-text span {
        display: none;
    }

    .employee-web-portal.app-body .brand-text h2 {
        font-size: 0.95rem;
        line-height: 1.2;
        max-width: 42vw;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .employee-web-portal.app-body .nav-right {
        min-width: 0;
    }

    .employee-web-portal.app-body .user-profile {
        padding: 4px;
        background: transparent;
    }

    .employee-web-portal.app-body .user-details {
        display: none;
    }

    .employee-web-portal.app-body .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .employee-web-portal.app-body .profile-dropdown {
        right: 0;
        left: auto;
        min-width: 180px;
    }

    /* Bottom tab bar (same links — repositioned only) */
    .employee-web-portal.app-body .sub-navbar {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(var(--ew-tab-h) + env(safe-area-inset-bottom));
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        border-bottom: 0;
        border-top: 1px solid rgba(148, 163, 184, 0.28);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
        z-index: 1030;
    }

    .employee-web-portal.app-body .nav-menu {
        justify-content: space-around;
        gap: 0;
        overflow-x: visible;
        white-space: normal;
        padding-bottom: 0;
        height: 100%;
        align-items: stretch;
    }

    .employee-web-portal.app-body .nav-btn {
        flex: 1 1 0;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3px;
        padding: 4px 6px;
        font-size: 0.62rem;
        font-weight: 700;
        border-radius: 10px;
        min-height: 48px;
    }

    .employee-web-portal.app-body .nav-btn i {
        font-size: 1.35rem;
        line-height: 1;
    }

    .employee-web-portal.app-body .nav-btn span {
        line-height: 1.1;
    }

    .employee-web-portal.app-body .nav-btn.active {
        background: rgba(249, 115, 22, 0.12);
    }

    /* Content area: room for top bar + bottom tabs */
    .employee-web-portal.app-body .main-wrapper {
        padding-top: calc(var(--ew-nav-h) + env(safe-area-inset-top) + 10px);
        padding-bottom: calc(var(--ew-tab-h) + env(safe-area-inset-bottom) + 20px);
        padding-left: 14px;
        padding-right: 14px;
    }

    .employee-web-portal.app-body .content-header {
        margin-bottom: 0.65rem;
    }

    .employee-web-portal.app-body .content-header-title {
        font-size: 1.15rem;
    }

    /* Dashboard */
    .employee-web-portal.app-body .dashboard-hero {
        padding: 1rem 1.1rem;
        margin-bottom: 1rem;
    }

    .employee-web-portal.app-body .dashboard-hero-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }

    .employee-web-portal.app-body .dashboard-hero-text {
        min-width: 0;
    }

    .employee-web-portal.app-body .dashboard-hero-clock {
        width: 100%;
        min-width: 0;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
    }

    .employee-web-portal.app-body .dashboard-hero-clock-zone {
        margin-top: 0;
        text-align: right;
        font-size: 0.62rem;
    }

    .employee-web-portal.app-body .kpi-grid-dashboard > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Attendance — larger touch targets */
    .employee-web-portal .regular-web-face-video,
    .employee-web-portal .regular-web-face-preview {
        max-width: 100%;
    }

    .employee-web-portal .rw-gps-map-frame {
        height: 200px;
    }

    .employee-web-portal #rwTimeInBtn,
    .employee-web-portal #rwTimeOutBtn {
        min-height: 52px;
        font-size: 1.05rem;
        font-weight: 700;
    }

    .employee-web-portal #rwStartCameraBtn,
    .employee-web-portal #rwCaptureFaceBtn,
    .employee-web-portal #rwRetakeFaceBtn {
        min-height: 44px;
    }

    .employee-web-portal .ew-att-history-table {
        font-size: 0.8rem;
    }

    /* Payslip list cards — full width tap targets */
    .employee-web-portal .ew-payslip-card {
        border-radius: 14px;
    }

    .employee-web-portal .ew-payslip-card:active {
        transform: scale(0.99);
    }

    .employee-web-portal .ew-payslip-frame {
        min-height: 200px;
    }

    .employee-web-portal .ew-leave-history-item {
        border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    }

    .employee-web-portal .ew-leave-history-item:last-child {
        border-bottom: 0;
    }

    .employee-web-portal .ew-request-history-title-row {
        padding-bottom: 0.45rem;
        margin-bottom: 0.55rem;
        border-bottom: 1px solid rgba(251, 146, 60, 0.45);
    }

    .employee-web-portal .ew-request-history-type {
        font-size: 0.98rem;
        letter-spacing: 0.01em;
    }

    /* Account / forms */
    .employee-web-portal.app-body .content-main .btn {
        min-height: 44px;
    }

    .employee-web-portal .regular-web-signature-pad {
        min-height: 140px;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .employee-web-portal.app-body .brand-text h2 {
        max-width: 36vw;
        font-size: 0.88rem;
    }

    .employee-web-portal.app-body .nav-btn {
        font-size: 0.58rem;
    }

    .employee-web-portal.app-body .nav-btn i {
        font-size: 1.2rem;
    }
}

