/* Modern Design System - Absensi THI */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #064199;
    --primary-light: #717bfe;
    --primary-dark: #304ba3;
    --secondary: #7c3aed;
    --accent: #10b981;
    --accent-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --bg-main: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(226, 232, 240, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --sidebar-width: 260px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(79, 70, 229, 0.1), 0 4px 6px -2px rgba(79, 70, 229, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* App Container */
.app-wrapper {
    display: flex;
    flex: 1;
    position: relative;
}

/* General Layout Elements */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.12), 0 10px 10px -5px rgba(79, 70, 229, 0.08);
}

/* Typography Helpers */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
}

p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Button UI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);
    transform: scale(1.02);
}

.btn-secondary {
    background-color: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--bg-main);
    color: var(--primary);
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Inputs */
.form-group {
    margin-bottom: 20px;
    width: 100%;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
    background-color: #fff;
}

/* Alerts & Toasts */
.alert {
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--accent-light);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-error {
    background-color: var(--danger-light);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background-color: var(--warning-light);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.2);
}

/* --- LOGIN PAGE STYLE --- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.05) 0%, rgba(124, 58, 237, 0.05) 90%), var(--bg-main);
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 25px 50px -12px rgba(79, 70, 229, 0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    margin-bottom: 16px;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.25);
}

.login-header h2 {
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- MOBILE LAYOUT & USER WORKFLOWS --- */
.mobile-view {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding-bottom: 90px;
    /* Spacer for bottom nav */
    background: #fff;
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.03);
    position: relative;
    display: flex;
    flex-direction: column;
}

.mobile-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 24px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.15);
}

.mobile-header .user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-header h3 {
    color: #fff;
    font-size: 1.3rem;
}

