/* ==========================================================================
   Apple Design System - Master Theme & Utility Classes
   ========================================================================== */

:root {
    --bg-page: #f5f5f7;
    --bg-card: #ffffff;
    --bg-card-subtle: #fbfbfd;
    --bg-input: #f5f5f7;
    --bg-input-focus: #ffffff;
    --border-color: #e5e5ea;
    --border-subtle: #f2f2f7;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --color-blue: #0071e3;
    --color-blue-hover: #0077ed;
    --sidebar-bg: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.85);
    --shadow-apple: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-float: 0 8px 30px rgba(0, 0, 0, 0.08);
}

html.dark {
    --bg-page: #000000;
    --bg-card: #1c1c1e;
    --bg-card-subtle: #242426;
    --bg-input: #2c2c2e;
    --bg-input-focus: #38383a;
    --border-color: #2c2c2e;
    --border-subtle: #222224;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --color-blue: #2997ff;
    --color-blue-hover: #0071e3;
    --sidebar-bg: #161617;
    --header-bg: rgba(22, 22, 23, 0.85);
    --shadow-apple: 0 4px 24px rgba(0, 0, 0, 0.35);
    --shadow-float: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* Base Body Application */
html, body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, sans-serif;
    letter-spacing: -0.012em;
}

/* Global Fluid Main Content */
main {
    width: 100% !important;
}

main > * {
    width: 100% !important;
    max-width: 100% !important;
}

/* Card Class */
.apple-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-apple);
    border-radius: 24px;
}

/* Floating Auth Card */
.apple-auth-card {
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-float);
    border-radius: 28px;
    padding: 32px 28px;
}

/* Apple Input */
.apple-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid transparent;
    font-size: 14px;
    outline: none;
    transition: all 0.15s ease;
}

.apple-input:focus {
    background-color: var(--bg-input-focus);
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

html.dark .apple-input:focus {
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.2);
}

/* Etiketli giriş alanı (ör. e-posta listesi): içinde input olan kutu, .apple-input ile aynı görünür */
.apple-input-grup {
    width: 100%;
    min-height: 44px;
    padding: 6px 14px;
    border-radius: 12px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid transparent;
    font-size: 14px;
    transition: all 0.15s ease;
}

.apple-input-grup:focus-within {
    background-color: var(--bg-input-focus);
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

html.dark .apple-input-grup:focus-within {
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.2);
}

.apple-input-grup.hatali {
    border-color: #e11d48;
}

/* Apple Primary Button */
.apple-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    border-radius: 12px;
    background-color: #0071e3;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
    transition: all 0.15s ease;
}

.apple-btn-primary:hover {
    background-color: #0077ed;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.35);
}

.apple-btn-primary:active {
    transform: scale(0.98);
}

/* Apple Secondary / Demo Button */
.apple-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 38px;
    border-radius: 10px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.apple-btn-secondary:hover {
    background-color: var(--border-color);
}

/* Active Nav Menu Link with Full Border */
.nav-link-active {
    background-color: rgba(0, 113, 227, 0.09) !important;
    color: #0071e3 !important;
    font-weight: 600 !important;
    border: 2px solid #0071e3 !important;
    box-shadow: 0 2px 10px rgba(0, 113, 227, 0.16) !important;
    text-decoration: none !important;
}

html.dark .nav-link-active {
    background-color: rgba(41, 151, 255, 0.14) !important;
    color: #2997ff !important;
    border: 2px solid #2997ff !important;
    box-shadow: 0 2px 12px rgba(41, 151, 255, 0.22) !important;
    text-decoration: none !important;
}

