/* ============================================================
   Smart Elephant — Ön Muhasebe UI System
   Brand: Smart Navy #1B3F63 · Coral #FF6B4A
   Fonts: DM Serif Display (headings) · Albert Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Albert+Sans:wght@300;400;500;600;700&display=swap');

/* ─── Design Tokens ──────────────────────────────────────────────────────────── */
:root {
    /* Brand */
    --navy:         #1B3F63;
    --navy-sky:     #2A5F8F;
    --navy-dark:    #142E4A;
    --lemon:        #FAFAC8;
    --offwhite:     #F5F4EE;
    --coral:        #FF6B4A;
    --coral-dark:   #E85A39;
    --sage:         #8FAF7E;
    --sage-dark:    #6E9060;
    --mist:         #D9E8F0;

    /* UI Surfaces */
    --bg:           #F5F4EE;
    --surface:      #FFFFFF;
    --border:       #E4E2D9;
    --border-light: #EEECE4;

    /* Text */
    --text:         #1B3F63;
    --text-lt:      #2A4A6B;
    --text-muted:   #6B7A8D;
    --text-faint:   #A0AABB;

    /* Sidebar */
    --sidebar-w:        240px;
    --sidebar-w-min:    64px;
    --sidebar-bg:       #1B3F63;
        --sidebar-active-bg:rgba(255,107,74,.15);
    --sidebar-active-border: var(--coral);
    --sidebar-active-text: #fff;

    /* Misc */
    --radius:    10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 4px rgba(27,63,99,.07);
    --shadow:    0 4px 20px rgba(27,63,99,.10);
    --shadow-lg: 0 8px 40px rgba(27,63,99,.14);

    /* Fonts */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body:    'Albert Sans', system-ui, -apple-system, sans-serif;
}

/* ─── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-sky); text-decoration: none; }
a:hover { color: var(--navy); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

/* ─── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255,255,255,.1);
    text-decoration: none;
    gap: 10px;
    overflow: hidden;
    min-height: 72px;
    justify-content: center;
    transition: padding 220ms cubic-bezier(.4,0,.2,1);
}
.sidebar.expanded .sidebar-logo { justify-content: flex-start; padding-left: 14px; }
.sidebar-logo { text-decoration: none; }
.sidebar-logo-icon {
    width: 36px; height: 36px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.sidebar-logo-text {
    opacity: 0;
    white-space: nowrap;
    transition: opacity 150ms 50ms;
    display: flex; flex-direction: column;
}
.sidebar.expanded .sidebar-logo-text { opacity: 1; }
.sidebar-logo-name {
    font-family: var(--font-display);
    font-size: .95rem;
    color: #fff;
    font-weight: 400;
    line-height: 1.2;
}
.sidebar-logo-sub {
    font-size: .62rem;
    font-weight: 500;
    color: rgba(255,255,255,.4);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.55);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 150ms, color 150ms, border-color 150ms, padding 220ms cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    white-space: nowrap;
}
.sidebar.expanded .sidebar-link { justify-content: flex-start; padding: 11px 14px; }
.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: #fff;
    border-left-color: var(--sidebar-active-border);
    font-weight: 600;
}
.sidebar-link:hover,
.sidebar-logout:hover { color: inherit; }
.nav-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: .65;
}
.sidebar-link.active .nav-icon { opacity: 1; }
.nav-label {
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms 80ms;
}
.sidebar.expanded .nav-label { opacity: 1; pointer-events: auto; }

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-user {
    padding: 0 4px 8px;
    font-size: .75rem;
    color: rgba(255,255,255,.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 120ms 60ms;
}
.sidebar.expanded .sidebar-user { opacity: 1; }
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    width: 100%;
    padding: 10px 0;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.45);
    font-size: .85rem;
    font-family: var(--font-body);
    transition: background .15s, color .15s, padding 220ms cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    white-space: nowrap;
}
.sidebar.expanded .sidebar-logout { justify-content: flex-start; padding: 10px 14px; }
.sidebar-logout .nav-icon { opacity: .5; }

/* ─── Main Wrap ──────────────────────────────────────────────────────────────── */
.main-wrap {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: margin-left 220ms cubic-bezier(.4,0,.2,1);
}
.main-content {
    flex: 1;
    padding: 32px 36px 48px;
}

/* ─── Mobile Nav Toggle ──────────────────────────────────────────────────────── */
.nav-toggle {
    display: none;
    position: fixed;
    top: 14px; left: 14px;
    z-index: 300;
    width: 40px; height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow);
}

