/* 
    HR Attendance System Styling - Premium Edition
    Inspired by ConnectTeam & Modern SaaS UI
*/

:root {
    --att-primary: var(--brand-primary);
    --att-primary-light: var(--brand-primary-light);
    --att-success: var(--color-success);
    --att-danger: var(--color-danger);
    --att-warning: var(--color-warning);
    --att-bg: var(--neutral-bg);
    --att-card: var(--neutral-surface);
    --att-text: var(--text-primary);
    --att-text-muted: var(--text-muted);
    --att-border: var(--neutral-border);
    --att-shadow: var(--shadow-md);
}

.attendance-hub-container {
    padding: 24px;
    background: var(--att-bg);
    min-height: 100vh;
}

/* --- TABS STYLING --- */
.attendance-admin-tabs-wrap {
    background: white;
    padding: 0 24px;
    border-bottom: 1px solid var(--att-border);
    margin: 0 -24px 24px -24px;
}

.attendance-admin-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.attendance-admin-tabs::-webkit-scrollbar {
    display: none;
}

.admin-tab {
    padding: 16px 24px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: var(--att-text-muted);
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    user-select: none;
    position: relative;
    white-space: nowrap;
}

.admin-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--att-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.admin-tab.active {
    color: var(--att-primary);
}

.admin-tab.active::after {
    transform: scaleX(1);
}

.admin-tab:hover {
    color: var(--att-text);
    background: rgba(0, 0, 0, 0.02);
}

/* --- PREMIUM CARDS --- */
.att-card {
    background: var(--att-card);
    border-radius: 16px;
    box-shadow: var(--att-shadow);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--att-border);
}

.att-card h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--att-text);
}

/* --- STATS GRID --- */
.att-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.att-stat-card {
    padding: 24px;
    border-radius: 20px;
    background: white;
    border: 1px solid var(--att-border);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.att-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.att-stat-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--att-text-muted);
    margin-bottom: 8px;
}

.att-stat-val {
    font-size: 36px;
    font-weight: 800;
    color: var(--att-text);
    line-height: 1;
}

/* --- LISTS & TIMELINE --- */
.att-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.att-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #fcfdfe;
    border-radius: 12px;
    border: 1px solid var(--att-border);
    transition: transform 0.2s;
}

.att-list-item:hover {
    transform: scale(1.01);
    border-color: var(--att-primary-light);
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-title {
    font-weight: 700;
    font-size: 15px;
}

.item-sub {
    font-size: 12px;
    color: var(--att-text-muted);
}

/* --- SHIFT TIMER (Employee) --- */
.shift-timer-display {
    font-size: 64px;
    font-weight: 800;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    color: var(--att-text);
    margin: 10px 0;
    background: linear-gradient(to bottom, #1e293b, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- ACTION BUTTONS --- */
.check-in-hero {
    text-align: center;
    padding: 30px 0;
}

.check-in-btn-wrap {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 40px 0;
}

.btn-att-main {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 700;
    color: white;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-att-in {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-att-out {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
}

.btn-att-main:hover {
    transform: translateY(-8px) scale(1.05);
}

.btn-att-main:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

/* Pulse Animation */
.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--att-success);
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.att-map-container {
    height: 350px;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 16px;
    border: 2px solid var(--att-border);
}

/* Member Picker inside Modal */
.att-member-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 6px;
    background: white;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.att-member-picker-item:hover {
    background: #f1f5f9;
    border-color: var(--att-border);
}

.att-member-picker-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--att-primary);
}

.att-member-picker-item .name-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--att-text);
}

.att-selected-members-wrap {
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7ff 100%);
    border: 1px solid #dbe7ff;
    border-radius: 12px;
    padding: 12px;
}

.att-selected-members-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--att-text);
}

.att-selected-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--att-primary);
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.24);
    border-radius: 999px;
    padding: 3px 10px;
}

.att-selected-members-list {
    min-height: 42px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.att-selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #d6e3ff;
    color: #1e3a8a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.att-selected-chip-remove {
    border: none;
    background: transparent;
    color: #1e3a8a;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.att-selected-empty {
    font-size: 12px;
    color: var(--att-text-muted);
    font-weight: 500;
}

