:root {
    --primary: #FF9F1C;
    --secondary: #FFBF69;
    --success: #22c55e;
    --danger: #FF6B6B;
    --warning: #FFD93D;
    --dark: #2d3748;
    --light: #FFE8D6;
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
    --card-bg: rgba(255, 232, 214, 0.95);
    --shadow: 0 10px 25px rgba(255, 159, 28, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #FFE8D6 0%, #FFBF69 50%, #FF9F1C 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--dark);
    font-weight: 400;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
        max-width: 100%;
    }
}

header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 24px;
    border-radius: 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(255, 159, 28, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-wrap: wrap;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .user-info {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}

.app-logo {
    height: 32px;
    width: auto;
    cursor: pointer;
}

.login-logo {
    height: 48px;
    margin-bottom: 20px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #FF9F1C, #CB997E);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.user-info {
    font-size: 14px;
}

.logout-btn {
    color: var(--danger);
    text-decoration: none;
    margin-left: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: rgba(205, 92, 92, 0.1);
    color: var(--danger);
}

.badge-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.badge-actions:has(.single-btn) {
    grid-template-columns: 1fr;
    justify-items: center;
}

.badge-actions:has(.badge-btn:nth-child(2):last-child) {
    grid-template-columns: 1fr 1fr;
    max-width: 600px;
}

.single-btn {
    max-width: 400px;
    width: 100%;
}

@media (max-width: 768px) {
    .badge-actions {
        gap: 15px;
        max-width: 100%;
        grid-template-columns: 1fr;
    }
}

.badge-btn {
    padding: 28px 24px;
    border: none;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: white;
    min-height: 120px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    letter-spacing: -0.3px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
}

.badge-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.badge-btn:hover::before {
    left: 100%;
}

@media (max-width: 768px) {
    .badge-btn {
        min-height: 80px;
        font-size: 16px;
        padding: 20px 15px;
    }
}

.badge-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.12);
}

