/* ============================================================
   SALON YÖNETİM SİSTEMİ — "SCOREBOARD" TEMASI
   Tasarım fikri: spor salonundaki skor tabelası / kronometre
   panelinden ilham alınmıştır. Koyu lacivert zemin üstünde
   amber (turuncu-sarı) LED benzeri rakamlar, veri ağırlıklı
   ekranlarda mono karakterle okunabilirlik sağlar.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    /* Yüzeyler */
    --bg: #f2f3f6;
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --border: #e3e5eb;

    /* Metin */
    --ink: #11131a;
    --ink-soft: #454b59;
    --muted: #8b8f9c;

    /* Lacivert (sidebar / scoreboard zemini) */
    --navy: #0a0d14;
    --navy-2: #151a26;
    --navy-3: #1e2434;
    --navy-line: #262c3d;
    --navy-text: #b8bccb;

    /* Vurgu rengi — enerji / kronometre amber'ı */
    --amber: #f5a623;
    --amber-deep: #c97f0e;
    --amber-soft: #fdf1dd;

    /* Sinyal renkleri (durum rozetleri) */
    --green: #1fa971;
    --green-soft: #e4f7ee;
    --red: #e0483e;
    --red-soft: #fbe8e6;
    --gray-soft: #eceef1;

    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --shadow-sm: 0 1px 2px rgba(10,13,20,0.05);
    --shadow-md: 0 8px 24px rgba(10,13,20,0.08), 0 2px 6px rgba(10,13,20,0.05);

    font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Mobil uygulama hissiyatı: Metin seçimlerini ve gri dokunma efektlerini kapatır */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Kullanıcının metin girmesi gereken alanlarda seçimi tekrar açıyoruz */
input, textarea {
    -webkit-user-select: auto;
    user-select: auto;
}

body {
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--amber-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--navy);
    background-image:
        radial-gradient(circle at 100% 0%, rgba(245,166,35,0.08), transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(245,166,35,0.05), transparent 40%);
    color: var(--navy-text);
    padding: 22px 16px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 22px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--navy-line);
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(155deg, var(--amber), var(--amber-deep));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(245,166,35,0.35);
}

.brand-mark svg { width: 19px; height: 19px; stroke: #17110a; }

.brand-text .name {
    font-family: 'Bebas Neue', 'Inter', sans-serif;
    font-size: 22px;
    letter-spacing: 0.04em;
    color: #fff;
    line-height: 1;
}
.brand-text .sub {
    font-size: 10px;
    letter-spacing: 0.02em;
    color: var(--navy-text);
    opacity: 0.7;
    line-height: 1.3;
    margin-top: 2px;
    max-width: 150px;
}

.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--navy-text);
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-link svg { width: 17px; height: 17px; stroke: currentColor; flex-shrink: 0; opacity: 0.85; }

.nav-link:hover {
    background: var(--navy-2);
    color: #fff;
    text-decoration: none;
}
.nav-link.active {
    background: var(--navy-3);
    color: #fff;
    border-left-color: var(--amber);
}
.nav-link.active svg { opacity: 1; stroke: var(--amber); }

.nav-divider {
    height: 1px;
    background: var(--navy-line);
    margin: 14px 4px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    background: var(--navy-2);
    font-size: 12.5px;
}
.nav-user .avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--navy-3);
    display: flex; align-items: center; justify-content: center;
    color: var(--amber);
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}
.nav-user .who { color: #fff; font-weight: 600; display:block; }
.nav-user a { color: var(--navy-text); font-size: 11.5px; }

.main {
    flex: 1;
    padding: 30px 40px 60px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 26px;
    gap: 16px;
    flex-wrap: wrap;
}
.topbar .eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-bottom: 4px;
    font-weight: 700;
}
.topbar h2 { margin: 0; font-size: 25px; display:flex; align-items:center; gap:10px; }

/* ============================================================
   KARTLAR
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
}

.grid { display: grid; gap: 19px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 25px;}
.grid-2 { grid-template-columns: repeat(2, 1fr); margin-bottom: 25px;}

@media (max-width: 860px) {
    .grid-3, .grid-2 { 
        grid-template-columns: 1fr; 
    }
    
    .layout { 
        flex-direction: column; 
         margin-bottom: 25px;
    }
    
    /* Sidebar genişliğini tam yapıp bağımsız akışa alıyoruz */
    .sidebar { 
        width: 100%; 
        position: relative;
        padding: 122px 16px;
        padding-top: 122px;
        padding-right: 16px;
        padding-bottom: 12px;
        padding-left: 16px;
    }
    
    /* Ana içeriği sidebar'ın altından başlatıp üstten ekstra boşluk veriyoruz */
    .main { 
        padding: 30px 20px 50px 20px; /* Üstten (30px) içeriğe boşluk vererek aşağı kaydırır */
        width: 100%;
    }
}

