/* ==========================================================
   Personel Mesai - Tema
   ========================================================== */
:root {
    --pm-primary: #2563eb;
    --pm-primary-dark: #1d4ed8;
    --pm-primary-soft: #dbeafe;
    --pm-nav: #0f172a;
    --pm-nav-2: #1e293b;
    --pm-bg: #f1f5f9;
    --pm-surface: #ffffff;
    --pm-border: #e2e8f0;
    --pm-text: #0f172a;
    --pm-muted: #64748b;
    --pm-radius: 12px;
    --pm-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .05);

    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --bs-link-color: #2563eb;
    --bs-link-hover-color: #1d4ed8;
    --bs-body-font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-color: #0f172a;
    --bs-border-radius: 8px;
}

html { font-size: 15px; position: relative; min-height: 100%; }
@media (min-width: 1200px) { html { font-size: 15.5px; } }

body {
    background: var(--pm-bg);
    color: var(--pm-text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.55rem; }
hr { border-color: var(--pm-border); opacity: 1; }

/* ---------- Üst menü ---------- */
.app-nav {
    background: linear-gradient(90deg, var(--pm-nav) 0%, var(--pm-nav-2) 100%);
    box-shadow: 0 2px 10px rgba(15, 23, 42, .25);
    padding: .5rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.app-nav .container-fluid { padding-left: 1.25rem; padding-right: 1.25rem; }
.app-nav .navbar-brand {
    display: flex; align-items: center; gap: .6rem;
    color: #fff; font-weight: 700; letter-spacing: .01em;
}
.brand-icon {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(59, 130, 246, .5);
}
.brand-icon svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.app-nav .nav-link {
    color: #cbd5e1 !important;
    font-weight: 500;
    padding: .5rem .9rem !important;
    border-radius: 8px;
    display: flex; align-items: center; gap: .45rem;
    transition: background .15s, color .15s;
}
.app-nav .nav-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-nav .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff !important; }
.app-nav .nav-link.active { background: rgba(59, 130, 246, .22); color: #fff !important; }
.app-nav .navbar-toggler { border-color: rgba(255, 255, 255, .3); }
.app-nav .navbar-toggler-icon { filter: invert(1); }

.user-chip {
    display: flex; align-items: center; gap: .55rem;
    color: #e2e8f0; font-size: .9rem;
}
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff; font-weight: 700; font-size: .85rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-logout {
    color: #e2e8f0; border: 1px solid rgba(255, 255, 255, .25);
    background: transparent; border-radius: 8px; padding: .3rem .8rem; font-size: .85rem;
}
.btn-logout:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ---------- Sayfa iskeleti ---------- */
.app-main { padding-top: 1.5rem; padding-bottom: 3.5rem; }
.app-footer {
    position: absolute; bottom: 0; width: 100%;
    padding: .9rem 0; text-align: center;
    color: var(--pm-muted); font-size: .8rem;
}

/* ---------- Kartlar ---------- */
.card {
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius);
    box-shadow: var(--pm-shadow);
    background: var(--pm-surface);
}
.card-body { padding: 1.1rem 1.25rem; }

/* ---------- Butonlar ---------- */
.btn { border-radius: 9px; font-weight: 500; padding: .45rem 1rem; transition: all .15s; }
.btn-sm { padding: .25rem .65rem; border-radius: 7px; }
.btn-primary {
    --bs-btn-bg: var(--pm-primary); --bs-btn-border-color: var(--pm-primary);
    --bs-btn-hover-bg: var(--pm-primary-dark); --bs-btn-hover-border-color: var(--pm-primary-dark);
    --bs-btn-active-bg: var(--pm-primary-dark); --bs-btn-active-border-color: var(--pm-primary-dark);
    box-shadow: 0 1px 2px rgba(37, 99, 235, .35);
}
.btn-success { box-shadow: 0 1px 2px rgba(25, 135, 84, .3); }
.btn-outline-secondary { --bs-btn-border-color: #cbd5e1; --bs-btn-color: #334155; --bs-btn-hover-bg: #f1f5f9; --bs-btn-hover-color: #0f172a; --bs-btn-hover-border-color: #94a3b8; background: #fff; }
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 .22rem rgba(37, 99, 235, .22);
}

/* ---------- Formlar ---------- */
.form-control, .form-select {
    border-radius: 9px; border-color: #cbd5e1; padding: .5rem .8rem;
}
.form-control:focus, .form-select:focus { border-color: var(--pm-primary); }
.form-label { font-weight: 600; font-size: .88rem; color: #334155; margin-bottom: .3rem; }

/* ---------- Tablolar ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead.table-dark > tr > th,
.table > thead.table-dark th { background: #1e293b; border-color: #1e293b; font-weight: 600; font-size: .82rem; letter-spacing: .03em; text-transform: uppercase; }
.table > :not(caption) > * > * { padding: .65rem .85rem; }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: #f8fafc; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #eff6ff; }
table.table:not(.mesai-grid) { background: #fff; border-radius: var(--pm-radius); overflow: hidden; box-shadow: var(--pm-shadow); }

/* ---------- Uyarılar / modallar ---------- */
.alert { border-radius: 10px; border: 1px solid transparent; }
.alert-light { background: #fff; border-color: var(--pm-border); }
.modal-content { border: 0; border-radius: 14px; box-shadow: 0 20px 50px rgba(15, 23, 42, .25); }
.modal-header { border-bottom-color: var(--pm-border); }
.modal-footer { border-top-color: var(--pm-border); }
.badge { font-weight: 600; padding: .4em .65em; border-radius: 6px; }
.badge.bg-secondary-subtle { background-color: #e2e8f0 !important; color: #334155 !important; }
.badge.bg-success-subtle { background-color: #dcfce7 !important; color: #166534 !important; }
.badge.bg-danger-subtle { background-color: #fee2e2 !important; color: #991b1b !important; }
.badge.rozet-silme { background-color: #fee2e2 !important; color: #991b1b !important; }
.badge.rozet-mesai { background-color: #dbeafe !important; color: #1e40af !important; }
.badge.rozet-ht { background-color: #ffedd5 !important; color: #9a3412 !important; }
.badge.rozet-carsaf { background-color: #f3e8ff !important; color: #6b21a8 !important; }
.badge.rozet-devir { background-color: #dcfce7 !important; color: #166534 !important; }

/* ---------- Sayfa başlığı ---------- */
.page-head {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: .75rem; margin-bottom: 1.1rem;
}
.page-head h2 { margin: 0; }
.page-sub { color: var(--pm-muted); font-size: .9rem; margin: 0; }

/* ---------- Giriş sayfası ---------- */
.auth-wrap { min-height: calc(100vh - 140px); display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 410px; padding: 2rem 2rem 1.75rem; border-radius: 16px; }
.auth-logo {
    width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 1rem;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(59, 130, 246, .4);
}
.auth-logo svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.auth-page { background: radial-gradient(circle at 20% 10%, #dbeafe 0, transparent 45%), radial-gradient(circle at 85% 90%, #e0e7ff 0, transparent 45%), var(--pm-bg); }

/* ---------- Personel kartları ---------- */
.personel-kart { border-left: 0; transition: box-shadow .15s, transform .15s, border-color .15s; }
.personel-kart:hover { box-shadow: 0 8px 22px rgba(37, 99, 235, .18); transform: translateY(-3px); border-color: #93c5fd; }
.kart-avatar {
    width: 40px; height: 40px; border-radius: 11px; flex: 0 0 40px;
    background: linear-gradient(135deg, #dbeafe, #c7d2fe); color: #1d4ed8;
    font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.search-box { position: relative; max-width: 320px; width: 100%; }
.search-box .form-control { padding-left: 2.4rem; }
.search-box svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; fill: none; stroke: var(--pm-muted); stroke-width: 2; stroke-linecap: round; }

/* ---------- Özet kutuları ---------- */
.stat-card { position: relative; overflow: hidden; }
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--stat, var(--pm-primary)); }
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--pm-muted); font-weight: 600; }
.stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1.2; }
.section-title { font-size: 1.05rem; margin: 1.5rem 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.section-title::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--pm-primary); }
.table-light, .table > thead.table-light th { --bs-table-bg: #f1f5f9; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: #475569; }

/* ---------- Çubuk grafikler ---------- */
.bar-row { display: grid; grid-template-columns: 120px 1fr 56px; align-items: center; gap: .6rem; padding: .3rem 0; }
.bar-label { font-size: .85rem; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #e2e8f0; border-radius: 99px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3b82f6, #6366f1); min-width: 2px; }
.bar-fill.alt { background: linear-gradient(90deg, #14b8a6, #0ea5e9); }
.bar-value { text-align: right; font-weight: 600; font-size: .85rem; }

/* ---------- Premium dokunuşlar ---------- */
@keyframes pm-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pm-float { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(30px, -40px, 0) scale(1.12); } }
@keyframes pm-shine { to { background-position: 200% center; } }

body.auth-page { position: relative; overflow-x: hidden; }
body.auth-page::before, body.auth-page::after {
    content: ""; position: fixed; z-index: 0; border-radius: 50%; filter: blur(70px); pointer-events: none;
    animation: pm-float 14s ease-in-out infinite;
}
body.auth-page::before { width: 420px; height: 420px; left: -120px; top: -100px; background: rgba(59, 130, 246, .35); }
body.auth-page::after { width: 480px; height: 480px; right: -140px; bottom: -160px; background: rgba(139, 92, 246, .30); animation-delay: -6s; }
body.auth-page .app-main { position: relative; z-index: 1; }
body.auth-page .app-main::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .04; mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.auth-card {
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .8);
    box-shadow: 0 25px 60px rgba(15, 23, 42, .15);
    animation: pm-rise .7s cubic-bezier(.2, .8, .2, 1) both;
}
.auth-card .auth-logo { animation: pm-rise .7s .12s cubic-bezier(.2, .8, .2, 1) both; }
.auth-card h4 {
    font-size: 1.6rem; font-weight: 750;
    background: linear-gradient(90deg, #0f172a, #2563eb, #7c3aed, #0f172a);
    background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: pm-shine 6s linear infinite;
}
.auth-card form > * { animation: pm-rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.auth-card form > *:nth-child(2) { animation-delay: .15s; }
.auth-card form > *:nth-child(3) { animation-delay: .25s; }
.auth-card form > *:nth-child(4) { animation-delay: .35s; }
.auth-card .btn-primary {
    background: linear-gradient(135deg, #2563eb, #4f46e5); border: 0;
    transition: transform .2s, box-shadow .2s;
}
.auth-card .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(79, 70, 229, .4); }

.kart-oge { animation: pm-rise .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 28ms); perspective: 700px; }
.personel-kart { transform-style: preserve-3d; will-change: transform; }
.personel-kart:hover { transform: translateY(-4px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.personel-kart:hover .kart-avatar { background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; }
.kart-avatar { transition: background .25s, color .25s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Yazdırma ---------- */
@media print {
    header, footer, .no-print, .navbar, .modal, .ctx-menu, .app-nav, .app-footer { display: none !important; }
    body { margin: 0; background: #fff; }
    .container, .container-fluid { max-width: 100% !important; padding: 0 !important; }
    .app-main { padding: 0; }
    .card, table.table:not(.mesai-grid) { box-shadow: none; }
    .mesai-grid-wrapper { max-height: none !important; overflow: visible !important; }
    .sticky-col, .sticky-col-2 { position: static !important; }
    .table { font-size: 9px; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { size: A4 landscape; margin: 8mm; }
}
