/* ==========================================================
   Personel Maaş ve Vardiya Yönetim Sistemi — Genel Stiller
   Mobil öncelikli (mobile-first) tasarım.
   ========================================================== */

:root {
    --brand: #0d6efd;
    --brand-dark: #0a4fb3;
    --bg: #f2f4f8;
    --card-radius: 14px;

    --c-1: #2f80ed;   /* Gündüz */
    --c-2: #4b3f72;   /* Gece */
    --c-A: #27ae60;   /* A Lobi */
    --c-B: #9b51e0;   /* B Lobi */
    --c-H: #17b3a3;   /* Hafta Tatili */
    --c-Y: #f2994a;   /* Yıllık İzin */
}

body {
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #1c2530;
}

/* ---- Navbar ---- */
.app-navbar {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}

/* ---- Login sayfası ---- */
.login-body {
    background: linear-gradient(160deg, #0a4fb3, #2f80ed 60%, #56ccf2);
    min-height: 100vh;
    display: flex;
    align-items: center;
}
.login-wrap {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 16px;
}
.login-card { border-radius: var(--card-radius); }
.login-logo { font-size: 2.4rem; }

/* ---- Kartlar ---- */
.card { border-radius: var(--card-radius); }
.shift-card .card-body { padding: 1rem; }

/* ---- Renk lejandı ---- */
.legend-chip {
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef1f5;
    white-space: nowrap;
}
.chip-1 { background: color-mix(in srgb, var(--c-1) 15%, white); }
.chip-2 { background: color-mix(in srgb, var(--c-2) 15%, white); }
.chip-A { background: color-mix(in srgb, var(--c-A) 15%, white); }
.chip-B { background: color-mix(in srgb, var(--c-B) 15%, white); }
.chip-H { background: color-mix(in srgb, var(--c-H) 15%, white); }
.chip-Y { background: color-mix(in srgb, var(--c-Y) 15%, white); }

/* ---- Takvim / Gün Kutuları (görüntüleme - salt okunur) ---- */
.shift-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.shift-calendar .cal-weekday {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #8a94a3;
    padding-bottom: 2px;
}
.shift-calendar .cal-day {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 0.7rem;
    font-weight: 600;
    background: #eef1f5;
    color: #495363;
}
.shift-calendar .cal-day .num { font-size: 0.7rem; opacity: .8; }
.shift-calendar .cal-day .code { font-size: 0.6rem; }
.shift-calendar .cal-day.empty { background: transparent; }

.cal-day.code-1 { background: color-mix(in srgb, var(--c-1) 22%, white); color: var(--c-1); }
.cal-day.code-2 { background: color-mix(in srgb, var(--c-2) 22%, white); color: var(--c-2); }
.cal-day.code-A { background: color-mix(in srgb, var(--c-A) 22%, white); color: var(--c-A); }
.cal-day.code-B { background: color-mix(in srgb, var(--c-B) 22%, white); color: var(--c-B); }
.cal-day.code-H { background: color-mix(in srgb, var(--c-H) 22%, white); color: var(--c-H); }
.cal-day.code-Y { background: color-mix(in srgb, var(--c-Y) 22%, white); color: var(--c-Y); }

/* ---- "Yazı" modu: AYNI kare kutu tasarımı, sadece içindeki metin değişir ---- */
.shift-calendar.text-mode .cal-day .cal-word {
    font-size: 0.42rem;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    max-width: 100%;
}
@media (min-width: 400px) {
    .shift-calendar.text-mode .cal-day .cal-word { font-size: 0.48rem; }
}
@media (min-width: 576px) {
    .shift-calendar.text-mode .cal-day .cal-word { font-size: 0.58rem; }
}

/* ---- Kod / Yazı anahtarı (switch) ---- */
.cal-switch-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}
.cal-switch-label { transition: color .15s ease; }
.cal-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.cal-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.cal-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cfd7e3;
    border-radius: 999px;
    transition: background .18s ease;
}
.cal-switch-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform .18s ease;
}
.cal-switch input:checked + .cal-switch-slider {
    background: var(--brand);
}
.cal-switch input:checked + .cal-switch-slider::before {
    transform: translateX(20px);
}
.cal-switch input:focus-visible + .cal-switch-slider {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* ---- İstatistik kutuları ---- */
.stat-box {
    background: #f7f9fc;
    border-radius: 10px;
    padding: 10px 6px;
}
.stat-num { font-size: 1.1rem; font-weight: 800; color: var(--brand-dark); }
.stat-label { font-size: 0.65rem; color: #8a94a3; text-transform: uppercase; letter-spacing: .03em; }

/* ---- Manuel hesaplama grid'i (tıklanabilir) ---- */
.manual-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.manual-grid .mday {
    aspect-ratio: 1;
    border-radius: 8px;
    background: #eef1f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    user-select: none;
    border: 2px solid transparent;
    transition: transform .08s ease;
}
.manual-grid .mday:active { transform: scale(0.94); }
.manual-grid .mday .mnum { font-size: 0.65rem; opacity: .7; font-weight: 600; }
.manual-grid .mday.code-1 { background: color-mix(in srgb, var(--c-1) 22%, white); color: var(--c-1); border-color: var(--c-1); }
.manual-grid .mday.code-2 { background: color-mix(in srgb, var(--c-2) 22%, white); color: var(--c-2); border-color: var(--c-2); }
.manual-grid .mday.code-A { background: color-mix(in srgb, var(--c-A) 22%, white); color: var(--c-A); border-color: var(--c-A); }
.manual-grid .mday.code-B { background: color-mix(in srgb, var(--c-B) 22%, white); color: var(--c-B); border-color: var(--c-B); }
.manual-grid .mday.code-H { background: color-mix(in srgb, var(--c-H) 22%, white); color: var(--c-H); border-color: var(--c-H); }
.manual-grid .mday.code-Y { background: color-mix(in srgb, var(--c-Y) 22%, white); color: var(--c-Y); border-color: var(--c-Y); }

/* ---- Sonuç kartları ---- */
.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (min-width: 576px) {
    .result-grid { grid-template-columns: repeat(3, 1fr); }
}
.result-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.result-card .rlabel { font-size: 0.68rem; color: #8a94a3; text-transform: uppercase; letter-spacing: .02em; }
.result-card .rvalue { font-size: 1.05rem; font-weight: 800; color: #1c2530; }
.result-card .rsub { font-size: 0.65rem; color: #8a94a3; margin-top: 2px; }

/* ---- Hero kart: Bankaya Yatacak Net (en öne çıkan rakam) ---- */
.result-hero {
    background: radial-gradient(120% 140% at 0% 0%, #1b8f6f 0%, #0d6efd 55%, #0a4fb3 100%);
    border-radius: 20px;
    padding: 22px 20px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(13,110,253,.28);
    position: relative;
    overflow: hidden;
    text-align: center;
}
.result-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 60% at 100% 100%, rgba(255,255,255,.18), transparent 70%);
}
.rhero-label {
    position: relative;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: .03em;
    color: rgba(255,255,255,.85);
    text-transform: uppercase;
}
.rhero-value {
    position: relative;
    font-size: clamp(2rem, 9vw, 2.6rem);
    font-weight: 900;
    line-height: 1.15;
    margin: 4px 0 6px;
    text-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.rhero-extra {
    position: relative;
    font-size: 0.78rem;
    color: rgba(255,255,255,.85);
    margin-bottom: 14px;
}
.rhero-chips {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.rhero-chip {
    background: rgba(255,255,255,.16);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
}
.rhero-chip strong { font-weight: 800; margin-left: 3px; }

/* ---- Toplam kazanç şeridi (ikincil, hero'nun altında sade) ---- */
.result-total-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #eef4ff;
    border: 1px dashed #b6d0ff;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: #2b4a7a;
}
.result-total-strip strong { font-size: 0.95rem; color: var(--brand-dark); }

/* ---- Geçmiş listesi ---- */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.history-item .hlabel { font-weight: 600; font-size: 0.85rem; }
.history-item .hsource { font-size: 0.65rem; color: #8a94a3; }
.history-item .hamount { font-weight: 800; color: var(--brand-dark); }

/* ---- Önizleme tablosu (admin upload) ---- */
.preview-table input { min-width: 100%; }
