/* CU - HR Mobil PWA — premium sihirli tasarım */

:root {
    --purple: #4F46E5;
    --blue: #2E90FA;
    --cyan: #06AED4;
    --pink: #F04438;
    --orange: #F79009;
    --yellow: #EAB308;
    --indigo: #4F46E5;
    --electric: #2E90FA;
    --turquoise: #12B76A;
    --ink: #101828;
    --muted: #667085;
    --grad-primary: linear-gradient(135deg, #6366F1, #8B5CF6);
    --grad-cool: linear-gradient(135deg, #3B82F6, #06B6D4);
    --grad-fresh: linear-gradient(135deg, #10B981, #06B6D4);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; font-family: 'Poppins', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; height: 100%; overscroll-behavior: none; }

body {
    color: var(--ink);
    background: #F7F8FA;
    font-weight: 400;
    user-select: none;
}

.hidden { display: none !important; }

/* ---------- Splash ---------- */
.splash {
    position: fixed; inset: 0; z-index: 100;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
    background: var(--grad-primary);
    color: #fff;
}
.splash-logo {
    width: 88px; height: 88px; border-radius: 26px;
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(10px);
    display: grid; place-items: center;
    font-size: 3rem; font-weight: 800;
    border: 1px solid rgba(255,255,255,0.35);
    animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.splash-name { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.splash-spinner {
    width: 26px; height: 26px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Login ---------- */
.login-screen {
    min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center;
    padding: 2rem 1.6rem calc(2rem + var(--safe-bottom));
}
.login-hero { text-align: center; margin-bottom: 2.2rem; }
.login-logo {
    width: 76px; height: 76px; margin: 0 auto 1rem;
    border-radius: 24px;
    background: var(--grad-primary);
    color: #fff; font-size: 2.5rem; font-weight: 800;
    display: grid; place-items: center;
    box-shadow: 0 18px 40px -12px rgba(124,58,237,0.5);
}
.login-hero h1 { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; }
.login-hero p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.82rem; }
.login-error { color: #be123c; font-size: 0.8rem; text-align: center; font-weight: 600; }
.remember-row {
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 1.1rem;
    font-size: 0.82rem; font-weight: 600; color: var(--ink);
    cursor: pointer;
}
.remember-row input {
    width: 19px; height: 19px;
    accent-color: var(--indigo);
    cursor: pointer;
}

/* ---------- Fields ---------- */
.field { margin-bottom: 1rem; display: flex; flex-direction: column; }
.field label { font-size: 0.74rem; font-weight: 700; margin-bottom: 0.35rem; color: var(--ink); }
.field input, .field select, .field textarea {
    border: 1px solid rgba(124,58,237,0.2);
    background: rgba(255,255,255,0.85);
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 4px rgba(124,58,237,0.15);
}
.field-row { display: flex; gap: 0.7rem; }
.field-row .field { flex: 1; }

/* ---------- Buttons ---------- */
.btn-primary {
    width: 100%;
    border: none; border-radius: 1.1rem;
    background: var(--grad-primary);
    color: #fff; font-weight: 700; font-size: 1rem;
    padding: 1rem;
    box-shadow: 0 14px 34px -10px rgba(124,58,237,0.55);
    cursor: pointer;
    transition: transform 0.18s, filter 0.18s;
}
.btn-primary:active { transform: scale(0.97); filter: saturate(1.2); }
.btn-danger {
    width: 100%;
    border: none; border-radius: 1.1rem;
    background: linear-gradient(135deg, #f43f5e, #ec4899);
    color: #fff; font-weight: 700; font-size: 0.95rem;
    padding: 0.95rem;
    margin-top: 1rem;
    box-shadow: 0 12px 30px -10px rgba(244,63,94,0.5);
    cursor: pointer;
}
.mb { margin-bottom: 1rem; }

/* ---------- Shell / panels ---------- */
.app-shell { min-height: 100vh; }
.tab-panel {
    padding: calc(1.2rem + var(--safe-top)) 1.3rem calc(6.5rem + var(--safe-bottom));
    max-width: 480px; margin: 0 auto;
    animation: fadeUp 0.3s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.panel-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; margin: 0.3rem 0 1.1rem; }

/* ---------- Home ---------- */
.home-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; }
.greet { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.greet-name { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.bell-btn {
    position: relative;
    width: 44px; height: 44px; border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    display: grid; place-items: center;
    color: var(--ink);
    cursor: pointer;
    box-shadow: 0 6px 18px -8px rgba(30,27,75,0.2);
}
.bell-btn svg { width: 20px; height: 20px; }
.bell-dot {
    position: absolute; top: 9px; right: 10px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--pink);
    box-shadow: 0 0 0 2px #fff;
}

.clock-card {
    background: var(--grad-primary);
    border-radius: 1.6rem;
    padding: 1.6rem 1.4rem;
    color: #fff;
    text-align: center;
    box-shadow: 0 22px 50px -15px rgba(124,58,237,0.55);
    margin-bottom: 1.2rem;
    position: relative;
    overflow: hidden;
}
.clock-card::after {
    content: '';
    position: absolute; top: -40%; right: -20%;
    width: 240px; height: 240px; border-radius: 50%;
    background: rgba(255,255,255,0.12);
}
.clock-time { font-size: 3.2rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 0.85rem; opacity: 0.9; margin-top: 0.4rem; font-weight: 600; }
.gps-chip {
    display: inline-flex; align-items: center; gap: 0.45rem;
    margin-top: 0.9rem;
    padding: 0.4rem 0.9rem;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 999px;
    font-size: 0.72rem; font-weight: 600;
    backdrop-filter: blur(8px);
}
.gps-dot { width: 8px; height: 8px; border-radius: 50%; }
.gps-dot.ok { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.gps-dot.wait { background: #fbbf24; animation: pulse 1.2s infinite; }
.gps-dot.err { background: #f87171; }
@keyframes pulse { 50% { opacity: 0.4; } }

.punch-btn {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 0.7rem;
    border: none; border-radius: 1.4rem;
    background: var(--grad-fresh);
    color: #fff; font-size: 1.15rem; font-weight: 800;
    padding: 1.25rem;
    box-shadow: 0 18px 40px -12px rgba(20,184,166,0.55);
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, filter 0.3s;
}
.punch-btn.working {
    background: linear-gradient(135deg, #f43f5e, #ec4899);
    box-shadow: 0 18px 40px -12px rgba(236,72,153,0.55);
}
.punch-btn:disabled { filter: grayscale(0.6) opacity(0.6); cursor: not-allowed; }
.punch-btn:not(:disabled):active { transform: scale(0.97); }
.punch-icon { font-size: 1rem; }
.qr-scan-btn {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    border: none; border-radius: 1.2rem;
    background: var(--grad-cool);
    color: #fff; font-size: 0.98rem; font-weight: 700;
    padding: 0.95rem; margin-top: 0.8rem;
    box-shadow: 0 14px 34px -12px rgba(59,130,246,0.5);
    cursor: pointer; transition: transform 0.18s;
}
.qr-scan-btn:active { transform: scale(0.97); }
.qr-scan-btn svg { width: 20px; height: 20px; }
.punch-status { text-align: center; font-size: 0.78rem; color: var(--muted); margin: 0.7rem 0 1.2rem; min-height: 1.1em; font-weight: 600; }

/* QR tarayıcı katmanı */
.scan-overlay {
    position: fixed; inset: 0; z-index: 95;
    background: rgba(15,12,41,0.96); backdrop-filter: blur(8px);
    display: flex; flex-direction: column; align-items: center;
    padding: calc(1.5rem + var(--safe-top)) 1.3rem calc(2rem + var(--safe-bottom));
    color: #fff;
}
.scan-head {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    font-weight: 700; font-size: 1rem; margin-bottom: 1.5rem;
}
.scan-head button {
    width: 40px; height: 40px; border-radius: 12px; border: none;
    background: rgba(255,255,255,0.15); color: #fff; font-size: 1.2rem; cursor: pointer;
}
#qrReader {
    width: 100%; max-width: 340px; border-radius: 1.5rem; overflow: hidden;
    border: 2px solid rgba(255,255,255,0.25);
}
.scan-msg { margin-top: 1.4rem; font-size: 0.88rem; font-weight: 600; text-align: center; opacity: 0.9; }

.stat-row { display: flex; gap: 0.8rem; margin-bottom: 0.8rem; }
.mini-card {
    flex: 1;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 1.25rem;
    padding: 1rem 1.1rem;
    box-shadow: 0 8px 24px -10px rgba(30,27,75,0.14);
}
.mini-label { font-size: 0.68rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.mini-value { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 0.2rem; }
.mini-value.sm { font-size: 1rem; }

/* ---------- Cards / lists ---------- */
.glass-card {
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 1.25rem;
    padding: 1.1rem 1.2rem;
    box-shadow: 0 8px 24px -10px rgba(30,27,75,0.14);
    margin-bottom: 1rem;
    font-size: 0.88rem;
}
.list-item {
    display: flex; justify-content: space-between; align-items: center; gap: 0.8rem;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 1.1rem;
    padding: 0.95rem 1.1rem;
    margin-bottom: 0.7rem;
    box-shadow: 0 6px 18px -10px rgba(30,27,75,0.12);
    animation: fadeUp 0.3s ease;
}
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 700; font-size: 0.88rem; }
.list-sub { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.btn-ghost-sm {
    padding: 0.35rem 0.7rem; border-radius: 0.7rem; font-size: 0.74rem; font-weight: 600;
    background: rgba(99,102,241,0.08); color: var(--primary, #6366F1);
    border: 1px solid rgba(99,102,241,0.2); cursor: pointer; transition: all 0.14s;
}
.btn-ghost-sm:active { transform: scale(0.96); }
.btn-ghost-sm.danger { background: rgba(244,63,94,0.08); color: #e11d48; border-color: rgba(244,63,94,0.25); }

/* Öz değerlendirme tam ekran */
.sr-overlay { position: fixed; inset: 0; z-index: 60; background: var(--bg, #f7f8fa); display: flex; flex-direction: column; }
.sr-head { display: flex; align-items: center; gap: 12px; padding: 1rem 1.1rem; border-bottom: 1px solid rgba(0,0,0,0.06); background: #fff; }
.sr-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); }
.sr-body { flex: 1; overflow-y: auto; padding: 1rem 1.1rem 1.5rem; }
.sr-foot { padding: 0.9rem 1.1rem; border-top: 1px solid rgba(0,0,0,0.06); background: #fff; }
.sr-comp { background: #fff; border: 1px solid rgba(0,0,0,0.06); border-radius: 14px; padding: 0.9rem 1rem; margin-bottom: 0.7rem; }
.sr-comp .sr-name { font-weight: 700; font-size: 0.9rem; }
.sr-comp .sr-desc { font-size: 0.74rem; color: var(--muted); margin-bottom: 8px; }
.sr-scale { display: flex; gap: 6px; }
.sr-scale button { flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--border, #e5e7eb); background: #fff; font-weight: 700; font-size: 0.95rem; color: var(--muted); cursor: pointer; }
.sr-scale button.on { background: linear-gradient(135deg,#6366F1,#8B5CF6); color: #fff; border-color: transparent; }
.sr-card { background: #fff; border: 1px solid rgba(0,0,0,0.06); border-radius: 14px; padding: 0.9rem 1rem; margin-bottom: 0.6rem; display: flex; justify-content: space-between; align-items: center; }
.pill {
    padding: 0.3rem 0.75rem; border-radius: 999px;
    font-size: 0.68rem; font-weight: 700; white-space: nowrap;
}
.pill.green { background: rgba(20,184,166,0.15); color: #0f766e; }
.pill.amber { background: rgba(245,158,11,0.16); color: #b45309; }
.pill.red { background: rgba(244,63,94,0.13); color: #be123c; }
.pill.indigo { background: rgba(124,58,237,0.14); color: #6d28d9; }
.pill.gray { background: rgba(100,116,139,0.14); color: #475569; }

/* ---------- Profile ---------- */
.profile-head { display: flex; align-items: center; gap: 1rem; }
.profile-avatar {
    width: 62px; height: 62px; border-radius: 20px;
    background: var(--grad-cool);
    color: #fff; font-size: 1.6rem; font-weight: 800;
    display: grid; place-items: center;
    box-shadow: 0 12px 28px -10px rgba(59,130,246,0.5);
    flex-shrink: 0;
}
.profile-name { font-weight: 800; font-size: 1.05rem; }
.profile-sub { font-size: 0.75rem; color: var(--muted); }
.detail-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px dashed rgba(30,27,75,0.08); font-size: 0.82rem; }
.detail-row:last-child { border-bottom: none; }
.detail-row b { font-weight: 700; }
.version-note { text-align: center; color: var(--muted); font-size: 0.7rem; margin-top: 1.2rem; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(0.9rem + var(--safe-bottom));
    width: calc(100% - 1.8rem); max-width: 450px;
    display: flex;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.95);
    border-radius: 1.5rem;
    padding: 0.45rem;
    box-shadow: 0 18px 45px -12px rgba(30,27,75,0.3);
    z-index: 50;
}
.nav-btn {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
    border: none; background: transparent;
    color: var(--muted);
    font-size: 0.6rem; font-weight: 700;
    padding: 0.55rem 0.2rem;
    border-radius: 1.1rem;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-btn svg { width: 21px; height: 21px; }
.nav-btn.active {
    color: #fff;
    background: var(--grad-primary);
    box-shadow: 0 8px 22px -8px rgba(124,58,237,0.55);
}

/* ---------- Toast ---------- */
.toast {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(6.5rem + var(--safe-bottom));
    max-width: 90%;
    background: var(--ink);
    color: #fff;
    padding: 0.8rem 1.3rem;
    border-radius: 1rem;
    font-size: 0.82rem; font-weight: 600;
    box-shadow: 0 14px 40px -10px rgba(30,27,75,0.5);
    z-index: 90;
    animation: fadeUp 0.3s ease;
    text-align: center;
}
.toast.error { background: #be123c; }
.toast.success { background: #0f766e; }
