/* Minimalist Setup */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #fcfcfc;
    color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.container {
    text-align: center;
}

.title {
    font-size: 28px;
    letter-spacing: 3px;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 14px;
    color: #888;
    margin-top: 0;
    margin-bottom: 40px;
}

.prompt {
    font-size: 16px;
    margin-bottom: 20px;
}

/* Button Layout */
.actions {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* The Main Buttons */
.main-btn {
    background-color: #1a1a1a;
    color: #ffffff;
    border: none;
    padding: 14px 20px; 
    font-size: 16px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 180px; 
    box-sizing: border-box; 
}

.main-btn:hover {
    opacity: 0.8;
}

/* The Small 'i' Icon */
.i-btn {
    background-color: transparent;
    border: 1px solid #ccc;
    color: #888;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-family: serif;
    font-style: italic;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.i-btn:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

/* Popup (Modal) Styling */
.modal-bg {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    justify-content: center;
    align-items: center;
}

.modal-box {
    background-color: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    position: relative;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 20px;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

/* --- NEW ADDITIONS FOR LOGIN PAGE --- */

.form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Text Input Boxes */
.input-field {
    width: 260px; 
    padding: 14px 15px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fafafa;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s, background-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: #1a1a1a;
    background-color: #ffffff;
}

.form-btn {
    width: 260px;
    margin-top: 10px;
}

.divider {
    color: #888;
    font-size: 14px;
    margin: 5px 0;
}

.google-btn {
    background-color: #ffffff;
    color: #1a1a1a;
    border: 1px solid #ccc;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    width: 260px;
    box-sizing: border-box;
}

.google-btn:hover {
    border-color: #1a1a1a;
    background-color: #f9f9f9;
}

/* --- NEW ADDITIONS FOR OTP PAGE --- */

.otp-container {
    display: flex;
    gap: 8px; 
    margin-bottom: 10px;
}

/* The 6 Individual Squares */
.otp-field {
    width: 36px;
    height: 46px;
    font-size: 20px;
    font-weight: 600;
    text-align: center; 
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fafafa;
    font-family: inherit;
    transition: border-color 0.2s, background-color 0.2s;
}

/* When clicking a specific block to type */
.otp-field:focus {
    outline: none;
    border-color: #1a1a1a;
    background-color: #ffffff;
}

/* --- NEW ADDITIONS FOR LEADER DASHBOARD --- */

.dashboard-body {
    display: block; 
    height: auto;
    min-height: 100vh;
    background-color: #fcfcfc;
}

.dashboard-content {
    padding: 20px;
    padding-bottom: 80px; 
    text-align: center;
}

/* The Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0 !important;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border-top: 1px solid #eaeaea;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
    padding-bottom: calc(12px + env(safe-area-inset-bottom)); 
    z-index: 9999; 
    transform: translateZ(0); 
    -webkit-transform: translateZ(0);
}

/* Individual Buttons */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #a0a0a0; 
    gap: 4px;
    transition: color 0.2s;
    width: 60px;
}

.nav-item span {
    font-size: 10px;
    font-weight: 500;
}

/* The SVG Icons */
.nav-icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* What the currently selected tab looks like */
.nav-item.active {
    color: #1a1a1a; 
}

/* --- OVERVIEW DASHBOARD LAYOUT --- */

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

.status-section {
    margin-bottom: 35px;
    text-align: left; 
}

/* Professional Subheadings */
.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 15px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* The 5-Column Grid */
.member-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 10px; 
}

/* Base style for all member cards */
.member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 5px;
    border-radius: 8px;
    box-sizing: border-box;
}

/* The initials circle */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.member-card .name {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; 
}

/* --- THEME 1: ACTIVE (Crisp & Solid) --- */
.member-card.present {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.member-card.present .avatar {
    background-color: #1a1a1a;
    color: #ffffff;
}

.member-card.present .name {
    color: #1a1a1a;
}

/* --- THEME 2: PENDING (Ghosted & Dashed) --- */
.member-card.absent {
    background-color: #fafafa;
    border: 1px dashed #d0d0d0;
}

.member-card.absent .avatar {
    background-color: #e8e8e8;
    color: #888888;
}

.member-card.absent .name {
    color: #888888;
}

/* --- ACCESS CODES DASHBOARD --- */

.code-card {
    border-radius: 12px;
    padding: 30px 20px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    transition: transform 0.2s;
}

.code-heading {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    margin: 0;
}

/* THEME 1: SOLID BLACK (For the QR Code) */
.code-card.solid-theme {
    background-color: #1a1a1a;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.qr-placeholder {
    margin-top: 15px;
    padding: 10px;
    background-color: #ffffff; 
    border-radius: 12px;
}

/* THEME 2: GHOST OUTLINE (For the Manual PIN) */
.code-card.ghost-theme {
    background-color: transparent;
    border: 2px dashed #cccccc;
    color: #1a1a1a;
}

.pin-display {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 8px;
    margin: 15px 0 0 0;
    font-family: 'Courier New', Courier, monospace;
}

/* --- ADD STAFF PAGE STYLES --- */

.form-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.input-group {
    width: 100%;
    margin-bottom: 12px;
}

.select-field {
    width: 100%;
    color: #1a1a1a;
    cursor: pointer;
}

.button-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.button-stack .form-btn, 
.button-stack .google-btn {
    width: 100%;
    margin-top: 0;
}

/* --- LIVE FACE SCAN --- */
.face-scan-message {
    min-height: 18px;
    margin: -8px 0 14px;
    color: #888;
    font-size: 12px;
    line-height: 1.45;
}

.face-scan-overlay {
    box-sizing: border-box;
}

/* Directory Section */
.directory-section {
    margin-top: 20px;
}

.search-input {
    width: 100%;
    margin-bottom: 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    padding-left: 38px;
}

.directory-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.directory-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #ffffff;
    border: 1px solid #eaeaea;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: left;
}

