/* Scrollbar fix: make scrollbars visible */
body ::-webkit-scrollbar { width: 6px !important; height: 6px !important; }
body ::-webkit-scrollbar-thumb { background-color: rgba(var(--input-border), 0.5) !important; border-radius: 3px; }
body ::-webkit-scrollbar-thumb:hover { background-color: rgba(var(--input-border), 0.8) !important; }

/* Hide scrollbar in sidebar to prevent white track on colored background */
.app-sidebar ::-webkit-scrollbar { width: 0 !important; }
.app-sidebar { scrollbar-width: none; }
.app-sidebar .main-sidebar { scrollbar-width: none; }

.choices { position: relative; z-index: 20; }
.choices.is-open { z-index: 9999; }
.choices__list--dropdown { z-index: 9999; background-color: rgb(var(--custom-white)) !important; }

/* Flatpickr: body'nin overflow-x:clip kuralı position:absolute öğeleri klipliyor.
   position:fixed kullanmak hem overflow kliplemesinden hem de modal z-index sorunlarından kurtarıyor.
   Bu layout'ta body scroll yapmıyor (sidebar layout), pageYOffset=0 olduğundan
   flatpickr'ın top/left hesabı fixed ile de doğru çalışır. */
.flatpickr-calendar.open {
    position: fixed !important;
    z-index: 99999 !important;
}

/* align-items:stretch olan grid satirlarindaki yan yana box'larin margin'ini sifirla */
.grid[style*="align-items:stretch"] > [class*="col-span"] > .box,
.grid[style*="align-items: stretch"] > [class*="col-span"] > .box,
.grid.stretch-boxes > [class*="col-span"] > .box { margin-bottom: 0 !important; }

/* Kurumsal görünüm için sık tablo satırları */
.ti-custom-table th { padding: 0.4rem 0.65rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .3px; }
.ti-custom-table td { padding: 0.32rem 0.65rem; font-size: 0.78rem; vertical-align: middle; }

.table tbody tr { border-bottom: 1px solid rgb(var(--default-border)); }
.table thead th { font-weight: 600; padding: 0.4rem 0.5rem; text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.table tbody td { padding: 0.32rem 0.5rem; vertical-align: middle; text-align: left; font-size: 0.78rem; }
.table tbody tr:hover { background-color: rgb(var(--default-background)); }

.tl-table th { padding: 0.4rem 0.5rem; font-size: 0.72rem; }
.tl-table td { padding: 0.32rem 0.5rem; font-size: 0.78rem; }

.sortable { cursor: pointer; user-select: none; }
.sortable:hover { background-color: rgba(var(--primary-rgb), 0.1); }
.sort-asc::after { content: " ▲"; font-size: 10px; }
.sort-desc::after { content: " ▼"; font-size: 10px; }

.action-btns { display: flex; gap: 4px; justify-content: center; }
.action-btns .ti-btn { padding: 3px 6px; font-size: 0.7rem; border-radius: 4px; line-height: 1; }

.btn-unified { height: 36px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1; font-size: 0.8rem; }

.zone-box { border: 1px solid rgb(var(--default-border)); border-radius: 0.375rem; height: 220px; overflow-y: auto; }
.zone-box option { padding: 0.5rem; }
.zone-box option:hover { background: rgba(var(--primary-rgb), 0.08); }

.skeleton { background: linear-gradient(90deg, rgb(var(--default-background)) 25%, rgb(var(--default-border)) 50%, rgb(var(--default-background)) 75%); background-size: 200% 100%; animation: sk 1.5s infinite; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.user-avatar { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.7rem; text-transform: uppercase; }

@media (max-width: 768px) {
    .page-header-breadcrumb { flex-direction: column; align-items: flex-start !important; }
    .page-header-breadcrumb .btn-list { width: 100%; flex-wrap: wrap; margin-top: 0.75rem; }
    .hide-mobile { display: none !important; }

    /* Global: all grid children single column on mobile */
    .main-content .grid.grid-cols-12 > [class*="col-span-"] { grid-column: span 12 / span 12 !important; }

    /* Info boxes: compact on mobile */
    .info-box-grid .flex.items-start { padding: 0.5rem 0.75rem !important; }
    .info-box-grid .flex.items-start i { font-size: 1rem !important; margin-top: 2px; }
    .info-box-grid .flex.items-start h6 { font-size: 0.8rem !important; margin-bottom: 0 !important; }
    .info-box-grid .flex.items-start p { font-size: 0.7rem !important; line-height: 1.3; }

    /* Stat cards: compact height on mobile */
    .stat-card-grid .box { margin-bottom: 0.25rem !important; }
    .stat-card-grid .box-body { padding: 0.65rem 0.75rem !important; }
    .stat-card-grid .flex.items-start { align-items: center !important; }
    .stat-card-grid h4 { font-size: 1.1rem !important; margin-bottom: 0 !important; }
    .stat-card-grid h6 { font-size: 0.7rem !important; }
    .stat-card-grid .badge { font-size: 0.6rem !important; padding: 1px 6px !important; }
}
@media (max-width: 1024px) {
    .hide-tablet { display: none !important; }
}

/* ── sc-grid stat cards (shared) ── */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: .85rem; margin-bottom: 1.5rem; }
@media (max-width: 640px) { .sc-grid { grid-template-columns: 1fr; } }
.sc-card { background: rgb(var(--custom-white)); border-radius: 12px; border: 1px solid rgb(var(--default-border) / 0.6); overflow: hidden; transition: box-shadow .2s, transform .2s, border-color .2s; cursor: pointer; position: relative; }
.dark .sc-card { background: rgb(var(--default-background)); border-color: rgb(var(--default-border) / 0.08); }
.sc-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); border-color: var(--ic, rgb(var(--default-border))); }
.sc-card:active { transform: translateY(0) scale(.98); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.sc-card .sc-arrow { position: absolute; bottom: .65rem; right: .75rem; font-size: .85rem; color: rgb(var(--text-muted) / 0.3); transition: color .2s, transform .2s; }
.sc-card:hover .sc-arrow { color: var(--ic, rgb(var(--text-muted))); transform: translateX(3px); }
.sc-top { background: var(--bg); padding: .85rem 1.1rem; display: flex; align-items: center; justify-content: space-between; }
.sc-icon { font-size: 1.05rem; color: var(--ic); }
.sc-badge { font-size: .5rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ic); background: var(--bbg); border-radius: 3px; padding: 2px 6px; }
.sc-body { padding: .85rem 1.1rem; }
.sc-num { font-size: 2rem; font-weight: 900; color: rgb(var(--default-text-color)); line-height: 1; letter-spacing: -1px; }
.sc-lbl { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: rgb(var(--text-muted)); margin-top: 4px; }
.sc-sub { font-size: .62rem; color: rgb(var(--text-muted) / 0.6); margin-top: 2px; }

/* ── Table responsive guarantee ── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Auth pages: reduce box padding on small screens ── */
@media (max-width: 480px) {
    .authentication .box-body { padding: 1.5rem !important; }
}

/* ── Modals: constrain to viewport on mobile ── */
@media (max-width: 640px) {
    .ti-modal-box { max-width: calc(100vw - 2rem) !important; width: calc(100vw - 2rem) !important; }
}
