/* hesaplar360 — mobile-first uygulama stili (tokens.css üstüne biner) */

/* ==== RESET / TEMEL ==== */
* { box-sizing: border-box; }
*, *::before, *::after { -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { color-scheme: light dark; }
body {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    background: var(--color-bg-subtle);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
button, a, .btn, .chip, .nav-tab { touch-action: manipulation; }
a { color: var(--color-info); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
input, select, textarea, button { font: inherit; color: inherit; }

/* =============================================================================
   LAYOUT — Mobile-first (default), Desktop ≥1024px sidebar açılır
   =============================================================================
   Mobile: [topbar 56px] [main scroll] [bottomnav 64px + safe-area]
   Desktop: [sidebar 220px] [main scroll]
*/

.app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-subtle);
}

/* === Top bar (mobile) === */
.app-topbar {
    position: sticky; top: 0;
    z-index: var(--z-sticky);
    height: 56px;
    padding: 0 var(--space-4);
    display: flex; align-items: center; gap: var(--space-3);
    background: var(--color-sidebar-bg);
    color: var(--color-sidebar-text);
    box-shadow: var(--shadow-sm);
    padding-top: env(safe-area-inset-top);
    height: calc(56px + env(safe-area-inset-top));
}
.app-topbar .topbar-back,
.app-topbar .topbar-action {
    background: transparent; border: 0; color: inherit;
    font-size: 22px; line-height: 1;
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md);
    cursor: pointer;
}
.app-topbar .topbar-back:hover,
.app-topbar .topbar-action:hover { background: rgba(255,255,255,0.08); }
.app-topbar .topbar-title {
    flex: 1; min-width: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-topbar .topbar-brand {
    flex: 1;
    font-weight: var(--font-weight-bold);
    color: var(--color-sidebar-text);
    font-size: var(--font-size-lg);
    letter-spacing: 0.3px;
}
.app-topbar .topbar-brand .accent { color: var(--color-warning); }

/* === Main content === */
.app-main {
    flex: 1;
    padding: var(--space-3);
    padding-bottom: calc(var(--space-3) + 80px + env(safe-area-inset-bottom));  /* bottom-nav clearance */
    background: var(--color-bg-subtle);
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}
.app-main > .container { max-width: var(--container-max); margin: 0 auto; }

/* === Bottom navigation (mobile) === */
.app-bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: var(--z-fixed);
    background: var(--color-bg-elevated);
    border-top: 1px solid var(--color-border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.app-bottomnav .nav-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    border-radius: var(--radius-md);
    border: 0; background: transparent;
    cursor: pointer;
    min-height: 56px;
    line-height: 1;
}
.app-bottomnav .nav-tab .icon { font-size: 22px; line-height: 1; }
.app-bottomnav .nav-tab.active { color: var(--color-primary); }
.app-bottomnav .nav-tab:hover { background: var(--color-bg-subtle); text-decoration: none; }
.app-bottomnav .nav-fab-wrap {
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.app-bottomnav .nav-fab {
    width: 56px; height: 56px;
    border-radius: var(--radius-circle);
    background: var(--color-primary); color: var(--color-primary-on);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 28px; line-height: 1;
    box-shadow: var(--shadow-lg);
    border: 0; cursor: pointer; text-decoration: none;
    margin-top: -28px; /* bottom-nav'in dışına taşır */
    transition: transform var(--transition-fast), background var(--transition-fast);
}
.app-bottomnav .nav-fab:hover { background: var(--color-primary-hover); transform: translateY(-2px); }
.app-bottomnav .nav-fab:active { transform: scale(0.95); }

/* === Sidebar (desktop) === */
.app-sidebar { display: none; }

@media (min-width: 1024px) {
    .app {
        display: grid;
        grid-template-columns: 240px 1fr;
        grid-template-rows: 1fr;
    }
    .app-topbar { display: none; }
    .app-bottomnav { display: none; }
    .app-sidebar {
        display: flex;
        flex-direction: column;
        background: var(--color-sidebar-bg);
        color: var(--color-sidebar-text);
        position: sticky; top: 0; height: 100vh;
        overflow-y: auto;
        z-index: var(--z-sticky);
    }
    .app-sidebar .sidebar-brand {
        padding: var(--space-5) var(--space-4) var(--space-4);
        font-weight: var(--font-weight-bold);
        font-size: var(--font-size-xl);
        color: var(--color-sidebar-text);
    }
    .app-sidebar .sidebar-brand .accent { color: var(--color-warning); }
    .app-sidebar .sidebar-section {
        color: var(--color-text-muted);
        font-size: var(--font-size-xs);
        text-transform: uppercase;
        letter-spacing: 1px;
        padding: var(--space-3) var(--space-4) var(--space-1);
    }
    .app-sidebar a {
        display: flex; align-items: center; gap: var(--space-3);
        padding: var(--space-3) var(--space-4);
        color: var(--color-sidebar-text);
        border-left: 3px solid transparent;
        font-size: var(--font-size-sm);
    }
    .app-sidebar a:hover { background: rgba(255,255,255,0.04); text-decoration: none; }
    .app-sidebar a.active {
        border-left-color: var(--color-warning);
        background: rgba(255,255,255,0.06);
        font-weight: var(--font-weight-semibold);
    }
    .app-sidebar a .icon { font-size: 18px; }
    .app-sidebar .sidebar-user {
        margin-top: auto;
        padding: var(--space-3) var(--space-4);
        border-top: 1px solid rgba(255,255,255,0.08);
        display: flex; align-items: center; justify-content: space-between;
        gap: var(--space-2);
        font-size: var(--font-size-sm);
    }
    .app-sidebar .sidebar-user form { margin: 0; }
    .app-sidebar .sidebar-user .btn-logout {
        background: transparent; color: var(--color-sidebar-text);
        border: 1px solid rgba(255,255,255,0.12);
        padding: 4px 10px; border-radius: var(--radius-sm);
        font-size: var(--font-size-xs); cursor: pointer;
    }
    .app-main {
        padding: var(--space-5) var(--space-5) var(--space-6);
        max-width: 100%;
    }
}

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */
h1, h2, h3, h4 {
    margin: 0 0 var(--space-3);
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
}
h1 { font-size: 22px; }
h2 { font-size: 19px; }
h3 { font-size: 17px; }
@media (min-width: 1024px) {
    h1 { font-size: var(--font-size-2xl); }
    h2 { font-size: var(--font-size-xl); }
    h3 { font-size: var(--font-size-lg); }
}
.muted { color: var(--color-text-muted); }
.small { font-size: var(--font-size-sm); }
.tiny { font-size: var(--font-size-xs); }

/* =============================================================================
   PAGE HEADER (içerik üstü - başlık + alt-başlık + aksiyon)
   ============================================================================= */
.page-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.page-header .titles { min-width: 0; flex: 1; }
.page-header h1 { margin: 0 0 2px; }
.page-header .subtitle { color: var(--color-text-muted); font-size: var(--font-size-sm); }
.page-header .actions { display: flex; gap: var(--space-2); flex-wrap: nowrap; }

/* =============================================================================
   FILTER CHIPS (yatay scroll)
   ============================================================================= */
.chip-bar {
    display: flex; gap: var(--space-2); overflow-x: auto;
    padding: 2px 0 8px;
    margin: 0 calc(-1 * var(--space-3)) var(--space-3);
    padding-left: var(--space-3); padding-right: var(--space-3);
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.chip-bar::-webkit-scrollbar { display: none; }
.chip-bar .chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-strong);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}
.chip-bar .chip:hover { background: var(--color-bg-subtle); text-decoration: none; }
.chip-bar .chip.active {
    background: var(--color-primary);
    color: var(--color-primary-on);
    border-color: var(--color-primary);
}
.chip-bar .chip .x { opacity: 0.7; margin-left: 2px; }

/* =============================================================================
   CARD
   ============================================================================= */
.card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--space-3); }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-2);
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-divider);
}
.card-title { margin: 0; font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); }
.card .card-subtle { color: var(--color-text-muted); font-size: var(--font-size-sm); }

