/* =====================================================================
   MUHASEBE — Kurumsal tema
   Bootstrap 5 üzerine ince bir katman: koyu lacivert mürekkep (ink),
   koyu yeşil vurgu, defter/fiş estetiği. Parasal kolonlar tabular-nums
   ile hizalanır; fiş numaraları monospace yazılır.
   ===================================================================== */

:root {
    --mh-ink:        #16283e;   /* kenar çubuğu, başlıklar */
    --mh-ink-2:      #1f3552;   /* hover durumu */
    --mh-ink-3:      #0f1c2d;   /* aktif menü */
    --mh-accent:     #1d6f5c;   /* birincil eylem (koyu yeşil) */
    --mh-accent-2:   #17594a;
    --mh-surface:    #f4f6f8;   /* uygulama zemini */
    --mh-card:       #ffffff;
    --mh-line:       #dde3ea;   /* ayraçlar */
    --mh-text:       #24303c;
    --mh-muted:      #64748b;
    --mh-danger:     #b3352c;   /* alacak/eksi */
    --mh-debt:       #175e91;   /* borç kolonu mavisi */
    --mh-radius:     6px;
}

html, body { height: 100%; }

body {
    background: var(--mh-surface);
    color: var(--mh-text);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .925rem;
}

/* ------------------------------------------------------------------ */
/* Yerleşim: sol menü + üst bar + içerik                                */
/* ------------------------------------------------------------------ */
.mh-app { min-height: 100vh; display: flex; flex-direction: column; }

