/* Ofis CRM — Görev panosu (KMT ve mükellef panelleri, mobil uyumlu) */
html body .crm-root {
    --crm-ana: var(--emm-brand-primary, #003b95);
    --crm-ana-koyu: var(--emm-brand-primary-hover, #002d73);
    --crm-vurgu: var(--emm-brand-accent, #eb7b1b);
    --crm-kenar: #e2e8f0;
    --crm-yazi: #0f172a;
    --crm-soluk: #64748b;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    color: var(--crm-yazi);
}

html body .crm-root *,
html body .crm-root *::before,
html body .crm-root *::after {
    box-sizing: border-box;
}

html body .crm-root .crm-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0 16px;
    min-width: 0;
}

/* Üst araç çubuğu */
html body .crm-root .crm-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
    background: #fff;
    border: 1px solid var(--crm-kenar);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

html body .crm-root .crm-baslik {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

html body .crm-root .crm-baslik-ikon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(0, 59, 149, 0.1);
    color: var(--crm-ana);
    font-size: 1.05rem;
}

html body .crm-root .crm-toolbar h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--crm-yazi);
}

html body .crm-root .crm-toolbar p {
    margin: 2px 0 0;
    color: var(--crm-soluk);
    font-size: 0.82rem;
}

html body .crm-root .crm-grow {
    flex: 1 1 240px;
}

html body .crm-root .crm-field,
html body .crm-root .crm-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    min-width: 0;
}

html body .crm-root .crm-etiket {
    color: #475569;
    font-weight: 600;
}

html body .crm-root .crm-input,
html body .crm-root .crm-form select,
html body .crm-root .crm-touch-move select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    background: #fff;
    color: var(--crm-yazi);
    font-size: 0.875rem;
    font-weight: 400;
    box-shadow: none;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html body .crm-root .crm-input:focus,
html body .crm-root .crm-form select:focus {
    border-color: var(--crm-ana);
    box-shadow: 0 0 0 3px rgba(0, 59, 149, 0.15);
}

html body .crm-root .crm-input:disabled,
html body .crm-root .crm-form select:disabled {
    background: #f1f5f9;
    color: #475569;
    cursor: not-allowed;
}

html body .crm-root textarea.crm-input {
    min-height: 96px;
    resize: vertical;
}

/* Butonlar */
html body .crm-root .crm-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

html body .crm-root .crm-btn:hover:not(:disabled) {
    background: #f8fafc;
}

html body .crm-root .crm-btn.birincil {
    background: var(--crm-ana);
    border-color: var(--crm-ana);
    color: #fff;
}

html body .crm-root .crm-btn.birincil:hover:not(:disabled) {
    background: var(--crm-ana-koyu);
    border-color: var(--crm-ana-koyu);
}

html body .crm-root .crm-btn:disabled,
html body .crm-root .crm-menu button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Uyarılar */
html body .crm-root .crm-uyari {
    margin: 0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.875rem;
}

