:root {
    --sidebar-width: 250px;
    --primary: #2c6e49;
    --primary-dark: #1f5235;
    --sidebar-bg: #1e2a38;
    --sidebar-hover: #2c3e50;
}

* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f4f6f9; margin: 0; }

/* ===================== Layout ===================== */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #c8d2dd;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 1040;
    transition: transform .25s ease;
}
.sidebar-brand {
    font-size: 1.35rem; font-weight: 700; color: #fff;
    padding: 1rem 1rem; display: flex; align-items: center; justify-content: center; gap: .5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand i { color: var(--primary); }
.sidebar-brand-logo {
    max-height: 72px; max-width: 100%; width: auto; object-fit: contain;
    background: #fff; padding: 8px 10px; border-radius: 10px;
}
.sidebar-menu { list-style: none; padding: .5rem 0; margin: 0; }
.sidebar-menu a {
    display: flex; align-items: center; gap: .65rem;
    padding: .7rem 1.25rem; color: #c8d2dd; text-decoration: none;
    font-size: .94rem; transition: background .15s, color .15s;
}
.sidebar-menu a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-menu a.active { background: var(--primary); color: #fff; }
.sidebar-menu a i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-subitem a {
    padding-left: 2.2rem;
    font-size: .88rem;
}
.sidebar-subitem a i {
    font-size: .95rem;
    opacity: .9;
}
.menu-label { flex: 1; min-width: 0; }
.menu-alert-badge {
    margin-left: auto;
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 .38rem;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
}
.sidebar-heading {
    padding: .9rem 1.25rem .35rem; font-size: .72rem; text-transform: uppercase;
    letter-spacing: .06em; color: #6c7a89; font-weight: 600;
}

.main-content { flex: 1; margin-left: var(--sidebar-width); min-width: 0; }

.topbar {
    background: #fff; height: 60px; display: flex; align-items: center; gap: .75rem;
    padding: 0 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 1030;
}
.topbar-title { font-size: 1.15rem; font-weight: 600; margin: 0; color: #2c3e50; }
.content { padding: 1.5rem; }

.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1035;
}

/* ===================== Cards ===================== */
.stat-card {
    border: none; border-radius: .75rem; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06); height: 100%;
}
.stat-card .stat-icon { font-size: 1.75rem; opacity: .85; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-card .stat-label { font-size: .82rem; color: #6c757d; }

.card { border: none; border-radius: .75rem; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.card-header { background: #fff; border-bottom: 1px solid #eef0f3; font-weight: 600; }

/* ===================== Tables ===================== */
.table-responsive { border-radius: .5rem; }
.table > :not(caption) > * > * { padding: .65rem .75rem; }
table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: #6c757d; }

/* Buttons touch-friendly */
.btn { border-radius: .5rem; }
.btn-sm { padding: .35rem .6rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.text-primary { color: var(--primary) !important; }
a { color: var(--primary); }

/* ===================== Auth ===================== */
.auth-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1e2a38, #2c6e49); padding: 1rem;
}
.auth-card {
    background: #fff; border-radius: 1rem; padding: 2.25rem; width: 100%; max-width: 410px;
    box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.auth-brand { text-align: center; margin-bottom: 1.75rem; }
.auth-brand i { font-size: 2.75rem; color: var(--primary); }
.auth-brand-logo {
    max-height: 96px; max-width: 280px; width: auto; object-fit: contain;
    margin-bottom: .75rem;
}
.auth-brand h1 { font-size: 1.6rem; font-weight: 700; margin: .35rem 0 .15rem; color: #1e2a38; }
.auth-brand p { color: #6c757d; font-size: .9rem; margin: 0; }
.auth-hint { text-align: center; margin-top: 1.25rem; }

/* ===================== Mobile ===================== */
@media (max-width: 767.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-overlay.show { display: block; }
    .content { padding: 1rem; }

    /* ----- Liste tabloları mobilde kart görünümü ----- */
    .table-responsive { overflow-x: visible; }
    .table-card thead { display: none; }
    .table-card, .table-card > tbody, .table-card > tbody > tr, .table-card > tbody > tr > td { display: block; width: 100%; }
    .table-card > tbody > tr {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: .7rem;
        margin-bottom: .75rem;
        box-shadow: 0 1px 3px rgba(0,0,0,.06);
        overflow: hidden;
    }
    .table-card > tbody > tr > td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        padding: .6rem .9rem;
        border: 0;
        border-bottom: 1px solid #f1f3f5;
        text-align: right;
        min-height: 46px;
    }
    .table-card > tbody > tr > td:last-child { border-bottom: 0; }
    .table-card > tbody > tr > td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        font-size: .8rem;
        text-align: left;
        flex: 0 0 40%;
        white-space: nowrap;
    }
    .table-card > tbody > tr > td[data-label=""]::before { content: none; }
    /* "Kayıt yok" gibi tek hücreli satırlar normal kalsın */
    .table-card > tbody > tr.no-card > td { display: block; text-align: center; color: #6b7280; }
    .table-card > tbody > tr.no-card > td::before { content: none; }
    /* Toplam satırları (tfoot) */
    .table-card tfoot, .table-card tfoot tr, .table-card tfoot td, .table-card tfoot th { display: block; text-align: right; }
}