.directory-card .avatar {
    margin-bottom: 0;
    background-color: #1a1a1a;
    color: #ffffff;
    flex-shrink: 0;
}

.staff-info {
    display: flex;
    flex-direction: column;
}

.staff-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.staff-role {
    font-size: 12px;
    color: #888888;
}

/* --- RECORDS MODAL & ANIMATIONS --- */
@keyframes popIn {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.animated-modal {
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    width: 300px;
}

.name-list {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.name-item {
    padding: 12px;
    background-color: #fafafa;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.name-item:hover {
    border-color: #1a1a1a;
    background-color: #ffffff;
}

/* --- INDIVIDUAL RECORD PAGE --- */
.analytics-header {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: left;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #333333;
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-label { font-size: 11px; color: #aaaaaa; text-transform: uppercase; letter-spacing: 1px;}
.stat-value { font-size: 18px; font-weight: 600; margin-top: 4px;}

/* Calendar */
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 600;
}

.cal-btn {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #eaeaea;
}

.cal-present { background-color: #1a1a1a; color: #ffffff; border-color: #1a1a1a; }
.cal-absent { background-color: transparent; border: 1px dashed #cccccc; color: #888888; }
.cal-holiday { background-color: #f0f0f0; color: #1a1a1a; font-weight: bold; border-color: #d0d0d0;}

/* --- GLOBAL ROSTER PAGE --- */
.roster-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.roster-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    margin-bottom: 10px;
}

.roster-main {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.roster-name { font-weight: 600; font-size: 15px; color: #1a1a1a; }
.roster-status { font-size: 12px; margin-top: 4px; }
.status-active { color: #28a745; }
.status-pending { color: #888888; }

.roster-rate {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
}

/* --- SETTINGS PAGE STYLES --- */

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

/* Beautiful iOS Style Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e0e0e0;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider {
    background-color: #1a1a1a;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* --- ANALYTICS CALENDAR STYLES --- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #eaeaea;
    background-color: #ffffff;
}

.cal-day.cal-present {
    background-color: #4ade80 !important;
    color: #1a1a1a !important;
    border-color: #4ade80 !important;
}

.cal-day.cal-absent {
    background-color: transparent !important;
    border: 1px dashed #ef4444 !important;
    color: #ef4444 !important;
}

.cal-day.cal-holiday {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border-color: #1a1a1a !important;
}

/* Late Arrival Colors (Subtle Purple) */
.cal-day.cal-late {
    background-color: #f3e8ff !important;
    color: #a855f7 !important;
    border-color: #d8b4fe !important;
}

/* Detailed Tables Styling */
.detailed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.detailed-table th {
    background-color: #1a1a1a;
    color: #fff;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}
.detailed-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eaeaea;
    color: #555;
}
.detailed-table tr:hover td {
    background-color: #f9f9f9;
}

/* Active Clickable Card Hover Animations */
.member-card.clickable-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.member-card.clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Sticky Column for Global Matrix */
.sticky-col {
    position: sticky;
    left: 0;
    background-color: #ffffff;
    z-index: 10;
    border-right: 2px solid #eaeaea !important;
}
.global-history-table th, .global-history-table td {
    padding: 12px 15px;
    min-width: 80px;
}
/* --- SYNC AI WIDGET --- */
#sync-ai-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#sync-ai-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    user-select: none;
    touch-action: none;
}
#sync-ai-button:active { transform: scale(0.95); }

#sync-ai-chat-window {
    width: 320px;
    height: 400px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid #eaeaea;
    margin-bottom: 15px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.sync-chat-header {
    background: #1a1a1a;
    color: #ffffff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sync-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fcfcfc;
}
.sync-msg {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}
.sync-msg.user {
    background: #1a1a1a;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}
.sync-msg.ai {
    background: #e8e8e8;
    color: #1a1a1a;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.sync-chat-input-area {
    display: flex;
    border-top: 1px solid #eaeaea;
    background: #fff;
    padding: 10px;
}
.sync-chat-input-area input {
    flex: 1;
    border: none;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}
.sync-chat-input-area button {
    background: transparent;
    border: none;
    color: #4ade80;
    font-weight: bold;
    cursor: pointer;
    padding: 0 10px;
}

.typing-indicator {
    display: none;
    align-self: flex-start;
    background: transparent;
    padding: 5px;
    gap: 4px;
}
.typing-indicator span {
    width: 6px; height: 6px; background: #888; border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }