/* ==========================================
   iOS 26 LIQUID GLASS - REPLICA DESIGN SYSTEM
   ========================================== */

:root {
    /* Base Colors & Gradients */
    --bg-dark: #000000;
    --bg-gradient-start: #1c1c1e;
    --bg-gradient-end: #000000;

    /* Liquid Glass Colors - Hyper Translucent */
    --glass-panel: rgba(30, 30, 30, 0.4);
    --glass-panel-heavy: rgba(40, 40, 40, 0.5);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-light: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);

    /* Accents - Neon Liquid */
    --accent-primary: #0A84FF;
    --accent-gradient: linear-gradient(180deg, #0A84FF 0%, #0056D2 100%);
    --accent-glow: 0 0 20px rgba(10, 132, 255, 0.5);

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(235, 235, 245, 0.6);
    --text-tertiary: rgba(235, 235, 245, 0.3);

    /* Effects */
    --blur-base: 25px;
    --blur-deep: 50px;
    --noise-opacity: 0.03;

    /* Dimensions */
    --radius-screen: 44px;
    /* Curve of the phone structure */
    --radius-panel: 28px;
    --radius-button: 16px;
    --nav-height: 85px;

    /* Spacing */
    --safe-area-top: env(safe-area-inset-top, 47px);
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
    --padding-screen: 20px;
}

/* ==========================================
   RESET & ULTRA-FLUID SCROLL
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    height: 100%;
}

body {
    font-family: 'SF Pro Display', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* Enable smooth scrolling explicitly on body */
    overflow: hidden;
    /* Prevent body scroll, handle in containers */
    height: 100%;
    /* Subtle background gradient mesh */
    background: radial-gradient(circle at 100% 0%, rgba(10, 132, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 0% 100%, rgba(94, 92, 230, 0.15) 0%, transparent 40%),
        var(--bg-dark);
    background-attachment: fixed;
    overscroll-behavior: none;
    /* Prevent pull-to-refresh effects */
}

/* Noise Texture Overlay for that 'Physical' Feel */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: var(--noise-opacity);
    pointer-events: none;
    z-index: 0;
}

/* ==========================================
   CONTAINERS & SCREENS
   ========================================== */

/* Base screen logic - Hidden by default */
.screen {
    display: none !important;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    /* Use dynamic viewport height */
    position: fixed;
    /* Changed from absolute to fixed */
    top: 0;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* Main screen scrolls (Login/Register), App handles itself */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Active screen - Visible */
.screen.active {
    display: flex !important;
    flex-direction: column;
    opacity: 1;
    animation: fadeIn 0.4s ease-out forwards;
}

/* Main app specific styling */
#appScreen {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 20px;
    padding-bottom: 0;
    /* Remove bottom padding, let content handle it */
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* Header must stay put */
/* Header must stay put */
.app-header {
    flex-shrink: 0;
    margin-bottom: 5px;
    /* Minimal margin */
    /* Minimal margin */
    padding: 10px 15px;
    padding-top: max(10px, var(--safe-area-top));
    /* Compact padding */
}

/* Ensure tab visibility is strict */
.tab-content {
    display: none !important;
    flex: 1;
    /* Ensure flex Item */
    width: 100%;
    padding: 0 0 calc(100px + var(--safe-area-bottom)) 0;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}


/* Calendar should scroll smoothly but look clean */
#historicoTab.tab-content {
    overflow-y: auto;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
    /* scrollbar-width: none; Removed for normal scroll */
}

/* Removed ::-webkit-scrollbar hiding rule */

/* Mobile Tweak: Reduce padding if height is limited to avoid scroll */
@media (max-height: 800px) {
    #appScreen {
        padding: 10px;
        /* Tighter screen padding */
    }

    .tab-content {
        padding-bottom: 80px;
        /* reduced from ~130px */
    }
}

