:root {
    --c-primary: #4338CA;
    --c-primary-light: #6366F1;
    --c-primary-dark: #312E81;
    --c-bg: #F8FAFC;
    --c-surface: #FFFFFF;
    --c-border: #E2E8F0;
    --c-text: #1E293B;
    --c-text-muted: #64748B;
    --c-success: #059669;
    --c-danger: #DC2626;
    --font: 'Noto Sans TC', -apple-system, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--c-bg);
    color: var(--c-text);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

/* --- App Header --- */
.app-header {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
    color: white;
    padding: 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}
.app-header h1 { font-size: 1.05rem; font-weight: 600; }

/* --- Pay Banner --- */
.pay-banner {
    background: var(--c-primary-dark);
    color: #C7D2FE;
    padding: 1rem;
    text-align: center;
}
.pay-label { font-size: 0.8rem; }
.pay-amount {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 0.15rem;
}

/* --- Login --- */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 2rem;
}
.login-box {
    width: 100%;
    max-width: 320px;
    background: var(--c-surface);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    text-align: center;
}
.login-box .emoji { font-size: 3rem; margin-bottom: 0.75rem; }
.login-box h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.login-box p { font-size: 0.85rem; color: var(--c-text-muted); margin-bottom: 1.25rem; }
.pin-input {
    width: 100%;
    padding: 0.85rem;
    border: 2px solid var(--c-border);
    border-radius: 12px;
    font-size: 1.75rem;
    text-align: center;
    letter-spacing: 0.75em;
    font-family: 'SF Mono', monospace;
    transition: border-color 0.2s;
}
.pin-input:focus {
    outline: none;
    border-color: var(--c-primary-light);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
.login-btn {
    width: 100%;
    padding: 0.85rem;
    background: var(--c-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    cursor: pointer;
    transition: background 0.15s;
}
.login-btn:active { background: var(--c-primary-dark); }

/* --- Shift Cards --- */
.shift-list { padding: 0.5rem; }
.shift-card {
    background: var(--c-surface);
    margin: 0.5rem;
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-left: 4px solid var(--c-primary);
}
.shift-card.completed { border-left-color: var(--c-success); opacity: 0.7; }
.shift-card.clocked_in { border-left-color: #F59E0B; }
.shift-title { font-weight: 600; font-size: 1rem; }
.shift-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 0.4rem 0;
    font-size: 0.85rem;
    color: var(--c-text-muted);
}
.shift-pay {
    font-size: 0.85rem;
    color: var(--c-primary);
    font-weight: 600;
}
.shift-status {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    margin-top: 0.25rem;
}
.status-assigned { background: #EEF2FF; color: var(--c-primary); }
.status-clocked_in { background: #FEF3C7; color: #92400E; }
.status-completed { background: #D1FAE5; color: #065F46; }

/* --- Action Buttons --- */
.shift-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.shift-actions button {
    flex: 1;
    padding: 0.65rem;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
}
.shift-actions button:active { transform: scale(0.97); }
.btn-nav { background: #DBEAFE; color: #1D4ED8; }
.btn-clock { background: #D1FAE5; color: #065F46; }
.btn-clock:disabled { background: #F1F5F9; color: #94A3B8; cursor: not-allowed; }
.btn-done { background: #FEF3C7; color: #92400E; }

/* --- Signature Modal --- */
.sig-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    justify-content: center;
    align-items: flex-end;
    padding: 1rem;
}
.sig-modal.active { display: flex; }
.sig-box {
    background: var(--c-surface);
    padding: 1.5rem;
    border-radius: 20px 20px 16px 16px;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.25s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
}
.sig-box h3 { margin-bottom: 0.75rem; font-size: 1rem; }
.sig-box canvas {
    border: 2px solid var(--c-border);
    border-radius: 12px;
    width: 100%;
    height: 180px;
    touch-action: none;
}
.sig-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.sig-actions button {
    flex: 1;
    padding: 0.65rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--c-text-muted);
}
.empty-state .emoji { font-size: 3rem; margin-bottom: 0.5rem; }

/* --- Date Divider --- */
.date-divider {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--c-text-muted);
    padding: 0.75rem 1rem 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