/* ─── Flash / Alert ──────────────────────────────────────────────────────────── */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 500;
    border-left: 4px solid transparent;
    margin-bottom: 20px;
}
.alert-success {
    background: #EEF8EC;
    border-color: var(--sage);
    color: #2D5A24;
}
.alert-danger {
    background: #FFF0ED;
    border-color: var(--coral);
    color: #8B2E1A;
}
.alert-info {
    background: var(--mist);
    border-color: var(--navy-sky);
    color: var(--navy);
}
.alert-warning {
    background: #FFF0EC;
    border-color: var(--coral-dark);
    color: #7A2010;
}

/* Flash inline at top (no margin) */
.alert-flash {
    margin: 0;
    border-radius: 0;
}

/* ─── Auth Pages ─────────────────────────────────────────────────────────────── */
body.no-sidebar {
    background: #1B3F63;
    justify-content: center;
    align-items: center;
    padding: 24px;
}
body.no-sidebar .main-wrap {
    margin-left: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
body.no-sidebar .main-content {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
}
.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 44px 48px;
    width: 100%;
    max-width: 440px;
}
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.auth-logo-img {
    width: 180px;
    height: auto;
    margin: 0 auto 12px;
}
.auth-logo h1 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--navy);
    font-weight: 400;
}
.auth-logo p {
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: .83rem;
    color: var(--text-muted);
}
.auth-footer a { color: var(--navy-sky); font-weight: 600; }

/* ─── Page Header ────────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}
.page-header h2 {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 400;
    color: var(--navy);
    line-height: 1.2;
}
.page-header p {
    font-size: .875rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.action-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ─── Stat Grid ──────────────────────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    border-top: 3px solid var(--border);
    position: relative;
}
.stat-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 400;
    color: var(--navy);
    line-height: 1.1;
}
.stat-sub {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Stat color variants */
.stat-gelir      { border-top-color: var(--sage); }
.stat-gelir      .stat-value { color: var(--sage-dark); }
.stat-gider      { border-top-color: var(--coral); }
.stat-gider      .stat-value { color: var(--coral-dark); }
.stat-net        { border-top-color: var(--navy-sky); }
.stat-net        .stat-value { color: var(--navy); }
.stat-vergi      { border-top-color: var(--coral-dark); }
.stat-vergi      .stat-value { color: var(--coral-dark); }
.stat-bekleyen   { border-top-color: var(--coral); }
.stat-bekleyen   .stat-value { color: var(--coral); }
.stat-kdv-tahsil { border-top-color: var(--mist); }
.stat-kdv-tahsil .stat-value { color: var(--navy-sky); }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}
.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.card-header h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--navy);
}
.card-body { padding: 22px; }
.form-card { max-width: 800px; }

/* ─── Tabs ───────────────────────────────────────────────────────────────────── */
.tab-bar {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    gap: 0;
}
.tab-btn {
    padding: 10px 24px;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--navy); text-decoration: none; }
.tab-btn.active {
    color: var(--navy);
    border-bottom-color: var(--coral);
    font-weight: 700;
}

/* ─── Filter Form ────────────────────────────────────────────────────────────── */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}
.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.form-group label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-lt);
    letter-spacing: .02em;
    text-transform: uppercase;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.data-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    padding: 0 24px 24px;
}
.form-hint {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .875rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--navy-sky);
    box-shadow: 0 0 0 3px rgba(42,95,143,.12);
}
.form-control-sm {
    padding: 6px 9px;
    font-size: .82rem;
    width: auto;
    min-width: 100px;
}
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .875rem;
    cursor: pointer;
}
input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--navy);
    cursor: pointer;
}

/* Hesaplama Özeti */
.hesap-ozeti {
    background: var(--lemon);
    border: 1px solid #DEDE9A;
    border-radius: var(--radius);
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ozet-row {
    display: flex;
    justify-content: space-between;
    font-size: .875rem;
    color: var(--text-lt);
    padding: 3px 0;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.ozet-row:last-child { border-bottom: none; }
.ozet-net {
    padding-top: 8px;
    margin-top: 4px;
    font-weight: 700;
    color: var(--navy);
    font-size: 1rem;
    border-bottom: none !important;
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--coral);
    color: #fff;
    border-color: var(--coral);
}
.btn-primary:hover {
    background: var(--coral-dark);
    border-color: var(--coral-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255,107,74,.35);
}

.btn-navy {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}
.btn-navy:hover {
    background: var(--navy-dark);
    border-color: var(--navy-dark);
    color: #fff;
}

.btn-success {
    background: var(--sage);
    color: #fff;
    border-color: var(--sage);
}
.btn-success:hover {
    background: var(--sage-dark);
    border-color: var(--sage-dark);
    color: #fff;
}

.btn-danger {
    background: var(--coral);
    color: #fff;
    border-color: var(--coral);
}
.btn-danger:hover {
    background: var(--coral-dark);
    border-color: var(--coral-dark);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-lt);
}
.btn-outline:hover {
    background: var(--bg);
    border-color: var(--navy-sky);
    color: var(--navy);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-sm     { padding: 6px 12px; font-size: .82rem; }
.btn-xs     { padding: 4px 9px; font-size: .76rem; }
.btn-block  { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ─── Table ──────────────────────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
.table-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 16px;
}
.table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    font-size: .875rem;
    flex-wrap: wrap;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .855rem;
}
.data-table th {
    background: #FAFAF7;
    padding: 10px 16px;
    text-align: left;
    font-weight: 700;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text-lt);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #FAFAF4; }