.tab-content.active {
    display: flex !important;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================
   GLASS PANELS (The "Liquid" look)
   ========================================== */

.glass-card,
.glass-time-picker,
.app-header {
    background: var(--glass-panel);
    backdrop-filter: blur(var(--blur-base));
    -webkit-backdrop-filter: blur(var(--blur-base));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-panel);
    box-shadow:
        0 8px 32px 0 rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    /* Inner rim light */
    position: relative;
    overflow: hidden;
}

.glass-signature-pad {
    touch-action: none;
    /* Only disable scroll here */
}




/* Specular Highlight (The "Glossy" top edge) */
.glass-card::before,
.glass-time-picker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    opacity: 0.8;
}

/* ==========================================
   LOGIN & REGISTER (Centered Layout)
   ========================================== */

.login-container {
    display: block;
    /* Force block layout for reliable scroll */
    flex: none;
    /* Disable flex item behavior if inherited */
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: var(--padding-screen);
    padding-top: 50px;
    padding-bottom: 80px;
    /* Extra padding for bottom */
    min-height: 100%;
    /* Ensure it fills at least the screen */
    height: auto;
    /* Allow it to grow */
    overflow: visible;
    /* Let the parent .screen handle the scroll */
}

.login-card {
    padding: 30px 20px;
    /* Reduced for mobile */
    background: rgba(30, 30, 30, 0.6);
}

.logo-glass {
    width: 90px;
    height: 90px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    text-align: center;
}

.app-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 17px;
}

/* ==========================================
   INPUTS & FORMS
   ========================================== */

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 4px;
}

.glass-input {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.glass-input:focus-within {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.15);
}

.glass-input input {
    width: 100%;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 17px;
    outline: none;
}

/* ==========================================
   BUTTONS (Liquid Style)
   ========================================== */

.glass-button {
    width: 100%;
    padding: 14px;
    /* Reduced from 18px */
    border-radius: var(--radius-button);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
    cursor: pointer;
    border: none;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    /* Reduced from 16px */
}

.glass-button:active {
    transform: scale(0.96);
}

/* Primary Action - "Liquid Blue" */
.glass-button.primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Secondary Action - "Frosted" */
.glass-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

/* Icon Button (Round/Square for Nav) */
.glass-button.icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    /* Rounded for polish */
    flex-shrink: 0;
    /* Prevent squashing */
}

/* Specific overrides for calendar nav */
.calendar-header .glass-button.icon-btn {
    width: 36px;
    height: 36px;
    margin: 0;
}

/* ==========================================
   APP HEADER & USER
   ========================================== */

.app-header {
    margin: var(--padding-screen);
    margin-top: calc(var(--safe-area-top) + 10px);
    padding: 16px 20px;
    border-radius: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF9F0A, #FF375F);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   CONTENT LAYOUT
   ========================================== */

.app-content {
    padding: 0 var(--padding-screen);
    padding-bottom: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    /* Parent doesn't scroll, children do */
    display: flex;
    flex-direction: column;
}

/* Ensure tab content takes remaining space and scrolls internally */
.tab-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 100px;
    /* Space for nav */
}

/* Redundant tab-content rules removed to fix scroll and overlap */

.content-card {
    padding: 24px;
    margin-bottom: 24px;
    overflow: visible;
    /* Override glass-card overflow:hidden to allow scrolling */
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 30px;
}

/* ==========================================
   TIME PICKER (Large & Tactile)
   ========================================== */

.time-selectors {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Reduced from 20px */
}

.glass-time-picker {
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
}

.time-input {
    font-size: 32px;
    /* Reduced from 42px */
    font-weight: 300;
    padding: 10px;
    /* Reduced form 15px */
    text-align: center;
    width: 100%;
    color: var(--text-primary);
    background: transparent;
    border: none;
    font-family: 'SF Pro Display', sans-serif;
    /* Monospaced numbers preferred if available */
}

/* ==========================================
   FICHAJE LIST (Scrollable Area)
   ========================================== */
