/* Aptek-Depo Hesabat Sistemi */
:root {
    --brand: #157347;
    --brand-dark: #0b5e3a;
    --brand-light: #d1e7dd;
    --bg: #f5f6f7;
    --sidebar-w: 250px;
    --sidebar-bg: #ffffff;
    --border: #e4e7eb;
    --text: #1f2d3d;
    --muted: #6c757d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}

.sidebar .brand {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--brand-dark);
}
.sidebar .brand .logo {
    width: 34px; height: 34px;
    background: var(--brand);
    color: #fff;
    border-radius: 9px;
    display: grid; place-items: center;
    font-size: 18px;
}
.sidebar nav { flex: 1; overflow-y: auto; padding: 12px 0; }

.sidebar .nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    color: #4a5568;
    font-size: 15px;
    border-left: 3px solid transparent;
}
.sidebar .nav-link:hover { background: #f3f6f4; color: var(--brand-dark); }
.sidebar .nav-link.active {
    background: var(--brand-light);
    color: var(--brand-dark);
    border-left-color: var(--brand);
    font-weight: 600;
}
.sidebar .nav-link i { font-size: 17px; width: 20px; text-align: center; }

.sidebar .nav-sub {
    padding-left: 55px;
    font-size: 13.5px;
}

.sidebar .sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--muted);
}

/* ---------- Main ---------- */
.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 22px;
    position: sticky; top: 0; z-index: 1030;
    gap: 14px;
}
.topbar .page-title { font-weight: 600; font-size: 16px; flex: 1; }

.content {
    padding: 24px 26px;
    flex: 1;
}

/* ---------- Cards ---------- */
.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    background: #fff;
}
.card .card-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 14px 18px;
}

.stat-card { position: relative; overflow: hidden; }
.stat-card .icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: grid; place-items: center;
    font-size: 20px;
    color: #fff;
}
.stat-card .stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { color: var(--muted); font-size: 13px; }

.icon-green { background: var(--brand); }
.icon-teal { background: #0dcaf0; }
.icon-purple { background: #6f42c1; }
.icon-orange { background: #fd7e14; }
.icon-red { background: #e53e3e; }
.icon-blue { background: #2563eb; }
.icon-gray { background: #6c757d; }

/* ---------- Tables ---------- */
.table { margin-bottom: 0; font-size: 14px; }
.table thead th {
    background: #f8faf9;
    color: #51606e;
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.table tbody td { vertical-align: middle; border-color: #eef1f0; }
.table > :not(caption) > * > * { padding: .6rem .75rem; }

/* ---------- Forms ---------- */
.form-label { font-size: 13.5px; font-weight: 600; color: #374151; }
.form-control, .form-select { font-size: 14px; }
.is-invalid ~ .invalid-feedback { display: block; }

/* ---------- Buttons ---------- */
.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.btn-brand:hover, .btn-brand:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}
.btn-outline-brand { border-color: var(--brand); color: var(--brand); }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }

/* ---------- Alerts flash ---------- */
.flash-alert { position: fixed; top: 14px; right: 14px; z-index: 2000; min-width: 300px; }

/* ---------- Mobile ---------- */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1035;
}
.sidebar-backdrop.show { display: block; }

@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 30px rgba(0,0,0,.25); }
    .main { margin-left: 0; }
    .content { padding: 16px; }
}

/* ---------- Table responsive ---------- */
.table-responsive { overflow-x: auto; }

/* ---------- Print ---------- */
@media print {
    .sidebar, .topbar, .no-print, .pagination, .card-header .no-print { display: none !important; }
    .main { margin-left: 0; }
    .content { padding: 0; }
    body { background: #fff; }
    .card { border: none; box-shadow: none; }
    .card-header { background: #fff !important; }
    .table thead th { background: #f0f0f0 !important; }

    .print-only { display: block !important; }
    .print-only-block { display: block !important; }
}

.print-only, .print-only-block { display: none; }

/* ---------- Login ---------- */
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #e8f5ef 0%, #f5f6f7 100%);
    padding: 20px;
}
.login-card { width: 100%; max-width: 400px; }
.login-title { color: var(--brand-dark); font-weight: 700; }

/* ---------- Audit ---------- */
.audit-label { font-size: 12px; }
code { background: #f1f3f5; padding: 2px 6px; border-radius: 5px; font-size: 12px; }

/* ---------- Others ---------- */
.cursor-pointer { cursor: pointer; }
.required::after { content: " *"; color: var(--brand); }
.text-danger-note { color: #e53e3e; }

.small-note { font-size: 12.5px; color: var(--muted); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state i { font-size: 44px; opacity: .4; }

.filter-bar { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 18px; }

.stat-sub { font-size: 12.5px; color: var(--muted); }