/* ── Attendance Module Styles ─────────────────────────────── */

/* Staff view */
.att-staff-wrap {
    padding: 4px 0 32px;
}

.att-checkin-card,
.att-done-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.att-checkin-header {
    background: linear-gradient(135deg, #1A6847 0%, #0e2218 100%);
    padding: 18px 18px 16px;
    border-bottom: 1px solid rgba(197,165,114,0.2);
}

.att-checkin-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--vanilla);
    margin-bottom: 4px;
}

.att-checkin-date {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
}

/* Camera area */
.att-camera-area {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #0a1a12;
    overflow: hidden;
    max-height: 320px;
}

.att-camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
}

.att-camera-icon svg {
    width: 48px;
    height: 48px;
    stroke-width: 1.25;
    color: var(--accent);
    opacity: 0.5;
}

.att-camera-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.att-video,
.att-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.att-video {
    transform: scaleX(-1); /* mirror selfie */
}

/* Actions */
.att-actions {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border);
}

.att-btn-big {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.att-btn-big svg { width: 18px; height: 18px; }

.att-btn-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
}

.att-note {
    padding: 12px 16px;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid var(--border);
}

.att-note svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Done card */
.att-done-card {
    text-align: center;
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.att-done-icon {
    color: var(--success);
    margin-bottom: 4px;
}

.att-done-icon svg { width: 52px; height: 52px; stroke-width: 1.5; }

.att-done-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--vanilla);
}

.att-done-date {
    font-size: 13px;
    color: var(--text-muted);
}

.att-done-time {
    font-size: 32px;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--accent);
    letter-spacing: -0.02em;
}

.att-selfie-preview {
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.att-selfie-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 4px rgba(197,165,114,0.15);
}

.att-selfie-label {
    font-size: 11px;
    color: var(--text-muted);
}

.att-done-msg {
    font-size: 14px;
    color: var(--success);
    font-weight: 600;
    margin-top: 4px;
}

/* ── Manager view ──────────────────────────────────────────── */
.att-mgr-wrap {
    padding: 0 0 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.att-mgr-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.att-mgr-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--vanilla);
    display: flex;
    align-items: center;
    gap: 8px;
}

.att-mgr-title svg { width: 18px; height: 18px; color: var(--accent); }

.att-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.att-date-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--vanilla);
    outline: none;
    transition: var(--transition);
}

.att-date-input:focus { border-color: var(--accent); }

/* Stats row */
.att-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 4px;
}

.att-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 8px;
    text-align: center;
}

.att-stat-present { border-color: rgba(74,140,92,0.3); background: rgba(74,140,92,0.07); }
.att-stat-absent  { border-color: rgba(192,112,90,0.3); background: rgba(192,112,90,0.07); }

.att-stat-num {
    font-size: 28px;
    font-weight: 900;
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: 4px;
}

.att-stat-present .att-stat-num { color: var(--success); }
.att-stat-absent  .att-stat-num { color: var(--danger); }
.att-stat-total   .att-stat-num { color: var(--accent); }

.att-stat-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.att-stat-label svg { width: 11px; height: 11px; }

.att-date-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 2px 0 4px;
}

/* Cards grid */
.att-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.att-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    animation: attCardIn 0.4s both cubic-bezier(0.34, 1.4, 0.64, 1);
}

.att-card-present { border-color: rgba(74,140,92,0.3); }
.att-card-absent  { border-color: rgba(192,112,90,0.2); opacity: 0.7; }

@keyframes attCardIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

.att-card-photo-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #0a1a12;
    overflow: hidden;
    cursor: pointer;
}

.att-card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.att-card-photo-wrap:hover .att-card-photo {
    transform: scale(1.04);
}

.att-photo-zoom {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
}

.att-card-photo-wrap:hover .att-photo-zoom { opacity: 1; }
.att-photo-zoom svg { width: 14px; height: 14px; }

.att-card-no-photo {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    opacity: 0.3;
}

.att-card-no-photo svg { width: 36px; height: 36px; stroke-width: 1.25; }

.att-card-info {
    padding: 10px 10px 12px;
}

.att-card-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--vanilla);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.att-card-role {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.att-card-time,
.att-card-absent-label {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.att-card-time svg,
.att-card-absent-label svg { width: 12px; height: 12px; flex-shrink: 0; }

.att-ontime { color: var(--success); }
.att-late   { color: var(--warning, #e8a838); }
.att-card-absent-label { color: var(--text-muted); }

/* Lightbox */
.att-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: attFadeIn 0.2s ease;
}

@keyframes attFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.att-lightbox-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    width: 100%;
}

.att-lightbox-name {
    font-size: 14px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.04em;
}

.att-lightbox-img {
    width: 100%;
    border-radius: var(--radius-lg);
    object-fit: contain;
    max-height: 70vh;
}

.att-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.att-lightbox-close svg { width: 16px; height: 16px; }

/* Cleanup modal note */
.att-cleanup-note {
    background: rgba(197,165,114,0.08);
    border: 1px solid rgba(197,165,114,0.2);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

.att-cleanup-note svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; color: var(--accent); }

/* Skeleton */
.att-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px;
}

.att-skel-hero {
    height: 240px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    animation: attPulse 1.4s ease-in-out infinite;
}

.att-skel-btn {
    height: 52px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    animation: attPulse 1.4s ease-in-out infinite 0.2s;
}

.att-skel-card {
    height: 180px;
    animation: attPulse 1.4s ease-in-out infinite;
}

@keyframes attPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

/* Spin animation for loader */
.spin {
    animation: spinAnim 0.8s linear infinite;
    display: inline-block;
}

@keyframes spinAnim {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