/* --- MOBILE RESPONSIVENESS --- */
@media screen and (max-width: 768px) {
    .attendance-hub-container {
        padding: 12px;
    }

    .att-card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .shift-timer-display {
        font-size: 42px;
    }

    .check-in-btn-wrap {
        flex-direction: column;
        gap: 24px;
        margin: 20px 0;
    }

    .btn-att-main {
        width: 140px;
        height: 140px;
    }

    .att-stats-grid {
        grid-template-columns: 1fr;
    }

    .attendance-admin-tabs {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .admin-tab {
        padding: 10px 16px;
        flex-shrink: 0;
    }
}

/* --- MONTH CALENDAR --- */
.month-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.month-cal-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.month-cal-nav button {
    background: transparent;
    border: 1px solid var(--att-border);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
}

.month-cal-nav button:hover {
    background: #f1f5f9;
}

.month-cal-title {
    font-size: 18px;
    font-weight: 700;
}

.month-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-top: 1px solid var(--att-border);
    border-left: 1px solid var(--att-border);
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.month-cal-head-cell {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    border-right: 1px solid var(--att-border);
    border-bottom: 1px solid var(--att-border);
    color: var(--att-text-muted);
}

.month-cal-cell {
    min-height: 120px;
    border-right: 1px solid var(--att-border);
    border-bottom: 1px solid var(--att-border);
    padding: 8px;
    position: relative;
    background: white;
}

.month-cal-cell.is-holiday {
    background: #fffbeb;
}

.month-cal-cell.is-holiday .month-cal-date {
    color: #b45309;
    font-weight: 800;
}

.month-cal-cell.empty {
    background: #f8fafc;
}

.month-cal-date {
    text-align: right;
    font-size: 12px;
    color: var(--att-text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.month-cal-cell:hover .month-cal-add {
    opacity: 1;
}

.month-cal-add {
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--att-text);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: opacity 0.2s;
    box-shadow: var(--att-shadow);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
}

.month-cal-add:hover {
    background: black;
}

.month-cal-shifts {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.month-cal-holiday-note {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.month-cal-legend-holiday {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #fcd34d;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 700;
}

.month-cal-shift {
    background: var(--att-bg);
    border: 1px solid var(--att-border);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    font-weight: 500;
}

.month-cal-shift:hover {
    border-color: var(--att-primary-light);
}

/* --- SMALL ACTION BUTTONS --- */
.btn-xs {
    padding: 4px 8px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
    min-width: auto !important;
}

.btn-xs svg {
    display: inline-block;
    vertical-align: middle;
}

/* --- ATTENDANCE STATUS BADGES --- */
.att-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* On Time - Soft Blue */
.badge-in {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

/* Absent / Missing Out - Soft Red */
.badge-out {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Late - Soft Amber */
.badge-warning {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

/* Day Off / Scheduled Off - Soft Slate */
.badge-outline {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

.att-badge:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
}

/* --- EMPLOYEE PROFILE ATTENDANCE TAB --- */
.profile-attendance-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.att-quick-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.att-quick-stats .stat-item {
    background: white;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.att-quick-stats .stat-item label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
}

.att-quick-stats .stat-item strong {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
}

.att-table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

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

.att-mini-table th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

.att-row-compact td {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.att-date-cell {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.att-date-cell .day-num {
    font-weight: 900;
    font-size: 16px;
    color: #4f46e5;
}

.att-date-cell .day-name {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
}

.roster-slot {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.roster-slot.is-off {
    color: #94a3b8;
    font-weight: 600;
}

.punches-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 15px;
}

.p-in {
    color: #16a34a;
}

.p-out {
    color: #dc2626;
}

.p-sep {
    color: #cbd5e1;
    font-weight: 400;
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-sm:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #4f46e5;
}

.att-month-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.month-display {
    display: flex;
    align-items: center;
    font-weight: 800;
    color: #1e293b;
    font-size: 15px;
    min-width: 160px;
    justify-content: center;
}

.btn-nav {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nav:hover {
    background: #f8fafc;
    color: #4f46e5;
    border-color: #cbd5e1;
}

.att-row-compact.is-today {
    background: #f0f7ff;
}

.att-row-compact.is-today td {
    border-bottom-color: #d0e7ff;
}

/* --- PRINT STYLES --- */
@media print {

    /* Hide ALL top-level siblings of the app container */
    body>*:not(.app) {
        display: none !important;
    }

    /* Hide non-report sections inside the app */
    .app-sidebar,
    .top-navbar,
    .workspace-banner,
    .topbar,
    .tabs-shell,
    .dashboard-summary-shell,
    .attendance-admin-tabs-wrap,
    .attendance-admin-actions,
    .report-sidebar,
    .no-print,
    .modal-overlay,
    button,
    .btn,
    .mt-20.text-muted-sm {
        display: none !important;
    }

    /* Ensure parents are visible and have no padding/margins */
    .app,
    .app-shell,
    .app-main,
    .section-shell,
    .report-shell,
    .table-page-shell,
    .attendance-hub-container,
    #attendance-content,
    #timesheet-result-container {
        display: block !important;
        position: static !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Hide the sidebar panel inside the reports view */
    .grid-2-1>div:first-child {
        display: none !important;
    }

    .grid-2-1 {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Page settings */
    @page {
        size: auto;
        margin: 10mm 5mm;
    }

    /* Table & Stats optimization */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9px !important;
    }

    th,
    td {
        border: 1px solid #e2e8f0 !important;
        padding: 6px 4px !important;
    }

    .att-stats-grid {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        margin-bottom: 15px !important;
    }

    .att-stat-card {
        flex: 1 !important;
        padding: 8px !important;
        border: 1px solid #e2e8f0 !important;
        background: #f8fafc !important;
    }

    .att-stat-val {
        font-size: 18px !important;
    }

    .att-stat-label {
        font-size: 9px !important;
    }

    /* Fix typography colors for BW printers or light print */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
}

/* Side Drawers */
.drawer {
  position: fixed;
  top: 0; right: -420px;
  width: 400px; height: 100vh;
  background: #fff;
  box-shadow: -10px 0 40px rgba(15, 31, 51, 0.1);
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: none;
  max-width: 100vw;
}
.drawer.open { right: 0; }
.drawer-header { padding: 24px; border-bottom: 1px solid var(--att-border); background: #fcfdfe; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; }
.drawer-footer { padding: 20px 24px; border-top: 1px solid var(--att-border); background: #fcfdfe; }
.att-stat:focus-visible,.filters select:focus-visible,.att-row:focus-visible,.day-selector:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(31,95,166,.18)}
/* Payroll indicator text styling (shared table tone) */
.payroll-indicator-warning {
  color: var(--att-warning, #b54708);
  font-weight: 600;
}