/* --- Scoreboard istatistik kartı (imza öge) --- */
.scorecard {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--navy-2), var(--navy));
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    color: #fff;
    box-shadow: var(--shadow-md);
}
.scorecard::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        115deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 26px
    );
    pointer-events: none;
}
.scorecard .lbl {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--navy-text);
    font-weight: 700;
    margin-bottom: 10px;
}
.scorecard .num {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 36px;
    line-height: 1;
    color: var(--amber);
    letter-spacing: -0.01em;
    text-shadow: 0 0 18px rgba(245,166,35,0.35);
}
.scorecard .num.small { font-size: 22px; }
.scorecard.is-good .num { color: #4ade9a; text-shadow: 0 0 18px rgba(74,222,154,0.3); }
.scorecard.is-bad .num { color: #f0685f; text-shadow: 0 0 18px rgba(240,104,95,0.3); }

.stat { text-align: left; }
.stat .num { font-size: 30px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.stat .lbl { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-top: 4px; }

/* ============================================================
   TABLOLAR
   ============================================================ */
table { width: 100%; border-collapse: collapse; }
th, td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
}
th {
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10.5px;
    letter-spacing: 0.07em;
    background: var(--surface-2);
}
tbody tr:hover { background: var(--surface-2); }
.progress-table td { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; font-size: 13px; }

/* ============================================================
   ROZETLER (durum ışığı görünümü)
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.badge::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-orange { background: var(--amber-soft); color: var(--amber-deep); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gray { background: var(--gray-soft); color: var(--muted); }

/* ============================================================
   BUTONLAR
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ink);
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease;
}
.btn:hover { background: #262b36; text-decoration: none; color: #fff; }
.btn:active { transform: scale(0.98); }

.btn.btn-accent, form .btn:not(.btn-outline):not(.btn-danger) { background: var(--amber); color: #221703; }
.btn.btn-accent:hover, form .btn:not(.btn-outline):not(.btn-danger):hover { background: var(--amber-deep); color: #221703; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink);
}
.btn-outline:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #c23a31; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }

/* ============================================================
   FORMLAR
   ============================================================ */
form label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 6px;
    margin-top: 15px;
    color: var(--ink-soft);
}
form input, form select, form textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px; /* Mobil klavye açıldığında sayfanın otomatik zoom yapmasını engeller */
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
form input:focus, form select:focus, form textarea:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(245,166,35,0.18);
}
form textarea { min-height: 84px; resize: vertical; }

/* ============================================================
   GİRİŞ EKRANI (APP-LIKE KULLANIM İÇİN İYİLEŞTİRİLDİ)
   ============================================================ */
.login-wrap {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    background-image:
        radial-gradient(circle at 15% 20%, rgba(245,166,35,0.12), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(245,166,35,0.08), transparent 40%);
    /* Çentikli ekranlar için güvenli alan boşluğu */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}
.login-box {
    background: var(--surface);
    padding: 38px 34px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-md);
    box-sizing: border-box;
    margin: 16px;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 26px;
}
.login-brand .brand-mark { width: 40px; height: 40px; }
.login-brand .brand-mark svg { width: 22px; height: 22px; }
.login-brand .name { font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: 0.03em; color: var(--ink); line-height:1; }
.login-brand .sub { font-size: 11px; letter-spacing: 0.01em; color: var(--muted); margin-top: 2px; }

.login-box h1 {
    font-size: 19px;
    margin: 0 0 4px;
    color: var(--ink);
}
.login-box .lede { color: var(--muted); font-size: 13px; margin: 0 0 8px; }

/* reCAPTCHA mobil taşma engelleyici */
.g-recaptcha {
    display: flex;
    justify-content: center;
    overflow: hidden;
}

/* ============================================================
   BİLDİRİMLER
   ============================================================ */
.alert {
    padding: 11px 15px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 16px;
    font-weight: 500;
}
.alert-error { background: var(--red-soft); color: var(--red); }
.alert-success { background: var(--green-soft); color: var(--green); }

/* ============================================================
   QR KUTUSU
   ============================================================ */
.qr-box { text-align: center; padding: 22px; }
.qr-box canvas, .qr-box img {
    margin: 0 auto;
    padding: 14px;
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.muted { color: var(--muted); }
.mt-0 { margin-top: 0; }

#reader { width: 100%; max-width: 420px; margin: 0 auto; border-radius: var(--radius-md); overflow: hidden; }

code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 12.5px;
}

/* ============================================================
   İLERLEME ÇUBUĞU (ölçüm hedefleri için)
   ============================================================ */
.meter { height: 8px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--amber-deep), var(--amber)); border-radius: 999px; }


@media (max-width: 860px) {
    /* Genel Yapı ve Flex Ayarları */
    .grid-3, .grid-2 {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .topbar .btn {
        width: 100%;
        text-align: center;
    }

    /* Tablo Görünümünü Kart Formatına Çevirme */
    .responsive-table, 
    .responsive-table tbody, 
    .responsive-table tr, 
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        background: var(--surface, #fff);
        border: 1px solid var(--border, #e5e7eb);
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 10px 14px;
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px dashed var(--border, #f3f4f6);
        font-size: 13px;
        text-align: right;
    }

    .responsive-table td:last-child {
        border-bottom: none;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted, #6b7280);
        text-align: left;
        padding-right: 10px;
    }

    /* QR Kod Alanı Mobilde Ortalanması */
    .qr-box {
        text-align: center;
    }
    .qr-box #qrcode {
        display: flex;
        justify-content: center;
        margin: 12px 0;
    }
    .qr-box img, .qr-box canvas {
        margin: 0 auto;
    }
}