.data-table .empty-row { text-align: center; color: var(--text-muted); padding: 48px; }
.col-check { width: 40px; padding-left: 16px !important; }
.action-cell { white-space: nowrap; }
.row-active td { background: #FFF8F0 !important; }
.row-active td:first-child { border-left: 3px solid var(--coral); }

.sort-link {
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    transition: color .15s;
}
.sort-link:hover { color: var(--coral); }

.counter-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--coral);
    min-width: 100px;
}

/* ─── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    line-height: 1.5;
    letter-spacing: .02em;
}
.badge-success   { background: #EAF6E5; color: #2D5A24; }
.badge-warning   { background: #FFFBE0; color: #7A6800; }
.badge-secondary { background: var(--bg); color: var(--text-muted); }
.badge-coral     { background: #FFF0ED; color: #8B2E1A; }
.badge-navy      { background: var(--mist); color: var(--navy); }

/* ─── Pagination ─────────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-lt);
    text-decoration: none;
    background: var(--surface);
    transition: background .15s, border-color .15s, color .15s;
}
.page-btn:hover { background: var(--lemon); border-color: var(--coral-dark); color: var(--navy); text-decoration: none; }
.page-btn.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
    font-weight: 700;
}
.page-dots { padding: 0 4px; color: var(--text-faint); font-size: .85rem; }
.page-info { margin-left: 8px; font-size: .78rem; color: var(--text-muted); }

/* ─── Inline Edit ────────────────────────────────────────────────────────────── */
.inline-edit-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ─── Chart ──────────────────────────────────────────────────────────────────── */
#trend-chart { width: 100%; display: block; }

/* ─── Utility ────────────────────────────────────────────────────────────────── */
.text-right   { text-align: right !important; }
.text-center  { text-align: center !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-success { color: var(--sage-dark) !important; }
.text-danger  { color: var(--coral-dark) !important; }
.text-warning { color: #7A6800 !important; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0 !important; }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0,0,0,.25);
    }
    .sidebar.expanded ~ .main-wrap {
        margin-left: 0;
    }
    .main-wrap {
        margin-left: 0 !important;
    }
    .nav-toggle { display: flex; }
    .main-content { padding: 20px 18px 40px; padding-top: 64px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 520px) {
    .stat-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 24px; }
    .page-header h2 { font-size: 1.4rem; }
    .data-table th, .data-table td { padding: 8px 10px; font-size: .78rem; }
}
/* ─── Drawer (Slide-in Panel) ──────────────────────────────────────────────── */

#drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
}
#drawer-overlay.open { display: block; }

#drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 480px;
    max-width: 100vw;
    background: #fff;
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: -4px 0 24px rgba(0,0,0,.12);
}
#drawer.open { transform: translateX(0); }

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.drawer-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--navy);
}
.drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: .25rem;
    line-height: 1;
    border-radius: 4px;
    transition: color .15s, background .15s;
}
.drawer-close:hover {
    color: var(--navy);
    background: var(--bg);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.drawer-body .form-group { margin-bottom: 1.1rem; }
.drawer-body .form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--navy); margin-bottom: .4rem; }
.drawer-body .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.drawer-body .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.drawer-body .hesap-ozeti {
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin-top: 1rem;
}
.drawer-body .hesap-ozeti .oz-row {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
    color: #713f12;
    padding: .2rem 0;
}
.drawer-body .hesap-ozeti .oz-row.oz-net {
    font-weight: 700;
    font-size: 1rem;
    border-top: 1px solid #fef08a;
    margin-top: .4rem;
    padding-top: .6rem;
}

.drawer-body .drawer-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
    #drawer { width: 100vw; }
    .drawer-body .form-row { grid-template-columns: 1fr; }
    .drawer-body .form-row.cols-3 { grid-template-columns: 1fr; }
}
