/* IFM shared UX foundation: accessibility, feedback and mobile readability. */

html { -webkit-text-size-adjust: 100%; }

body :where(a[href], button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid rgba(40, 103, 166, .34);
    outline-offset: 3px;
}

body :where(button, a[href], summary) {
    -webkit-tap-highlight-color: rgba(23, 43, 77, .1);
}

.ifm-ux-toast {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 1800;
    width: min(390px, calc(100vw - 28px));
    border: 1px solid rgba(23, 43, 77, .15);
    border-left: 5px solid #2d7750;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 10px;
    background: #fffdf9;
    box-shadow: 0 20px 55px rgba(23, 43, 77, .22);
    padding: 12px;
    color: #211f1c;
    font-family: "DM Sans", system-ui, sans-serif;
    animation: ifm-ux-toast-enter .2s ease-out;
}
.ifm-ux-toast__icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(45, 119, 80, .12);
    color: #2d7750;
    font-size: 17px;
    font-weight: 900;
}
.ifm-ux-toast__copy { min-width: 0; display: grid; gap: 3px; }
.ifm-ux-toast__copy strong { color: #172b4d; font-size: 13px; }
.ifm-ux-toast__copy span { color: #706a62; font-size: 11px; line-height: 1.4; }
.ifm-ux-toast__close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(23, 43, 77, .06);
    color: #172b4d;
    cursor: pointer;
    font-size: 20px;
}

@keyframes ifm-ux-toast-enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
    body .ifm-nav__inner { gap: 6px; }
    body .ifm-nav__modules a { min-height: 38px; font-size: 10px; }
    body .ifm-nav__admin,
    body .ifm-nav__notification-trigger,
    body .ifm-nav__refresh,
    body .ifm-nav__mobile-account-trigger {
        min-width: 34px;
        min-height: 34px;
    }
    body .ifm-nav__operations { min-height: 46px; }
    body .ifm-nav__links a,
    body .ifm-nav__links button {
        min-height: 40px;
        padding-inline: 10px;
        font-size: 10.5px;
    }
    body .ifm-nav__context { min-height: 44px; }
    body .ifm-nav__context .ifm-nav__subnav a {
        min-height: 38px;
        padding-inline: 12px;
        font-size: 10px;
    }
    body .ifm-nav__language { display: none; }

    body .crm-primary,
    body .contractor-primary,
    body .tb-primary,
    body .kp-primary,
    body .kf-primary { min-height: 44px; }

    body .overview-panel header a,
    body .period-feature > div b,
    body .ko-finance > header a,
    body .ko-section > header a {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        font-size: 10.5px;
    }

    body .command-summary > span,
    body .overview-panel header span,
    body .period-outlooks-header span,
    body .crm-dashboard > header span { font-size: 9px; }
    body .command-summary h2 { font-size: 13px; line-height: 1.45; }
    body .command-metrics dt { font-size: 8.5px; }
    body .command-metrics dd { font-size: 15px; }
    body .command-metrics small { font-size: 8.5px; line-height: 1.35; white-space: normal; }
    body .overview-panel header h2,
    body .period-outlooks-header h2,
    body .crm-dashboard > header h2 { font-size: 21px; }
    body .overview-list p,
    body .overview-risk-list li { font-size: 11px; line-height: 1.5; }
    body .overview-empty { font-size: 10.5px; }
    body .report-ledger .report-copy p,
    body .follow-up-list p,
    body .crm-update-list p,
    body .closeout-list p { font-size: 10px; }

    body .crm-search input,
    body .crm-form-grid input,
    body .crm-form-grid select,
    body .crm-form-grid textarea { min-height: 44px; font-size: 12px; }
    body .crm-filters select { min-height: 44px; }
    body .crm-table td { font-size: 11px; }
    body .crm-table td::before { font-size: 8.5px; }
    body .crm-table td strong { font-size: 11px; }
    body .crm-table td > span:not(.crm-status):not(.crm-relation),
    body .crm-person-cell span { font-size: 10px; }
    body .crm-relation,
    body .crm-status { font-size: 9px; }
    body .crm-open,
    body .crm-delete { min-width: 40px; min-height: 40px; font-size: 9px; }

    body .contractor-hero p { font-size: 12px; }
    body .contractor-stats article > span { font-size: 10px; }
    body .contractor-stats small { font-size: 9px; }
    body .contractor-search input { min-height: 44px; font-size: 12px; }
    body .contractor-table-scroll { max-width: 100%; overflow: visible; }
    body .contractor-panel table,
    body .contractor-panel tbody { width: 100%; min-width: 0; display: block; }
    body .contractor-panel thead { display: none; }
    body .contractor-panel tbody tr:not(.contractor-empty-row) {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px;
        border-bottom: 1px solid rgba(23, 43, 77, .13);
        padding: 16px;
    }
    body .contractor-panel td {
        width: 100%;
        height: auto;
        min-width: 0;
        border: 0;
        padding: 0;
        font-size: 11px;
    }
    body .contractor-panel td::before {
        display: block;
        margin-bottom: 5px;
        color: #746e66;
        font-size: 8px;
        font-weight: 900;
        letter-spacing: .07em;
        text-transform: uppercase;
    }
    body .contractor-panel td:nth-child(1) { grid-column: 1 / -1; }
    body .contractor-panel td:nth-child(2)::before { content: "Bina / iş paketi"; }
    body .contractor-panel td:nth-child(3)::before { content: "İş kapsamı"; }
    body .contractor-panel td:nth-child(4)::before { content: "Durum"; }
    body .contractor-panel td:nth-child(5)::before { content: "Sözleşme"; }
    body .contractor-panel td:nth-child(6)::before { content: "Yetkili / takip"; }
    body .contractor-panel td:nth-child(7) { grid-column: 1 / -1; }
    body .contractor-panel td strong { font-size: 11px; }
    body .contractor-panel td:first-child strong { font-size: 19px; }
    body .contractor-panel td > span:not(.contractor-status),
    body .contractor-panel td a > span { font-size: 9.5px; line-height: 1.4; }
    body .contractor-status { font-size: 9px; }
    body .contractor-open { width: 100%; min-height: 42px; font-size: 10px; }
}

@media (max-width: 430px) {
    .ifm-ux-toast { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); width: calc(100vw - 20px); }
    body .ifm-nav__refresh { display: inline-flex; }
    body .ifm-nav__refresh span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .ifm-ux-toast { animation: none; }
}