.today-fichajes {
    margin-top: 20px;
    max-height: 200px;
    /* Fixed height for scroll */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}


.fichaje-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.fichaje-time {
    font-variant-numeric: tabular-nums;
    font-size: 16px;
    color: var(--text-primary);
}

/* ==========================================
   CALENDAR (Modern Grid)
   ========================================== */

/* ==========================================
   CALENDAR (Responsive Compact Grid)
   ========================================== */

#historicoTab .glass-card.content-card {
    display: flex;
    flex-direction: column;
    padding: 8px;
    margin-bottom: 10px;
    overflow: visible;
    /* Keep visible for calendar */
}

.calendar-header {
    display: flex;
    /* Fix alignment */
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 5px;
    /* Minimal margin */
    width: 100%;
}

#calendarMonth {
    font-size: 16px;
    margin: 0;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(50px, auto);
    /* Changed from minmax(65px, 1fr) */
    gap: 3px;
    margin-bottom: 5px;
    width: 100%;
}

.calendar-header-row,
.calendar-day {
    /* aspect-ratio: 1; REMOVED to allow squash/stretch */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 11px;
    position: relative;
    transition: all 0.3s;

    /* Allow cell to be whatever size the grid dictates */
    width: 100%;
    min-height: 65px;
    /* Ensure tall enough */
}

.legend {
    flex-shrink: 0;
    /* Don't shrink legend */
    margin-top: auto;
    /* Push to bottom if space permits */
    padding-top: 5px;
}

/* Mobile optimizations for small screens */
@media (max-height: 740px) {
    #historicoTab .glass-card.content-card {
        padding: 10px;
    }

    .section-title {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .calendar-grid {
        gap: 2px;
    }

    .calendar-day {
        font-size: 11px;
        border-radius: 6px;
    }

    .calendar-day.header {
        font-size: 10px;
        padding-bottom: 1px;
    }

    .legend {
        margin-top: 5px;
        flex-shrink: 0;
        /* Ensure distinct separation from bottom */
        padding-bottom: 10px;
    }
}

/* ==========================================
   TOAST NOTIFICATION (Floating)
   ========================================== */
.toast {
    position: fixed;
    bottom: calc(100px + var(--safe-area-bottom));
    /* Above the floating nav bar (approx 80px space) */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(40, 40, 40, 0.9);
    padding: 12px 24px;
    border-radius: 50px;
    color: white;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* REDUNDANT BLOCK REMOVED */

/* Mobile optimizations for 16:9 phones or when space is tight */
@media (max-height: 740px) {
    .section-title {
        font-size: 18px;
        margin-bottom: 4px;
        display: none;
        /* Hide title if extremely tight to prioritize calendar */
    }

    .section-subtitle {
        display: none;
        /* Hide subtitle */
    }

    #historicoTab .glass-card.content-card {
        padding: 5px;
        /* Minimal padding */
        padding-bottom: 5px;
    }

    .calendar-grid {
        gap: 2px;
        margin-bottom: 2px;
    }

    .calendar-day {
        font-size: 11px;
        border-radius: 6px;
    }

    .calendar-day.header {
        font-size: 10px;
        padding-bottom: 2px;
        flex: 0 0 auto;
        /* Header doesn't stretch */
        height: 25px;
    }

    .floating-tab-bar {
        bottom: 10px;
        transform: translateX(-50%) scale(0.85);
        /* Smaller dock */
        width: auto;
        /* Let it shrink if needed */
        min-width: 280px;
    }

    .glass-signature-pad.mini {
        height: 50px;
        /* Even smaller signature pads */
    }
}

.calendar-day.header {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 600;
    border-radius: 0;
    padding-bottom: 5px;
}

.calendar-day:not(.header):not(.empty) {
    background: rgba(255, 255, 255, 0.03);
}

.calendar-day.today {
    background: var(--text-primary);
    color: black;
    font-weight: 700;
}