.role-badge {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.role-badge.mekanik {
    background: rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
}

.role-badge.sales {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
}

.mobile-body {
    padding: 20px;
    flex: 1;
}

/* Real-time Clock Widget */
.clock-widget {
    text-align: center;
    background: linear-gradient(135deg, #1e1b4b, #311042);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.clock-widget .time {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 4px;
    background: linear-gradient(to right, #fff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.clock-widget .date {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Check-in Actions card */
.action-card {
    text-align: center;
    padding: 30px 20px;
}

.action-card .status-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: inline-flex;
    color: var(--primary);
}

.action-card.checked-in .status-icon {
    color: var(--accent);
}

/* Camera Component UI */
.camera-box {
    width: 100%;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    aspect-ratio: 4/3;
    margin-bottom: 16px;
    border: 3px solid var(--border-color);
}

#camera-video,
#photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

/* Geolocation widget */
.location-widget {
    background-color: var(--bg-main);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
}

.location-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.location-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--warning);
}

.location-status.ready .dot {
    background-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.location-coords {
    font-size: 0.8rem;
    font-family: monospace;
    margin-bottom: 4px;
}

.location-address {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    width: 70px;
    height: 100%;
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.3rem;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: translateY(-2px);
    color: var(--primary);
}

/* Timeline/History UI */
.timeline {
    position: relative;
    padding-left: 24px;
    margin-top: 10px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 7px;
    width: 2px;
    height: calc(100% - 24px);
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-dot {
    position: absolute;
    left: -21px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--primary-light);
}

.timeline-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

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

.timeline-time {
    font-weight: 700;
    font-size: 0.95rem;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.timeline-details {
    display: flex;
    gap: 16px;
}

.timeline-photo {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.timeline-photo:hover {
    transform: scale(1.05);
}

.timeline-info {
    flex: 1;
    font-size: 0.85rem;
}

.timeline-loc {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: var(--text-main);
    margin-bottom: 6px;
}

.timeline-loc a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.timeline-loc a:hover {
    text-decoration: underline;
}

.timeline-note {
    background-color: #fff;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
}

/* --- ADMIN LAYOUT STYLE (DESKTOP) --- */
.admin-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Admin Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e1b4b 0%, #311042 100%);
    color: #fff;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.25rem;
    margin-bottom: 40px;
}

.sidebar-logo i {
    font-size: 1.5rem;
    color: var(--primary-light);
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition);
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.sidebar-link i {
    font-size: 1.2rem;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

/* Admin Main Content */
.admin-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    background-color: var(--bg-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.admin-header .user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #fff;
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-card .val {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
}

.stat-card .lbl {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
}

.stat-card:nth-child(1) .stat-icon {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.stat-card:nth-child(2) .stat-icon {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent);
}

.stat-card:nth-child(3) .stat-icon {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card:nth-child(4) .stat-icon {
    background-color: rgba(124, 58, 237, 0.1);
    color: var(--secondary);
}

/* Table styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table-card {
    overflow: hidden;
}

.address {
    font-size: 0.85rem;
    max-width: 250px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background-color: var(--bg-main);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 20px;
    border-bottom: 2px solid var(--border-color);
}

.admin-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-main);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background-color: rgba(248, 250, 252, 0.7);
}

/* User Profile Image Thumbnail */
.table-img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.table-img:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* Location pill and coordinates link */
.location-pill {
    display: inline-flex;
    flex-direction: column;
    font-size: 0.85rem;
    gap: 2px;
}

.location-pill .address {
    font-weight: 500;
}

.location-pill .link-map {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.location-pill .link-map:hover {
    text-decoration: underline;
}

/* Filter controls bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.filter-bar .form-group {
    margin-bottom: 0;
    width: auto;
    min-width: 180px;
}

/* Modal Popup Window */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modal-card {
    background-color: #fff;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-body img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-md);
    background-color: #000;
}

/* Actions cell buttons */
.actions-cell {
    display: flex;
    gap: 8px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Custom Responsive Styles */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
        padding: 20px 10px;
    }

    .sidebar-logo span,
    .sidebar-link span,
    .sidebar-logo i:last-child {
        display: none;
    }

    .sidebar-link {
        justify-content: center;
        padding: 12px;
    }

    .admin-content {
        margin-left: 70px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
    }

    .sidebar-logo {
        margin-bottom: 0;
    }

    .sidebar-menu {
        flex-direction: row;
        gap: 12px;
    }

    .sidebar-link {
        padding: 8px 12px;
    }

    .sidebar-footer {
        display: none;
    }

    .admin-content {
        margin-left: 0;
        padding: 20px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-group {
        width: 100%;
    }

    .filter-bar .btn {
        width: 100%;
    }
}

/* --- PRINT MEDIA STYLESHEET --- */
@page {
    size: landscape;
    margin: 10mm;
}

@media print {

    /* Reset root containers for multi-page overflow */
    html,
    body {
        background-color: #fff !important;
        color: #000 !important;
        font-size: 9.5pt !important;
        font-family: 'Plus Jakarta Sans', Arial, sans-serif !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide UI controls, sidebars, buttons, navigation, modals, alerts, and card header */
    .sidebar,
    .bottom-nav,
    .btn,
    .filter-bar,
    .admin-header,
    .stats-grid,
    .actions-cell,
    .modal-overlay,
    .timeline-dot::before,
    form,
    .alert,
    .table-card-header {
        display: none !important;
    }

    /* Ensure content wrappers do not constrain width, height, or overflow */
    .app-wrapper,
    .admin-content,
    .container,
    .glass-card,
    .table-responsive,
    .table-card {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        position: static !important;
        display: block !important;
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Print Header (Visible ONLY on print) */
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }

    .print-header h1 {
        font-size: 16pt !important;
        font-weight: 700 !important;
        color: #000 !important;
        margin-bottom: 4px;
        text-transform: uppercase;
    }

    .print-header p {
        font-size: 9.5pt !important;
        color: #333 !important;
        margin: 2px 0;
    }

    /* Clean, full-width printing table */
    .admin-table {
        width: 100% !important;
        max-width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 10px !important;
        table-layout: fixed !important;
        page-break-after: auto !important;
    }

    .admin-table th,
    .admin-table td {
        border: 1px solid #444 !important;
        padding: 6px 8px !important;
        font-size: 8.5pt !important;
        color: #000 !important;
        vertical-align: middle !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .admin-table th {
        background-color: #e5e7eb !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        font-size: 8pt !important;
    }

    /* Table Column Widths for Landscape Print */
    .admin-table th:nth-child(1),
    .admin-table td:nth-child(1) {
        width: 4% !important;
        text-align: center;
    }

    .admin-table th:nth-child(2),
    .admin-table td:nth-child(2) {
        width: 13% !important;
    }

    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3) {
        width: 15% !important;
    }

    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4) {
        width: 8% !important;
    }

    .admin-table th:nth-child(5),
    .admin-table td:nth-child(5) {
        width: 8% !important;
        text-align: center;
    }

    .admin-table th:nth-child(6),
    .admin-table td:nth-child(6) {
        width: 24% !important;
    }

    .admin-table th:nth-child(7),
    .admin-table td:nth-child(7) {
        width: 12% !important;
    }

    .admin-table th:nth-child(8),
    .admin-table td:nth-child(8) {
        width: 16% !important;
    }

    /* Override inline max-width/truncation on address */
    .address,
    .location-pill .address {
        max-width: none !important;
        width: auto !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: normal !important;
        word-break: break-word !important;
        display: block !important;
        font-size: 8.5pt !important;
    }

    /* Print URLs / coordinate numbers instead of maps link text */
    .location-pill {
        display: block !important;
    }

    .location-pill .link-map {
        display: none !important;
    }

    .location-pill::after {
        content: " (Lat: " attr(data-lat) ", Lng: " attr(data-lng) ")";
        font-size: 8pt !important;
        font-style: italic !important;
        color: #444 !important;
    }

    /* Role badge formatting in print */
    .role-badge {
        border: 1px solid #666 !important;
        background: none !important;
        color: #000 !important;
        padding: 2px 6px !important;
        font-size: 8pt !important;
        font-weight: 600 !important;
        border-radius: 4px !important;
    }

    /* Image formatting in print */
    .table-img {
        display: inline-block !important;
        width: 40px !important;
        height: 40px !important;
        object-fit: cover !important;
        border: 1px solid #999 !important;
        border-radius: 4px !important;
    }

    .image-placeholder-print {
        display: none !important;
    }

    /* Multi-page table repeat header and page break prevention */
    thead {
        display: table-header-group !important;
    }

    tbody {
        display: table-row-group !important;
    }

    tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    td,
    th {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}

/* Print Header display helper for web screen */
.print-header {
    display: none;
}

.image-placeholder-print {
    display: none;
}