html body .crm-root .crm-uyari.hata {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

html body .crm-root .crm-uyari.bilgi {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}

html body .crm-root .crm-bos {
    margin: 0;
    color: var(--crm-soluk);
    font-size: 0.875rem;
}

/* Pano */
html body .crm-root .crm-pano {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

html body .crm-root .crm-kolon {
    background: #f8fafc;
    border: 1px solid var(--crm-kenar);
    border-top: 4px solid #94a3b8;
    border-radius: 12px;
    min-width: 0;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

html body .crm-root .crm-kolon.durum-1 { border-top-color: #2563eb; }
html body .crm-root .crm-kolon.durum-2 { border-top-color: #f59e0b; }
html body .crm-root .crm-kolon.durum-3 { border-top-color: #16a34a; }
html body .crm-root .crm-kolon.durum-4 { border-top-color: #dc2626; }

html body .crm-root .crm-kolon-baslik {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border: 0;
    border-bottom: 1px solid var(--crm-kenar);
    background: #fff;
    border-radius: 8px 8px 0 0;
    padding: 12px 14px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--crm-yazi);
    text-align: left;
    cursor: pointer;
}

html body .crm-root .crm-kolon-baslik .crm-sirala {
    color: var(--crm-soluk);
    font-size: 0.75rem;
    margin-left: 6px;
}

html body .crm-root .crm-sayi {
    background: var(--crm-ana);
    color: #fff;
    border-radius: 999px;
    min-width: 1.75rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
}

html body .crm-root .crm-kolon-govde {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    flex: 1 1 auto;
}

html body .crm-root .crm-kolon-bos {
    margin: 12px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* Kart */
html body .crm-root .crm-kart {
    position: relative;
    background: #fff;
    border: 1px solid var(--crm-kenar);
    border-left: 4px solid var(--crm-vurgu);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

html body .crm-root .crm-kart:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
}

html body .crm-root .crm-kart.tasinir {
    cursor: grab;
}

html body .crm-root .crm-kart.tasinir:active {
    cursor: grabbing;
}

html body .crm-root .crm-kart.tasiniyor {
    opacity: 0.45;
    border-style: dashed;
}

html body .crm-root .crm-pano.surukleniyor .crm-kolon {
    outline: 2px dashed #cbd5e1;
    outline-offset: -2px;
    transition: background-color 0.15s ease, outline-color 0.15s ease;
}

html body .crm-root .crm-pano.surukleniyor .crm-kolon.hedef {
    background: #eff6ff;
    outline-color: var(--crm-ana);
}

html body .crm-root .crm-pano.surukleniyor .crm-kart * {
    pointer-events: none;
}

html body .crm-root .crm-kart-ust {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

html body .crm-root .crm-oncelik {
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 10px;
}

html body .crm-root .crm-oncelik.kritik { background: #fee2e2; color: #991b1b; }
html body .crm-root .crm-oncelik.yuksek { background: #ffedd5; color: #9a3412; }
html body .crm-root .crm-oncelik.normal { background: #dbeafe; color: #1d4ed8; }
html body .crm-root .crm-oncelik.dusuk { background: #f1f5f9; color: #475569; }

html body .crm-root .crm-nokta {
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 1px;
    cursor: pointer;
    min-width: 36px;
    min-height: 32px;
    border-radius: 6px;
}

html body .crm-root .crm-nokta:hover {
    background: #f1f5f9;
}

html body .crm-root .crm-menu {
    position: absolute;
    top: 40px;
    right: 8px;
    z-index: 5;
    background: #fff;
    border: 1px solid var(--crm-kenar);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    display: flex;
    flex-direction: column;
    min-width: 160px;
    overflow: hidden;
}

html body .crm-root .crm-menu button {
    text-align: left;
    border: 0;
    background: #fff;
    color: #334155;
    padding: 9px 14px;
    font-size: 0.85rem;
    cursor: pointer;
}

html body .crm-root .crm-menu button:hover:not(:disabled) {
    background: #f1f5f9;
}

html body .crm-root .crm-konu {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--crm-yazi);
    word-break: break-word;
}

html body .crm-root .crm-no,
html body .crm-root .crm-satir,
html body .crm-root .crm-tarih {
    margin: 0;
    font-size: 0.8rem;
    color: #334155;
    word-break: break-word;
}

html body .crm-root .crm-no {
    color: var(--crm-ana);
    font-weight: 600;
}

html body .crm-root .crm-satir span,
html body .crm-root .crm-tarih span {
    color: var(--crm-soluk);
}

html body .crm-root .crm-tarih {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

html body .crm-root .crm-sorumlu {
    align-self: flex-start;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    border-radius: 999px;
    padding: 2px 10px;
    font-weight: 600;
    max-width: 100%;
}

html body .crm-root .crm-sorumlu span {
    color: #c2410c;
    font-weight: 500;
}

/* Pasif düğme fare olaylarını almadığı için ipucu sarmalayıcıda gösterilir. */
html body .crm-root .crm-menu-pasif {
    display: block;
    cursor: not-allowed;
}

html body .crm-root .crm-menu-pasif button {
    width: 100%;
    pointer-events: none;
}

html body .crm-root .crm-touch-move {
    display: none;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--crm-soluk);
}

/* Pencereler */
html body .crm-root .crm-perde {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1055;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

html body .crm-root .crm-pencere {
    width: min(960px, 100%);
    background: #fff;
    border-radius: 14px;
    margin: 24px 0;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

html body .crm-root .crm-pencere-ust,
html body .crm-root .crm-pencere-alt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
}

html body .crm-root .crm-pencere-ust {
    background: var(--crm-ana);
    color: #fff;
    border-radius: 14px 14px 0 0;
}

html body .crm-root .crm-pencere-alt {
    justify-content: flex-end;
    border-top: 1px solid var(--crm-kenar);
}

html body .crm-root .crm-pencere-ust h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

html body .crm-root .crm-kapat {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    min-width: 36px;
    min-height: 36px;
    border-radius: 8px;
}

html body .crm-root .crm-kapat:hover {
    background: rgba(255, 255, 255, 0.15);
}

html body .crm-root .crm-sekme {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 16px 18px 0;
    padding: 5px;
    background: #f1f5f9;
    border: 1px solid var(--crm-kenar);
    border-radius: 12px;
}

html body .crm-root .crm-sekme button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #475569;
    padding: 8px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

html body .crm-root .crm-sekme button i {
    font-size: 0.95rem;
    color: #94a3b8;
    transition: color 0.15s ease;
}

html body .crm-root .crm-sekme button:hover:not(.secili) {
    background: rgba(255, 255, 255, 0.7);
    color: var(--crm-yazi);
}

html body .crm-root .crm-sekme button.secili {
    background: #fff;
    color: var(--crm-ana);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

html body .crm-root .crm-sekme button.secili i {
    color: var(--crm-vurgu);
}

html body .crm-root .crm-sekme button:focus-visible {
    outline: 2px solid var(--crm-ana);
    outline-offset: 1px;
}

html body .crm-root .crm-sekme-bos {
    margin: 18px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: var(--crm-soluk);
    padding: 24px;
}

html body .crm-root .crm-sekme-bos i {
    font-size: 2rem;
    color: #94a3b8;
}

html body .crm-root .crm-sekme-bos strong {
    color: var(--crm-yazi);
    font-size: 1rem;
}

html body .crm-root .crm-form[hidden] {
    display: none;
}

html body .crm-root .crm-input.crm-kayitno {
    font-weight: 700;
    color: var(--crm-ana);
    letter-spacing: 0.02em;
}

html body .crm-root .crm-modal-hata {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 18px 14px;
}

html body .crm-root .crm-modal-hata i {
    margin-top: 2px;
}

html body .crm-root .crm-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    padding: 18px;
}

html body .crm-root .crm-form .genis,
html body .crm-root .crm-form .crm-check {
    grid-column: 1 / -1;
}

html body .crm-root .crm-form .crm-check {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

html body .crm-root .crm-form .crm-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--crm-ana);
}

html body .crm-root .crm-form .e-multiselect {
    min-height: 40px;
    border-radius: 8px;
}

html body .crm-root .crm-soru {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    margin-top: 18vh;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

html body .crm-root .crm-soru p {
    margin: 0 0 16px;
    font-size: 0.95rem;
    color: var(--crm-yazi);
}

html body .crm-root .crm-soru-alt {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

html body .crm-root .crm-modal-not {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 14px 18px 0;
    font-size: 0.82rem;
}

html body .crm-root .crm-modal-not i {
    margin-top: 2px;
}

/* Talep edenin kendi adı: açılır liste body'ye eklendiği için .crm-root dışında seçilir */
html body .e-popup .e-list-item:has(.crm-oge-pasif) {
    pointer-events: none;
    opacity: 0.5;
    background: #f8fafc;
}

html body .e-popup .crm-oge-pasif em {
    font-style: normal;
    font-size: 0.85em;
    color: #64748b;
}

/* Kaydediliyor penceresi */
html body .crm-root .crm-kayit-perde {
    z-index: 1065;
    align-items: center;
    background: rgba(15, 23, 42, 0.35);
    animation: crm-belir 0.15s ease-out;
}

html body .crm-root .crm-kayit-kutu {
    width: min(260px, 100%);
    background: #fff;
    border-radius: 16px;
    padding: 26px 22px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
    animation: crm-buyu 0.18s ease-out;
}

html body .crm-root .crm-kayit-kutu strong {
    margin-top: 10px;
    font-size: 1rem;
    color: var(--crm-yazi);
}

html body .crm-root .crm-kayit-kutu span:last-child {
    font-size: 0.8rem;
    color: var(--crm-soluk);
}

html body .crm-root .crm-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid rgba(0, 59, 149, 0.15);
    border-top-color: var(--crm-ana);
    border-right-color: var(--crm-vurgu);
    animation: crm-don 0.8s linear infinite;
}

@keyframes crm-don {
    to { transform: rotate(360deg); }
}

@keyframes crm-belir {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes crm-buyu {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    html body .crm-root .crm-spinner {
        animation-duration: 1.6s;
    }

    html body .crm-root .crm-kayit-perde,
    html body .crm-root .crm-kayit-kutu {
        animation: none;
    }
}

@media (max-width: 1199.98px) {
    html body .crm-root .crm-pano {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    html body .crm-root .crm-toolbar {
        padding: 14px;
    }

    html body .crm-root .crm-toolbar .crm-btn {
        width: 100%;
    }

    html body .crm-root .crm-pano,
    html body .crm-root .crm-form {
        grid-template-columns: minmax(0, 1fr);
    }

    html body .crm-root .crm-kolon {
        min-height: 0;
    }

    html body .crm-root .crm-sekme {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 12px 12px 0;
    }

    html body .crm-root .crm-sekme button {
        font-size: 0.8rem;
    }

    html body .crm-root .crm-touch-move {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    html body .crm-root .crm-perde {
        padding: 0;
    }

    html body .crm-root .crm-pencere {
        margin: 0;
        min-height: 100%;
        border-radius: 0;
    }

    html body .crm-root .crm-pencere-ust {
        border-radius: 0;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    html body .crm-root .crm-pencere-alt {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    html body .crm-root .crm-pencere-alt .crm-btn,
    html body .crm-root .crm-soru-alt .crm-btn {
        width: 100%;
    }

    html body .crm-root .crm-soru-alt {
        flex-direction: column-reverse;
    }
}