/* Status dots in calendar */
.calendar-day .status-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    margin-top: 2px;
}

.calendar-day.complete .status-dot {
    background-color: #4CAF50;
    box-shadow: 0 0 4px #4CAF50;
}

.calendar-day.missing .status-dot {
    background-color: #FF5252;
    box-shadow: 0 0 4px #FF5252;
}

.calendar-day.future .status-dot {
    background-color: transparent;
}

/* ==========================================
   LEGEND (Clarified)
   ========================================== */
.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    /* Larger for visibility */
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Date Input Styling */
.date-selector-container {
    margin-bottom: 20px;
}

.date-selector-container label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 4px;
}

.date-input-wrapper {
    background: rgba(0, 0, 0, 0.3);
    /* Slightly darker for contrast */
}

.date-input {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 17px;
    font-family: 'SF Pro Display', sans-serif;
    outline: none;
    color-scheme: dark;
    /* Ensures calendar popup is dark mode */
}


.legend-dot.complete {
    background-color: #4CAF50;
    box-shadow: 0 0 5px #4CAF50;
}

.legend-dot.missing {
    background-color: #FF5252;
    box-shadow: 0 0 5px #FF5252;
}

.legend-dot.future {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
}

/* Status dots in calendar */
.calendar-day .status-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    margin-top: 2px;
    /* Colors handled by JS classes */
}

.calendar-day.complete .status-dot {
    background-color: #4CAF50;
    box-shadow: 0 0 4px #4CAF50;
}

.calendar-day.missing .status-dot {
    background-color: #FF5252;
    box-shadow: 0 0 4px #FF5252;
}

.calendar-day.future .status-dot {
    background-color: transparent;
}





/* Indicators below the number */
.day-indicator {
    position: absolute;
    bottom: 6px;
    width: 5px;
    height: 5px;

}

.calendar-day.complete .day-indicator {
    background: #32D74B;
    box-shadow: 0 0 8px #32D74B;
}

.calendar-day.missing .day-indicator {
    background: #FF453A;
    box-shadow: 0 0 8px #FF453A;
}

/* ==========================================
   FLOATING DOCK - Figma Implementation
   ========================================== */

/* ==========================================
   FLOATING DOCK - Pure Liquid Glass
   ========================================== */

/* Compact Form Layout */
.time-input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.time-group-compact {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.time-group-compact label {
    font-size: 12px;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.signatures-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

@media (max-width: 600px) {

    /* Keep 2 columns but reduced gap */
    .signatures-grid {
        gap: 8px;
    }
}

.mini-sig-container {
    margin-top: 0;
    /* Reset */
    display: flex;
    flex-direction: column;
}

/* Base Signature Pad */
.glass-signature-pad {
    background: #FFFFFF;
    /* Pure White */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    touch-action: none;
    /* Disable scroll on pad */
}

.glass-signature-pad canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.glass-signature-pad.mini {
    height: 60px;
    background: #FFFFFF !important;
    /* Force white background for mini pads */
}

/* Mobile optimizations for main signature pad */
@media (max-height: 800px) {
    #signaturePad {
        /* This ID selector might need to be on the CONTAINER class if the canvas is sized by JS */
        /* But CSS can force container height */
    }

    .signature-section {
        margin-top: 5px;
    }

    .signature-section .glass-signature-pad {
        height: 180px;
        /* Reduce from default 300px? Canvas is 300px height attr */
    }
}

@media (max-height: 600px) {
    .signature-section .glass-signature-pad {
        height: 140px;
        /* Even smaller */
    }
}

/* Restore text-btn */
.text-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 12px;
    padding: 5px 0;
    cursor: pointer;
    margin-top: 2px;
    opacity: 0.8;
}

.text-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ==========================================
   FLOATING DOCK - Pure Liquid Glass
   ========================================== */