/* =============================================================================
   STAT CARDS (özet rakamları)
   ============================================================================= */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-2);
}
.stat-card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    border-left: 4px solid var(--color-info);
    box-shadow: var(--shadow-sm);
}
.stat-card.income  { border-left-color: var(--color-success); }
.stat-card.expense { border-left-color: var(--color-danger); }
.stat-card.net     { border-left-color: var(--color-info); }
.stat-card.transfer{ border-left-color: var(--color-warning); }
.stat-card .label { color: var(--color-text-muted); font-size: var(--font-size-xs); margin-bottom: 2px; }
.stat-card .value { font-size: 20px; font-weight: var(--font-weight-bold); color: var(--color-text); line-height: 1.2; }
.stat-card .value.income  { color: var(--color-success); }
.stat-card .value.expense { color: var(--color-danger); }
.stat-card .value.net.neg { color: var(--color-danger); }
.stat-card .value.net.pos { color: var(--color-success); }
.stat-card .sub { font-size: var(--font-size-xs); color: var(--color-text-muted); margin-top: 2px; }
@media (min-width: 768px) {
    .stat-card .value { font-size: 24px; }
}

/* =============================================================================
   LIST CARDS (mobil ana liste pattern — tablo yerine kart sırası)
   ============================================================================= */
.list {
    display: flex; flex-direction: column; gap: var(--space-2);
}
.list-card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    display: block;
    color: var(--color-text);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.list-card:hover { background: var(--color-bg-subtle); text-decoration: none; }