.nav-link-sub-active {
    background-color: rgba(0, 113, 227, 0.08) !important;
    color: #0071e3 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

html.dark .nav-link-sub-active {
    background-color: rgba(41, 151, 255, 0.12) !important;
    color: #2997ff !important;
    text-decoration: none !important;
}

/* Sol menü, açık tema: "fildişi ve altın" (sıcak kırık beyaz zemin, lacivert yazı, altın şerit). Koyu tema yukarıdaki gibi kalır. */
html:not(.dark) .sol-menu {
    background-color: #faf8f3;
    color: #2b2925;
}

/* Logo şeridi de fildişi (logo şeffaf PNG), altında ince bej çizgi */
html:not(.dark) .sol-menu .sol-menu-ust {
    background-color: #faf8f3;
    border-bottom-color: #ece6d9;
}

html:not(.dark) .sol-menu nav .text-gray-700 {
    color: #3f3b34;
}

html:not(.dark) .sol-menu nav .border-gray-200\/70 {
    border-color: #e2d9c6;
}

/* Açık grup kartı (Listeler vb.) */
html:not(.dark) .sol-menu nav .border-slate-200 {
    border-color: #e7dfcf;
}

html:not(.dark) .sol-menu nav a:hover,
html:not(.dark) .sol-menu nav button:hover {
    background-color: rgba(120, 95, 50, 0.07);
}

html:not(.dark) .sol-menu .nav-link-active {
    background-color: #ffffff !important;
    color: #1f3a5f !important;
    border: 1px solid #e7dfcf !important;
    box-shadow: inset 3px 0 0 #b08d57, 0 1px 3px rgba(60, 45, 20, 0.08) !important;
}

html:not(.dark) .sol-menu .nav-link-sub-active {
    background-color: #f1ebde !important;
    color: #1f3a5f !important;
}

html:not(.dark) .sol-menu .sol-menu-alt {
    background-color: #f4f0e7;
    border-top-color: #ece6d9;
}

/* Hide Scrollbar Utility */
.no-scrollbar::-webkit-scrollbar {
    display: none !important;
}
.no-scrollbar {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* Thin Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 9999px;
}
html.dark ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* Duyuru içeriği: Tailwind başlık ve liste stillerini sıfırladığı için burada geri verilir */
.duyuru-icerik h1, .duyuru-icerik h2, .duyuru-icerik h3 { font-size: 1.05rem; font-weight: 700; margin: 0.4rem 0; }
.duyuru-icerik h4, .duyuru-icerik h5, .duyuru-icerik h6 { font-weight: 700; margin: 0.3rem 0; }
.duyuru-icerik p { margin: 0.25rem 0; }
.duyuru-icerik ul { list-style: disc; padding-left: 1.25rem; margin: 0.25rem 0; }
.duyuru-icerik ol { list-style: decimal; padding-left: 1.25rem; margin: 0.25rem 0; }
.duyuru-icerik a { color: #0071e3; text-decoration: underline; }
html.dark .duyuru-icerik a { color: #2997ff; }
.duyuru-icerik img { max-width: 100%; height: auto; border-radius: 8px; margin: 0.4rem 0; }
.duyuru-icerik blockquote { border-left: 3px solid #d2d2d7; padding-left: 0.75rem; color: var(--text-secondary); }

/* Blazor Reconnect Box */
/* ==========================================================================
   Kurumsal veri tablosu (ortak): sade başlık, ince ayraçlar, sağa hizalı sabit genişlikli rakamlar.
   Kullanım: <div class="data-table-wrap"><table class="data-table">…  Hücre: num, center, muted, strong,
   col-em (vurgulu sütun), val-pos / val-neg / val-ok (değer renkleri). Düğme: data-table-action.
   ========================================================================== */
.data-table-wrap {
    overflow-x: auto;
    position: relative;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px 14px;
    background: #f8f9fb;
    color: #5b6472;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

html.dark .data-table thead th {
    background: #202023;
    color: #9a9aa0;
}

.data-table tbody td {
    padding: 11px 14px;
    white-space: nowrap;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.12s ease;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* SGK mahsubu ile hesaplanan tutarın farklı olduğu satırlar: hafif kırmızı çerçeve (asgari ücret hesaplama kartı) */
.data-table tbody tr.fark-satir td {
    border-top: 1px solid rgba(244, 63, 94, 0.35);
    border-bottom: 1px solid rgba(244, 63, 94, 0.35);
}
.data-table tbody tr.fark-satir td:first-child { border-left: 1px solid rgba(244, 63, 94, 0.35); }
.data-table tbody tr.fark-satir td:last-child { border-right: 1px solid rgba(244, 63, 94, 0.35); }
html.dark .data-table tbody tr.fark-satir td {
    border-top-color: rgba(251, 113, 133, 0.45);
    border-bottom-color: rgba(251, 113, 133, 0.45);
}
html.dark .data-table tbody tr.fark-satir td:first-child { border-left-color: rgba(251, 113, 133, 0.45); }
html.dark .data-table tbody tr.fark-satir td:last-child { border-right-color: rgba(251, 113, 133, 0.45); }

/* Kendi zemin rengi olan satırlar (kırmızı/sarı uyarı satırları, seçili satır: tr üzerinde bg-*) ortak vurgudan
   hariç; onların rengi örtülmez, kendi hover:bg-* sınıfları geçerlidir. */
.data-table tbody tr:not([class*="bg-"]):hover td {
    background: #f5f8fd;
}

html.dark .data-table tbody tr:not([class*="bg-"]):hover td {
    background: #242428;
}

.data-table tfoot td {
    padding: 12px 14px;
    white-space: nowrap;
    font-weight: 700;
    background: #f8f9fb;
    border-top: 1px solid #d2d2d7;
}

html.dark .data-table tfoot td {
    background: #202023;
    border-top-color: #3a3a3c;
}

.data-table .num {
    text-align: right;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.data-table th.num {
    font-family: inherit;
}

/* Sola hizalı kod değerleri (TC, sicil, rapor no, telefon): num gibi sabit genişlikli, ama sağa hizalanmaz */
.data-table .mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.data-table .sans { font-family: inherit; }
.data-table .left { text-align: left; }
.data-table .wrap { white-space: normal; }

/* Yükleniyor / kayıt yok satırı */
.data-table td.empty {
    padding: 48px 14px;
    text-align: center;
    color: var(--text-secondary);
}

.data-table .center { text-align: center; }
.data-table .muted { color: var(--text-secondary); }
.data-table .strong { font-weight: 600; }

.data-table .col-em { background: #fafbfd; }
html.dark .data-table .col-em { background: #1f1f22; }
.data-table thead th.col-em { background: #eef1f6; color: #3d4654; }
html.dark .data-table thead th.col-em { background: #26262a; color: #c7c7cc; }

.data-table .val-pos { color: #4338ca; font-weight: 600; }
.data-table .val-neg { color: #e11d48; font-weight: 600; }
.data-table .val-ok { color: #047857; font-weight: 600; }
html.dark .data-table .val-pos { color: #a5b4fc; }
html.dark .data-table .val-neg { color: #fb7185; }
html.dark .data-table .val-ok { color: #6ee7b7; }

.data-table-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-blue);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.data-table-action:hover {
    background: #eef5ff;
    border-color: #b9d6fb;
}

html.dark .data-table-action:hover {
    background: #1d2a3a;
    border-color: #2f4a6b;
}

/* Çok sütunlu tablolar için sıkı görünüm: normal masaüstünde yatay kaydırma gerektirmez.
   Dar ekranda .data-table-wrap kaydırması devreye girer. */
.data-table-fit {
    font-size: 12px;
}

.data-table-fit thead th {
    padding: 8px 6px;
    font-size: 10px;
    letter-spacing: 0.02em;
    line-height: 1.25;
    white-space: normal;
}

.data-table-fit tbody td,
.data-table-fit tfoot td {
    padding: 8px 6px;
}

.data-table-fit th:first-child,
.data-table-fit td:first-child {
    padding-left: 14px;
}

.data-table-fit th:last-child,
.data-table-fit td:last-child {
    padding-right: 14px;
}

.data-table-fit .data-table-action {
    padding: 4px 8px;
    font-size: 11px;
}

#blazor-error-ui {
    display: none;
}