.floating-tab-bar {
    position: fixed;
    bottom: calc(10px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 290px;
    height: 62px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;

    /* Crystal Clear Glass */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    /* Refractive Borders */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 32px;

    /* Subtle Glow/Shadow */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);

    /* Padding for inner spacing */
    padding: 0;
}

/* Mini Signature Pads */
.mini-sig-container {
    margin-top: 10px;
}

.mini-sig-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: block;
}

.glass-signature-pad.mini {
    height: 60px;
    /* Heavily reduced from 100px to fit screen */
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.text-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 12px;
    padding: 5px 0;
    cursor: pointer;
    margin-top: 2px;
    opacity: 0.8;
}

.text-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

.tabs-container {
    position: relative;
    width: 280px;
    /* Leave some padding margin */
    height: 52px;
    /* Leave some padding margin */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

/* Sliding Indicator - The "Lupa" */
.active-tab-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 5px;
    /* Initial left */
    width: 0;
    /* JS will set width and position */
    height: 54px;
    background: rgba(237, 237, 237, 0.9);
    border-radius: 27px;
    backdrop-filter: blur(10px);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        width 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        left 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 0;
    pointer-events: none;
}

.tab-btn {
    position: relative;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    /* Distribute space evenly */
    height: 100%;
    cursor: pointer;
    z-index: 2;
    padding: 0;

    /* Inactive State */
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.tab-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2px;
    margin-bottom: 2px;
}

.tab-btn span {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro", "Segoe UI", Roboto, sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: -0.1px;
}

/* Active State Styles - when on top of the indicator */
.tab-btn.active {
    color: #0088FF;
    /* Apple Blue */
}

.tab-btn.active svg {
    stroke-width: 2.5px;
    transform: scale(1.05);
}

.tab-btn.active span {
    font-weight: 600;
}

@media (max-width: 380px) {
    .floating-tab-bar {
        transform: translateX(-50%) scale(0.9);
        bottom: 10px;
    }
}

/* ==========================================
   ADMIN & SIGNATURE
   ========================================== */

.admin-stats {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 20px;
    /* Hide scrollbar */
    scrollbar-width: none;
}

.admin-stats::-webkit-scrollbar {
    display: none;
}

.stat-card {
    min-width: 140px;
    padding: 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.employee-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 10px 12px;
    /* Optimized for mobile */
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Removed gap, using margins instead */
}

.download-btn {
    padding: 12px;
    border-radius: 12px;
    background: var(--glass-border-light);
    color: var(--accent-primary);
    border: none;
    font-weight: 600;
}

/* ==========================================
   RESPONSIVE TWEAKS for MOBILE
   ========================================== */

/* Small screens - reduce padding and font sizes */
@media (max-height: 700px) {
    .login-container {
        padding-top: calc(10px + var(--safe-area-top));
        padding-bottom: 20px;
    }

    .login-card {
        padding: 20px 15px;
    }

    .input-group {
        margin-bottom: 16px;
    }

    .app-title {
        font-size: 24px;
    }

    .glass-button {
        padding: 12px;
        margin-bottom: 10px;
    }
}

/* Very small screens */
@media (max-height: 600px) {
    .login-container {
        padding: 15px;
    }

    .logo-glass {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }

    .app-title {
        font-size: 20px;
        margin-bottom: 5px;
    }

    .app-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }
}

/* Mobile width optimizations */
@media (max-width: 400px) {
    #appScreen {
        padding: 15px;
    }

    .floating-tab-bar {
        width: 260px;
        bottom: calc(5px + var(--safe-area-bottom));
    }

    .tab-content {
        padding-bottom: 120px;
    }
}

/* ==========================================
   MODAL - Glass & Blur
   ========================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    padding: 25px;
    border-radius: 20px;
    width: 90%;
    max-width: 350px;
    max-height: 90vh;
    /* Limit height */
    overflow-y: auto;
    /* Enable internal scroll */
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on iOS */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #fff;
}

.modal-body {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
}

.modal-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-btn.confirm {
    background: var(--primary-color);
    color: #fff;
}