html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

:root {
    --yvz-font-sans: "Segoe UI", "Noto Sans", "DejaVu Sans", "Helvetica Neue", Arial, system-ui, -apple-system, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

html, body {
    font-family: var(--yvz-font-sans);
}

/* Neutral focus ring */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(108, 117, 125, 0.35);
}

/* Gray checkboxes site-wide */
.form-check-input:checked {
    background-color: #6c757d;
    border-color: #6c757d;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 0;
}

/* Generic AdminLTE treeview overlap safeguard.
   Keep submenus in the normal flow and avoid stacking quirks during expand/collapse transitions. */
.app-sidebar .nav-treeview {
    position: static;
}

/* Keep sidebar content scrollable when multiple treeviews expand.
   scrollbar-gutter: stable reserves scrollbar space so nav-arrow icons
   don't shift when the scrollbar appears or disappears. */
.app-sidebar .sidebar-wrapper {
    overflow-y: auto;
    scrollbar-gutter: stable;
}

/* Ensure sidebar content scrolls instead of visually overlapping sections when many menus are expanded */
.app-sidebar {
    display: flex;
    flex-direction: column;
}

.app-sidebar .sidebar-wrapper {
    flex: 1 1 auto;
    min-height: 0;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* AdminLTE clearfix creates a 3rd flex child inside card-header,
   breaking justify-content-between. Suppress it when d-flex is used. */
.card-header.d-flex::after {
    display: none;
}

/* ── Mobile-responsive card headers ──
   Ensure title + buttons wrap to a second row on narrow viewports instead of
   overflowing. Also allow inner button groups and filter forms to wrap. */
.card-header.d-flex {
    flex-wrap: wrap;
    gap: .5rem;
}

.card-header .d-flex,
.card-header form.d-flex {
    flex-wrap: wrap;
}

/* On small screens, card-header action areas stretch to full width so
   buttons/forms stack neatly below the title. */
@media (max-width: 575.98px) {
    .card-header .btn-group,
    .card-header > .d-flex,
    .card-header > form.d-flex {
        width: 100%;
        justify-content: flex-end;
    }

    /* Pagination buttons: hide text, show only icons */
    .card-header .btn-sm .fa-chevron-left + .d-none,
    .card-header .btn-sm .fa-chevron-right {
        /* icon-only is fine */
    }

    /* Hide button label text on mobile for action-heavy card headers
       (Customers/Details, Relationships/Details etc.) — keep icons only. */
    .card-header .yvz-btn-icon-xs > .btn > span,
    .card-header .yvz-btn-icon-xs > a > span,
    .card-header .yvz-btn-icon-xs > form .btn > span {
        display: none;
    }
}

/* Reports UI conventions */
.yvz-report-card > .card-header {
    background: var(--bs-secondary);
    color: var(--bs-white);
}

.yvz-report-card > .card-header .badge {
    --bs-badge-padding-y: 0.35em;
    --bs-badge-padding-x: 0.55em;
}

.yvz-table-responsive {
    max-height: 70vh;
    overflow: auto;
}

.table.yvz-table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bs-table-bg);
}

.table.yvz-table-sticky tfoot th,
.table.yvz-table-sticky tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: var(--bs-table-bg);
}

/* Zebra that still reads well on AdminLTE cards */
.table.yvz-table-zebra > tbody > tr:nth-of-type(even) > * {
    --bs-table-bg: rgba(108, 117, 125, 0.06);
}

/* ── Mesajlar page: presence dots ── */
.mesaj-presence-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    background: #adb5bd;
    margin-right: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}

.mesaj-presence-dot.online {
    background: #28a745;
}

/* ── Mesajlar page: header status text ── */
.mesaj-status-text {
    font-size: .75rem;
    vertical-align: middle;
}

/* ── Mesajlar page: typing indicator ── */
.mesaj-typing-indicator {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    font-size: .78rem;
    color: #6c757d;
}

.mesaj-typing-indicator .typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
}

.mesaj-typing-indicator .typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6c757d;
    animation: mesajTypingBounce 1.2s infinite ease-in-out;
}

.mesaj-typing-indicator .typing-dots span:nth-child(2) {
    animation-delay: .2s;
}

.mesaj-typing-indicator .typing-dots span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes mesajTypingBounce {
    0%, 60%, 100% { opacity: .3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* ── Mesajlar page: date separator ── */
.mesaj-date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 0 8px;
    color: #6c757d;
    font-size: .78rem;
}

.mesaj-date-separator span {
    background: #e9ecef;
    padding: 2px 14px;
    border-radius: 10px;
}

/* ── Per-page Help FAB — compact by default, expands on hover ── */
.yvz-help-fab {
    position: fixed;
    bottom: 64px;
    right: 20px;
    z-index: 1049;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    opacity: .55;
    transition: width .2s, height .2s, font-size .2s, opacity .2s;
}

.yvz-help-fab:hover,
.yvz-help-fab:focus-visible {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
    opacity: 1;
}