/* --- Üst çubuk: marka + yatay modül menüsü + kullanıcı --- */
.mh-topnav {
    display: flex;
    align-items: stretch;
    background: var(--mh-ink);
    color: #c7d2de;
    min-height: 52px;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.mh-topbrand {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0 1.15rem;
    color: #fff;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: .95rem;
    text-decoration: none;
    border-right: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.mh-topbrand .bi { color: #6ea896; font-size: 1.15rem; }
.mh-brand-logo { height: 32px; max-width: 170px; object-fit: contain; display: block; }
.mh-brand-name { white-space: nowrap; }

/* Yatay modül şeridi — overflow YOK: açılır menü aşağı taşabilmeli
   (overflow-x:auto, overflow-y'yi de auto yapıp menüyü kırpardı). */
.mh-menubar { display: flex; align-items: stretch; flex: 1; min-width: 0; flex-wrap: wrap; }
.mh-menu { position: relative; display: flex; align-items: stretch; }

.mh-menu-trigger {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: 0 .72rem;
    height: 100%;
    background: transparent;
    border: 0;
    color: #c7d2de;
    font-size: .84rem;
    white-space: nowrap;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}
a.mh-menu-trigger { text-decoration: none; }
.mh-menu-trigger:hover { background: var(--mh-ink-2); color: #fff; }
.mh-menu-trigger .bi:first-child { color: #8fa3b8; font-size: .95rem; }
.mh-menu-caret { font-size: .55rem; color: #7d8ea1; margin-left: .1rem; transition: transform .15s ease; }
.mh-menu.active .mh-menu-trigger { color: #fff; border-bottom-color: var(--mh-accent); }
.mh-menu.active .mh-menu-trigger .bi:first-child { color: #6ea896; }
.mh-menu.open .mh-menu-trigger { background: var(--mh-ink-3); color: #fff; }
.mh-menu.open .mh-menu-caret { transform: rotate(180deg); }

/* Açılır (mega) menü: hover ya da .open ile görünür */
.mh-menu-drop {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    grid-template-columns: repeat(var(--mh-cols, 1), minmax(190px, 1fr));
    gap: .25rem 1.25rem;
    background: var(--mh-card);
    border: 1px solid var(--mh-line);
    border-top: 2px solid var(--mh-accent);
    border-radius: 0 0 var(--mh-radius) var(--mh-radius);
    box-shadow: 0 12px 30px rgba(15,28,45,.18);
    padding: .85rem 1rem;
    z-index: 30;
}
.mh-menu:hover .mh-menu-drop,
.mh-menu.open .mh-menu-drop { display: grid; }
.mh-menu-col { min-width: 0; }
.mh-menu-colhead {
    font-size: .64rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mh-muted);
    padding: .3rem .5rem .25rem;
    border-bottom: 1px solid var(--mh-line);
    margin-bottom: .2rem;
}
.mh-menu-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .4rem .5rem;
    color: var(--mh-text);
    text-decoration: none;
    font-size: .85rem;
    border-radius: 4px;
    white-space: nowrap;
}
.mh-menu-link:hover { background: var(--mh-surface); color: var(--mh-ink); }
.mh-menu-link.active { background: #e8f1ee; color: var(--mh-accent); font-weight: 600; }
.mh-menu-link .bi { width: 1rem; text-align: center; color: #90a0b0; font-size: .9rem; }
.mh-menu-link.active .bi { color: var(--mh-accent); }

/* Sağ üst: dönem + kullanıcı + çıkış */
.mh-topright { display: flex; align-items: center; gap: .85rem; padding: 0 1.15rem; flex-shrink: 0;
               border-left: 1px solid rgba(255,255,255,.08); }
.mh-topright .workspace-badge {
    font-size: .78rem;
    color: #c7d2de;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--mh-radius);
    padding: .22rem .6rem;
    white-space: nowrap;
}
.mh-user { color: #c7d2de; text-decoration: none; font-size: .82rem; white-space: nowrap; }
.mh-user:hover { color: #fff; }

.mh-content { padding: 1.5rem; flex: 1; }

/* Sayfa başlığı: sol başlık, sağ birincil eylem */
.mh-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}
.mh-page-head h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--mh-ink);
    margin: 0;
    letter-spacing: .01em;
}
.mh-page-head .breadcrumb { margin: 0; font-size: .78rem; }

/* Otomatik tamamlama (autocomplete) açılır listesi */
.mh-ac { position: relative; }
.mh-ac-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 40;
    max-height: 260px;
    overflow-y: auto;
    background: var(--mh-card);
    border: 1px solid var(--mh-line);
    border-top: 2px solid var(--mh-accent);
    border-radius: 0 0 var(--mh-radius) var(--mh-radius);
    box-shadow: 0 10px 24px rgba(15,28,45,.16);
}
.mh-ac-item { padding: .4rem .7rem; font-size: .85rem; cursor: pointer; white-space: nowrap;
              overflow: hidden; text-overflow: ellipsis; }
.mh-ac-item:hover, .mh-ac-item.active { background: #e8f1ee; color: var(--mh-accent); }

/* ------------------------------------------------------------------ */
/* Kartlar ve tablolar: defter estetiği                                 */
/* ------------------------------------------------------------------ */
.card {
    border: 1px solid var(--mh-line);
    border-radius: var(--mh-radius);
    box-shadow: 0 1px 2px rgba(22,40,62,.05);
}
.card-header {
    background: #fbfcfd;
    border-bottom: 1px solid var(--mh-line);
    font-weight: 600;
    font-size: .875rem;
    color: var(--mh-ink);
}

/* Defter çift çizgisi: tablo başlığının altında klasik muhasebe cetveli */
.table thead th {
    background: #fbfcfd;
    color: var(--mh-ink);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 3px double #b9c4d0 !important;
    white-space: nowrap;
}
.table { font-size: .875rem; margin-bottom: 0; }
.table td { vertical-align: middle; }
.table tbody tr:hover { background: #f6f9fb; }

/* Parasal kolonlar: hizalı rakamlar, sağa yaslı */
.num, td.num, th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.num-debt   { color: var(--mh-debt); }
.num-credit { color: var(--mh-danger); }

/* Fiş/belge numarası */
.receipt-no {
    font-family: Consolas, "Courier New", monospace;
    font-size: .84rem;
    color: var(--mh-ink);
    background: var(--mh-surface);
    border: 1px solid var(--mh-line);
    border-radius: 4px;
    padding: .05rem .4rem;
}

/* ------------------------------------------------------------------ */
/* Düğmeler: kurumsal, gösterişsiz                                     */
/* ------------------------------------------------------------------ */
.btn { border-radius: var(--mh-radius); font-size: .875rem; }
.btn-primary {
    background: var(--mh-accent);
    border-color: var(--mh-accent);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--mh-accent-2);
    border-color: var(--mh-accent-2);
}
.btn-outline-secondary { color: var(--mh-text); border-color: #c3ccd6; }
.btn-outline-secondary:hover { background: var(--mh-surface); color: var(--mh-ink); border-color: #b0bcc9; }

a { color: var(--mh-accent); }
a:hover { color: var(--mh-accent-2); }

/* Formlar */
.form-label { font-size: .8rem; font-weight: 600; color: var(--mh-ink); margin-bottom: .25rem; }
.form-control, .form-select {
    border-radius: var(--mh-radius);
    border-color: #c3ccd6;
    font-size: .9rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--mh-accent);
    box-shadow: 0 0 0 .2rem rgba(29,111,92,.15);
}
.required-mark { color: var(--mh-danger); }

/* Durum rozetleri */
.badge-active   { background: #e5f2ee; color: var(--mh-accent); border: 1px solid #bcd9d0; }
.badge-passive  { background: #f1f3f5; color: var(--mh-muted);  border: 1px solid var(--mh-line); }
.badge-danger   { background: #fbeae8; color: var(--mh-danger); border: 1px solid #f0c2bd; }

/* Bakiye çipleri (Borç/Alacak) */
.balance-chip {
    display: inline-flex;
    align-items: baseline;
    gap: .4rem;
    border: 1px solid var(--mh-line);
    border-radius: var(--mh-radius);
    padding: .35rem .75rem;
    background: var(--mh-card);
    font-variant-numeric: tabular-nums;
}
.balance-chip .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mh-muted); }

/* ------------------------------------------------------------------ */
/* Giriş ekranı                                                        */
/* ------------------------------------------------------------------ */
/* ------------------------------------------------------------------ */
/* Kimlik ekranları (login / forgot / reset / 2FA) — bölünmüş yerleşim   */
/* ------------------------------------------------------------------ */
.auth-body { min-height: 100vh; }
.auth-split { display: flex; min-height: 100vh; }
.auth-side {
    flex: 1.1;
    background: radial-gradient(1200px 600px at 20% 10%, #1f3552 0%, var(--mh-ink) 45%, #0b1420 100%);
    color: #eaf1f8;
    display: flex;
    align-items: center;
    padding: 3rem;
}
.auth-side-inner { max-width: 440px; }
.auth-side-logo { height: 52px; margin-bottom: 2rem; }
.auth-side h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: .01em; margin-bottom: .9rem; }
.auth-side p { color: #a9bbcd; line-height: 1.6; font-size: .95rem; }
.auth-side-contact { display: flex; gap: 1.4rem; margin-top: 2rem; font-size: .82rem; color: #8fa3b8; flex-wrap: wrap; }
.auth-side-contact .bi { color: #6ea896; }

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mh-surface);
    padding: 2rem;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--mh-card);
    border: 1px solid var(--mh-line);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(15,28,45,.12);
    padding: 2.2rem 2rem;
}
.auth-card h1 { font-size: 1.3rem; font-weight: 700; color: var(--mh-ink); margin-bottom: .3rem; }
.auth-card .auth-sub { color: var(--mh-muted); font-size: .88rem; margin-bottom: 1.4rem; }
.auth-card .form-label { font-size: .82rem; font-weight: 600; }
.auth-card .form-control { padding: .6rem .8rem; }
.auth-card .btn-primary { padding: .6rem; font-weight: 600; }
.auth-links { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; font-size: .84rem; }
.auth-links a { color: var(--mh-accent); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
             background: #e8f1ee; color: var(--mh-accent); font-size: 1.5rem; margin-bottom: 1rem; }
/* 2FA kod girişi: büyük ortalanmış */
.auth-code { letter-spacing: .5em; text-align: center; font-size: 1.4rem; font-weight: 600; }

@media (max-width: 860px) { .auth-side { display: none; } }

/* Hata sayfası (403/404/500) — sade, ortalı kart */
.err-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mh-surface);
    padding: 2rem;
}
.err-card {
    text-align: center;
    max-width: 440px;
    background: var(--mh-card);
    border: 1px solid var(--mh-line);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15,28,45,.10);
    padding: 2.6rem 2.2rem;
}
.err-icon {
    width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #e8f1ee; color: var(--mh-accent); font-size: 1.8rem;
}
.err-code { font-size: 3.4rem; font-weight: 800; line-height: 1; color: var(--mh-ink); letter-spacing: -.02em; }
.err-card h1 { font-size: 1.25rem; font-weight: 700; color: var(--mh-ink); margin: .4rem 0 .3rem; }
.err-card p { color: var(--mh-muted); margin-bottom: 1.4rem; }
.err-actions { display: flex; gap: .6rem; justify-content: center; }

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--mh-ink) 0%, #0f1c2d 100%);
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--mh-card);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
    overflow: hidden;
}
.login-card .login-head {
    background: var(--mh-ink);
    color: #fff;
    padding: 1.4rem 1.75rem;
    border-bottom: 3px double #3b5878;   /* defter çizgisi */
}
.login-card .login-head h1 {
    font-size: 1.05rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 600;
    margin: 0;
}
.login-card .login-head small { color: #8fa3b8; letter-spacing: .04em; }
.login-card .login-head .login-logo { height: 46px; max-width: 200px; object-fit: contain; margin-bottom: .6rem; }
.login-card .login-head .login-company { font-size: .92rem; font-weight: 600; letter-spacing: .03em; }
.login-card .login-head .login-contact { color: #8fa3b8; font-size: .78rem; margin-top: .15rem; }
.login-card form { padding: 1.75rem; }

/* Bildirimler */
.alert { border-radius: var(--mh-radius); font-size: .875rem; }

/* Sayfalama */
.pagination { --bs-pagination-active-bg: var(--mh-accent); --bs-pagination-active-border-color: var(--mh-accent); font-size: .85rem; }

/* Küçük ekranlar: üst menü kaydırılabilir, etiketler gizlenip ikon kalır */
@media (max-width: 992px) {
    .mh-topbrand span { display: none; }
    .mh-menu-trigger { padding: 0 .7rem; }
    .mh-topright .workspace-badge, .mh-user span { display: none; }
}

/* Erişilebilirlik: klavye odağı görünür kalsın */
:focus-visible { outline: 2px solid var(--mh-accent); outline-offset: 1px; }

/* Hareket azaltma tercihi */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* Yazdırma: menü ve üst bar gizlenir, içerik tam genişlik */
@media print {
    .mh-topnav, .mh-page-head .btn, .no-print { display: none !important; }
    .mh-content { padding: 0; }
    body { background: #fff; }
}