.list-card:active { transform: scale(0.998); }
.list-card.muted-row { opacity: 0.55; }
.list-card .row {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-3);
}
.list-card .lead {
    flex: 1; min-width: 0;
    font-weight: var(--font-weight-semibold);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-card .trail {
    text-align: right; font-variant-numeric: tabular-nums;
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
    flex-shrink: 0;
}
.list-card .meta {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 4px;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}
.list-card .meta .sep::before { content: '·'; margin: 0 4px; color: var(--color-text-disabled); }
.list-card .actions-row {
    display: flex; gap: var(--space-2); justify-content: flex-end;
    margin-top: var(--space-3);
    border-top: 1px solid var(--color-divider);
    padding-top: var(--space-2);
}

/* Hareket kartı = list-card + extra */
.hareket-card .lead { font-size: var(--font-size-base); }
.hareket-card .trail.income  { color: var(--color-success); }
.hareket-card .trail.expense { color: var(--color-danger); }

/* =============================================================================
   TAG / BADGE
   ============================================================================= */
.tag {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-pill); font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium); white-space: nowrap;
    line-height: 1.4;
}
.tag-gelir    { background: var(--color-success-soft); color: var(--color-success); }
.tag-gider    { background: var(--color-danger-soft);  color: var(--color-danger); }
.tag-transfer { background: var(--color-warning-soft); color: var(--color-warning); }
.tag-faturali  { background: var(--color-info-soft); color: var(--color-info); }
.tag-faturasiz { background: var(--color-bg-muted); color: var(--color-text-muted); }
.num-pos { color: var(--color-success); }
.num-neg { color: var(--color-danger); }

/* =============================================================================
   FORM
   ============================================================================= */
.form { display: flex; flex-direction: column; gap: var(--space-3); }
.form-grid {
    display: grid; gap: var(--space-3);
    grid-template-columns: 1fr;
}
@media (min-width: 600px) {
    .form-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.full { grid-column: 1 / -1; }

label, .form-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
}
.form-hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: -2px;
}

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input[type="tel"], input[type="url"], input[type="date"], input[type="time"],
input[type="datetime-local"], input:not([type]), select, textarea {
    width: 100%;
    padding: 12px var(--space-3);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-bg-elevated); color: var(--color-text);
    font-size: 16px;  /* iOS zoom-on-focus engellemek için ≥16 */
    font-family: inherit;
    min-height: 44px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    appearance: none; -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
    outline: 0; border-color: var(--color-info);
    box-shadow: 0 0 0 3px var(--color-info-soft);
}
select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='currentColor'%3e%3cpath d='M4 6l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}
textarea { min-height: 80px; resize: vertical; }
input:disabled, select:disabled { background: var(--color-bg-muted); color: var(--color-text-muted); }
.input-error { border-color: var(--color-danger); }
.error-msg { color: var(--color-danger); font-size: var(--font-size-sm); }