.badge-btn:active {
    transform: translateY(-2px) scale(0.98);
    transition: all 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.badge-in {
    background: linear-gradient(135deg, var(--success), #16a34a);
}

.badge-out {
    background: linear-gradient(135deg, var(--danger), #E55555);
}

.badge-wfh {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.badge-btn:active {
    transform: scale(0.95);
}

.quick-stats {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    box-shadow: 0 8px 32px rgba(255, 159, 28, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .quick-stats {
        max-width: calc(100vw - 30px);
        padding: 15px;
        gap: 15px;
        margin-left: 0;
        margin-right: 0;
        border-radius: 16px;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat {
        padding: 5px;
        min-width: 0;
        overflow: hidden;
    }
    
    .stat-value {
        font-size: 16px;
        word-break: break-word;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .stat-label {
        font-size: 12px;
    }
}

.main-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    max-width: 1000px;
    margin: 0 auto;
}

.main-nav:has(a:nth-child(4):last-child) {
    grid-template-columns: repeat(4, 1fr);
    max-width: 800px;
}

.main-nav:has(a:nth-child(3):last-child) {
    grid-template-columns: repeat(3, 1fr);
    max-width: 600px;
}

@media (max-width: 768px) {
    .main-nav {
        grid-template-columns: 1fr;
        gap: 10px;
        max-width: 100%;
    }
    
    .profile-form {
        padding: 20px;
        margin: 0 15px 30px;
    }
}

.nav-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 18px;
    border-radius: 16px;
    text-decoration: none;
    text-align: center;
    color: var(--dark);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 16px rgba(255, 159, 28, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: -0.2px;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.login-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .login-card {
        padding: 30px 20px;
        margin: 0 15px;
    }
}

.google-btn {
    background: #4285f4;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-top: 20px;
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .badge-btn {
        min-height: 70px;
        font-size: 16px;
    }
    
    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
footer {
    font-size: 12px;
    color: #6b7280;
}

.border-top {
    border-top: 1px solid rgba(255,255,255,0.2) !important;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}
/* History Page Styles */
.history-list {
    max-width: 600px;
    margin: 0 auto;
}

.history-item {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
}

.event-type {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.event-type.in {
    background: var(--success);
    color: white;
}

.event-type.out {
    background: var(--danger);
    color: white;
}

.event-time {
    font-weight: 500;
    flex: 1;
}

.event-location {
    font-size: 12px;
    color: #6b7280;
}

/* Analytics Page Styles */
.analytics-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.big-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 10px 0;
}

.alert {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 10px;
}

.alert.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.alert.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.daily-breakdown {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.day-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.day-date {
    min-width: 120px;
    font-weight: 500;
}

.day-hours {
    min-width: 60px;
    font-weight: 600;
    color: var(--primary);
}

.day-bar {
    flex: 1;
    height: 8px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

/* Manual Entry Styles */
.manual-form {
    max-width: 400px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.submit-btn {
    width: 100%;
    background: var(--gradient);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.message {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .history-item {
        flex-wrap: nowrap;
        overflow: hidden;
        padding: 12px;
        gap: 8px;
    }
    
    .event-time {
        font-size: 13px;
        white-space: nowrap;
        min-width: 0;
    }
    
    .event-location,
    .device-info {
        font-size: 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .edit-btn {
        padding: 4px 8px;
        font-size: 10px;
        flex-shrink: 0;
    }
}
    
    .analytics-stats {
        grid-template-columns: 1fr;
    }
    
    .day-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .day-bar {
        width: 100%;
    }
}
.live-label {
    background: var(--success);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 700;
    margin-left: 8px;
    animation: pulse 2s infinite;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
/* Edit functionality styles */
.edit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: auto;
}

.edit-btn:hover {
    background: var(--secondary);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--dark);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.form-actions button:first-child {
    background: var(--success);
    color: white;
}

.form-actions button:nth-child(2) {
    background: var(--danger);
    color: white;
}

.form-actions button:last-child {
    background: #6b7280;
    color: white;
}
.map-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 16px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.map-link:hover {
    transform: scale(1.2);
}

.no-gps,
.no-device {
    color: #ef4444;
    font-size: 16px;
    opacity: 0.7;
}
.device-info {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

.no-device {
    color: #9ca3af;
    font-style: italic;
}
.badge-actions:has(.badge-btn[style*="display: none"]) {
    justify-items: center;
}

.badge-btn[style*="grid-column"] {
    width: 100%;
    max-width: 400px;
}
.time-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.time-item {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 24px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(255, 159, 28, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.time-item.in {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.time-item.out {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.4);
}

.time-label {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.time-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.5px;
}
.period-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.period-tab {
    padding: 8px 16px;
    border: 1px solid rgba(255, 159, 28, 0.3);
    background: transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.period-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.chart {
    display: flex;
    align-items: end;
    gap: 4px;
    height: 200px;
    padding: 20px 0;
    justify-content: center;
}

.chart-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 30px;
}

.bar {
    background: linear-gradient(to top, var(--primary), var(--secondary));
    width: 100%;
    min-height: 4px;
    border-radius: 2px 2px 0 0;
    transition: all 0.3s ease;
}

.bar:hover {
    filter: brightness(1.1);
}

.bar-label {
    font-size: 12px;
    margin-top: 5px;
    color: #6b7280;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.profile-form {
    max-width: 500px;
    margin: 0 auto 30px;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}

.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 0;
}

.toggle-label {
    font-weight: 500;
    color: var(--dark);
    flex: 1;
    text-align: left;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
}

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

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

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

input:checked + .toggle-slider {
    background-color: var(--primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

@media (max-width: 768px) {
    .toggle-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .toggle-label {
        text-align: center;
    }
}

.safe-times {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    box-shadow: 0 8px 32px rgba(255, 159, 28, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .safe-times {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
}

.safe-time {
    text-align: center;
}

.safe-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 5px;
    font-weight: 500;
}

.safe-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.safe-note {
    display: block;
    font-size: 10px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.wfh-type-select {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    font-size: 16px;
    margin-top: 10px;
    background: white;
}