/* === Switch (toggle, modern checkbox alternatifi) === */
.switch-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-3); padding: 8px 0;
    cursor: pointer;
}
.switch-row .switch-label { flex: 1; }
.switch-row .switch-label .switch-title { font-weight: var(--font-weight-medium); color: var(--color-text); }
.switch-row .switch-label .switch-hint { font-size: var(--font-size-xs); color: var(--color-text-muted); margin-top: 2px; }
.switch {
    position: relative; display: inline-block;
    width: 48px; height: 28px; flex-shrink: 0;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .slider {
    position: absolute; inset: 0;
    background: var(--color-border-strong);
    border-radius: 999px;
    transition: background var(--transition-fast);
}
.switch .slider::before {
    content: ''; position: absolute;
    width: 22px; height: 22px;
    left: 3px; top: 3px;
    background: white; border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}
.switch input:checked + .slider { background: var(--color-success); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--color-info-soft); }

/* === Radio tabs (gelir/gider/transfer pill button group) === */
.radio-tabs {
    display: grid; grid-auto-columns: 1fr; grid-auto-flow: column;
    gap: 6px;
    background: var(--color-bg-muted);
    border-radius: var(--radius-md);
    padding: 4px;
}
.radio-tabs label {
    display: flex; align-items: center; justify-content: center;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-semibold); font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    min-height: 40px;
}
.radio-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.radio-tabs label:has(input:checked) { background: var(--color-bg-elevated); box-shadow: var(--shadow-sm); }
.radio-tabs label.gelir:has(input:checked)    { color: var(--color-success); }
.radio-tabs label.gider:has(input:checked)    { color: var(--color-danger); }
.radio-tabs label.transfer:has(input:checked) { color: var(--color-warning); }
.radio-tabs input:focus-visible + span,
.radio-tabs label:focus-within { outline: 2px solid var(--color-info); outline-offset: 1px; }

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 11px var(--space-4);
    border-radius: var(--radius-sm); border: 1px solid transparent;
    font-weight: var(--font-weight-semibold); font-size: var(--font-size-sm);
    cursor: pointer; min-height: 44px;
    transition: all var(--transition-fast); text-decoration: none;
    background: var(--color-bg-elevated); color: var(--color-text);
    border-color: var(--color-border-strong);
}
.btn:hover { background: var(--color-bg-subtle); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn.primary  { background: var(--color-primary);  color: var(--color-primary-on);  border-color: var(--color-primary); }
.btn.primary:hover { background: var(--color-primary-hover); }
.btn.success  { background: var(--color-success);  color: var(--color-success-on);  border-color: var(--color-success); }
.btn.success:hover { background: var(--color-success-hover); }
.btn.danger   { background: var(--color-danger);   color: var(--color-danger-on);   border-color: var(--color-danger); }
.btn.danger:hover { background: var(--color-danger-hover); }
.btn.warning  { background: var(--color-warning);  color: var(--color-warning-on);  border-color: var(--color-warning); }
.btn.warning:hover { background: var(--color-warning-hover); }
.btn.info     { background: var(--color-info);     color: var(--color-info-on);     border-color: var(--color-info); }
.btn.info:hover { background: var(--color-info-hover); }
.btn.ghost    { background: transparent; }
.btn.sm { padding: 7px 12px; min-height: 34px; font-size: var(--font-size-xs); }
.btn.lg { padding: 14px var(--space-5); min-height: 52px; font-size: var(--font-size-base); }
.btn.full { width: 100%; }
.btn.icon-only { padding: 8px; min-width: 44px; min-height: 44px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.btn-row.justify-end { justify-content: flex-end; }
.btn-row.full > .btn { flex: 1; }

/* =============================================================================
   ALERT
   ============================================================================= */
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    border-left: 4px solid;
    background: var(--color-bg-elevated);
    font-size: var(--font-size-sm);
}
.alert.success { background: var(--color-success-soft); border-color: var(--color-success); color: var(--color-success); }
.alert.danger  { background: var(--color-danger-soft);  border-color: var(--color-danger);  color: var(--color-danger); }
.alert.warning { background: var(--color-warning-soft); border-color: var(--color-warning); color: var(--color-warning); }
.alert.info    { background: var(--color-info-soft);    border-color: var(--color-info);    color: var(--color-info); }

/* =============================================================================
   EMPTY STATE
   ============================================================================= */
.empty {
    padding: var(--space-7) var(--space-4);
    text-align: center; color: var(--color-text-muted);
    background: var(--color-bg-elevated);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
}
.empty .icon { font-size: 40px; margin-bottom: var(--space-3); display: block; }
.empty .title { font-size: var(--font-size-base); color: var(--color-text); margin-bottom: var(--space-2); font-weight: var(--font-weight-semibold); }
.empty .hint { font-size: var(--font-size-sm); margin-bottom: var(--space-3); }

/* =============================================================================
   BOTTOM SHEET (modal yerine native-feel form sayfası)
   ============================================================================= */
.sheet-backdrop {
    position: fixed; inset: 0;
    background: var(--color-bg-overlay);
    z-index: var(--z-modal);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: calc(var(--z-modal) + 1);
    background: var(--color-bg-elevated);
    border-radius: 16px 16px 0 0;
    max-height: 90vh; max-height: 90dvh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-xl);
    padding-bottom: env(safe-area-inset-bottom);
    display: flex; flex-direction: column;
}
.sheet.open { transform: translateY(0); }
.sheet-header {
    position: sticky; top: 0;
    background: var(--color-bg-elevated);
    padding: var(--space-3) var(--space-4);
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--color-divider);
    z-index: 1;
}
.sheet-header .grabber {
    position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    width: 36px; height: 4px; background: var(--color-border-strong);
    border-radius: 2px;
}
.sheet-header h3 { margin: 0; font-size: var(--font-size-lg); }
.sheet-header .close {
    background: transparent; border: 0; color: var(--color-text-muted);
    width: 36px; height: 36px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 20px;
}
.sheet-header .close:hover { background: var(--color-bg-muted); color: var(--color-text); }
.sheet-body { padding: var(--space-4); flex: 1; }
.sheet-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-divider);
    display: flex; gap: var(--space-2);
    background: var(--color-bg-elevated);
    position: sticky; bottom: 0;
}
.sheet-footer .btn { flex: 1; }

/* Tablet+ : sheet ortalanmış modal'a dönüşür */
@media (min-width: 768px) {
    .sheet {
        left: 50%; right: auto; bottom: 50%;
        transform: translate(-50%, calc(50% + 50vh));
        width: 92%; max-width: 560px;
        border-radius: var(--radius-lg);
        max-height: 85vh;
    }
    .sheet.open { transform: translate(-50%, 50%); }
    .sheet-header .grabber { display: none; }
}

/* =============================================================================
   TABLE (desktop için, mobilde kullanılmaz)
   ============================================================================= */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
    width: 100%; border-collapse: collapse; background: var(--color-bg-elevated);
    border-radius: var(--radius-md); overflow: hidden; font-size: var(--font-size-sm);
}
table.data th, table.data td { padding: var(--space-3); text-align: left; border-bottom: 1px solid var(--color-divider); vertical-align: middle; }
table.data th { background: var(--color-bg-subtle); color: var(--color-text-secondary); font-weight: var(--font-weight-semibold); white-space: nowrap; }
table.data tbody tr:hover { background: var(--color-bg-subtle); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tfoot td { background: var(--color-bg-subtle); font-weight: var(--font-weight-bold); }

.show-mobile { display: block; }
.show-desktop { display: none; }
@media (min-width: 1024px) {
    .show-mobile { display: none; }
    .show-desktop { display: block; }
}

/* =============================================================================
   LOGIN
   ============================================================================= */
.login-bg {
    min-height: 100vh; min-height: 100dvh;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--color-sidebar-bg) 0%, #2a2f3a 100%);
    padding: var(--space-4);
}
.login-card {
    width: 100%; max-width: 400px;
    background: var(--color-bg-elevated);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-xl);
}
.login-card h1 { text-align: center; margin: 0 0 4px; font-size: 28px; }
.login-card .tag-line { text-align: center; color: var(--color-text-muted); margin-bottom: var(--space-5); }
.login-card .form { gap: var(--space-3); }
.login-card .btn { width: 100%; }

/* =============================================================================
   UTILS
   ============================================================================= */
.flex { display: flex; }
.flex.center { align-items: center; justify-content: center; }
.flex.between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hide { display: none !important; }
.fill { width: 100%; }
.no-shrink { flex-shrink: 0; }

/* =============================================================================
   PRINT
   ============================================================================= */
@media print {
    .no-print, .app-topbar, .app-sidebar, .app-bottomnav, .sheet, .sheet-backdrop { display: none !important; }
    .app { display: block; }
    .app-main { padding: 0; padding-bottom: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}
