﻿/* ============================================================
   TOUCH CRM STYLES
   ============================================================ */

/* -- GRID CONTAINER (matches quote-grid-container pattern) -- */
.touch-grid-container {
    background: var(--yl-white, #fff);
    border: 1px solid var(--yl-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* -- SEARCH BOX -- */
.touch-search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
    min-width: 180px;
}

.touch-search-box svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--yl-text-light);
    pointer-events: none;
}

/* -- FILTER BAR -- */
.touch-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.touch-filter-right {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
    margin-left: auto;
}

.touch-chip-btn {
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--yl-border);
    color: var(--yl-text-light);
    background: #fff;
    white-space: nowrap;
    transition: all 0.15s;
}

.touch-chip-btn:hover {
    background: #f0f2f5;
}

.touch-chip-btn.active-all { border-color: #0C447C; color: #0C447C; background: #e8eef5; }
.touch-chip-btn.active-hot { border-color: #A32D2D; color: #fff; background: #DC2828; }
.touch-chip-btn.active-warm { border-color: #854F0B; color: #fff; background: #DC8200; }
.touch-chip-btn.active-cold { border-color: #185FA5; color: #fff; background: #3C82C8; }
.touch-chip-btn.active-open { border-color: #534AB7; color: #534AB7; background: #EEEDFE; }
.touch-chip-btn.active-order { border-color: #3B6D11; color: #3B6D11; background: #EAF3DE; }
.touch-chip-btn.active-draft  { color: #3C5A8C; background: #E6ECF5; border-color: #3C5A8C; }
.touch-chip-btn.active-closed { color: #5F5E5A; background: #F1EFE8; border-color: #D3D1C7; }

.touch-filter-select {
    padding: 6px 28px 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--yl-border);
    background: #fff;
    color: var(--yl-text);
    font-size: 0.78rem;
    height: 32px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

.touch-filter-select:focus {
    border-color: var(--yl-accent, #3B7DDD);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,125,221,0.1);
}

.touch-search {
    width: 100%;
    padding: 6px 10px 6px 32px;
    border-radius: 6px;
    border: 1px solid var(--yl-border);
    background: #f8f9fa;
    font-size: 0.78rem;
    height: 32px;
    box-sizing: border-box;
}

.touch-search:focus {
    border-color: var(--yl-accent, #3B7DDD);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,125,221,0.1);
}

/* -- MAIN LAYOUT -- */
.touch-layout {
    display: flex;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.touch-list-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: flex 0.3s;
}

.touch-list-panel.with-detail {
    flex: 0.55;
}

/* -- TABLE -- */
.touch-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.touch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
    font-variant-numeric: tabular-nums;
    line-height: 1.45;
}

.touch-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.touch-table th {
    background: #f8f9fb;
    color: #6b7280;
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 1px solid #d0d5dd;
    white-space: nowrap;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    user-select: none;
}

.touch-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #eef0f3;
    color: var(--yl-text);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.touch-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.touch-table tbody tr:hover {
    background: #f5f7fa;
}

.touch-table tbody tr.active-row {
    background: #f8fafd;
    box-shadow: inset 3px 0 0 var(--yl-accent, #3B7DDD);
}

.touch-table tbody tr:last-child td {
    border-bottom: none;
}

/* Overdue dot */
.overdue-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #A32D2D;
    display: inline-block;
    margin-right: 3px;
}

.today-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #DC8200;
    display: inline-block;
    margin-right: 3px;
}

/* -- DETAIL PANEL -- */
.touch-detail-panel {
    width: 580px;
    flex-shrink: 0;
    background: #fff;
    border-left: 1px solid var(--yl-border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 12px rgba(0,0,0,0.06);
    animation: slideIn 0.25s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.touch-panel-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--yl-border);
    flex-shrink: 0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}

.touch-panel-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.touch-panel-sub {
    font-size: 0.78rem;
    color: var(--yl-text-light);
    margin-top: 3px;
}

.touch-panel-close {
    margin-left: auto;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--yl-text-light);
    padding: 2px 7px;
    border-radius: 4px;
    background: none;
    border: none;
}

.touch-panel-close:hover {
    background: #f0f2f5;
}

.touch-panel-body {
    flex: 1;
    padding: 20px;
}

/* -- INFO GRID -- */
.touch-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.touch-info-item label {
    font-size: 0.65rem;
    color: var(--yl-text-light);
    display: block;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.touch-info-item span {
    font-size: 0.85rem;
    font-weight: 600;
}

/* -- SECTION TITLE -- */
.touch-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--yl-text-light);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--yl-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* -- NEXT TOUCH BANNER -- */
.touch-next-banner {
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    border: 1px dashed;
}

.touch-next-ok {
    background: #E6F1FB;
    border-color: #B5D4F4;
}

.touch-next-ok .banner-label,
.touch-next-ok .banner-date {
    color: #185FA5;
}

.touch-next-overdue {
    background: #FCEBEB;
    border-color: #f7c1c1;
}

.touch-next-overdue .banner-label,
.touch-next-overdue .banner-date {
    color: #A32D2D;
}

.touch-next-today {
    background: #FAEEDA;
    border-color: #FAC775;
}

.touch-next-today .banner-label,
.touch-next-today .banner-date {
    color: #854F0B;
}

.banner-label {
    font-size: 0.72rem;
    font-weight: 700;
}

.banner-date {
    font-size: 0.85rem;
    font-weight: 700;
}

/* -- TIMELINE -- */
.touch-timeline {
    position: relative;
}

.tl-entry {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
    position: relative;
}

.tl-line {
    position: absolute;
    left: 15px;
    top: 34px;
    bottom: 0;
    width: 1px;
    background: var(--yl-border);
}

.tl-entry:last-child .tl-line {
    display: none;
}

.tl-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f0f2f5;
    border: 2px solid var(--yl-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
    z-index: 1;
    margin-top: 2px;
    color: #185FA5;
}

.tl-dot-revision {
    border-radius: 8px;
    background: #0C447C;
    color: #fff;
    border-color: #0C447C;
}

.tl-card {
    flex: 1;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px 13px;
    margin-bottom: 10px;
    border: 1px solid var(--yl-border);
}

.tl-card-revision {
    background: #E6F1FB;
    border-color: #B5D4F4;
}

.tl-card-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.tl-date {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--yl-text);
}

.tl-who {
    font-size: 0.65rem;
    color: var(--yl-text-light);
    background: #fff;
    border: 1px solid var(--yl-border);
    padding: 1px 7px;
    border-radius: 10px;
}

.tl-type-call { background: #E6F1FB; color: #185FA5; font-size: 0.65rem; padding: 1px 7px; border-radius: 10px; }
.tl-type-mail { background: #EAF3DE; color: #3B6D11; font-size: 0.65rem; padding: 1px 7px; border-radius: 10px; }
.tl-type-visit { background: #EEEDFE; color: #534AB7; font-size: 0.65rem; padding: 1px 7px; border-radius: 10px; }
.tl-type-note { background: #FAEEDA; color: #854F0B; font-size: 0.65rem; padding: 1px 7px; border-radius: 10px; }
.tl-type-meeting { background: #E6F8EC; color: #1E823C; font-size: 0.65rem; padding: 1px 7px; border-radius: 10px; }

.tl-mgmt-badge {
    font-size: 0.65rem;
    padding: 1px 7px;
    border-radius: 10px;
    background: #EAF3DE;
    color: #3B6D11;
    font-weight: 700;
}

.tl-edit-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--yl-text-light);
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}
.tl-card:hover .tl-edit-btn {
    opacity: 1;
}
.tl-edit-btn:hover {
    background: rgba(0,0,0,0.07);
    color: var(--yl-primary);
}

.tl-note-text {
    font-size: 0.78rem;
    color: var(--yl-text);
    line-height: 1.6;
    white-space: pre-wrap;
}

.tl-next-touch {
    font-size: 0.72rem;
    color: #185FA5;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.tl-revision-price {
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: auto;
}

.tl-revision-note {
    font-size: 0.72rem;
    color: #185FA5;
    line-height: 1.5;
    font-style: italic;
}

/* -- ACTION BUTTONS -- */
.touch-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.touch-btn {
    padding: 7px 15px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--yl-border);
    background: #fff;
    color: var(--yl-text);
    transition: background 0.12s;
}

.touch-btn:hover {
    background: #f0f2f5;
}

.touch-btn-primary {
    background: #185FA5;
    color: #fff;
    border-color: #185FA5;
}

.touch-btn-primary:hover {
    background: #0C447C;
}

/* -- FORM (used in modals) -- */
.touch-form {
    background: #f8f9fa;
    border: 1px solid var(--yl-border);
    border-radius: 10px;
    padding: 15px;
    margin-top: 12px;
}

.touch-form-revision {
    border-color: #B5D4F4;
    background: #f0f6ff;
}

.touch-form-title {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #0C447C;
}

.touch-form-row {
    margin-bottom: 10px;
}

.touch-form-row label {
    display: block;
    font-size: 0.7rem;
    color: var(--yl-text-light);
    margin-bottom: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.touch-form-row input,
.touch-form-row select,
.touch-form-row textarea {
    width: 100%;
    padding: 7px 9px;
    border-radius: 8px;
    border: 1px solid var(--yl-border);
    background: #fff;
    color: var(--yl-text);
    font-size: 0.78rem;
}

.touch-form-row textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.touch-form-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.touch-form-grid3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.touch-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

/* -- STATUS CHIPS (extends quotes.css) — notr/renksiz */
.chip-open,
.chip-order,
.chip-closed { background: #f1f3f5; color: #374151; border: 1px solid #d1d5db; }
/* -- DARK MODE (Touch CRM) -- */
.app-root.dark .touch-grid-container { box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.app-root.dark .touch-table-wrap { background: var(--yl-bg); }
.app-root.dark .touch-table th { background: #161b22; border-bottom-color: #30363d; color: #8b949e; }
.app-root.dark .touch-table td { border-bottom-color: #21262d; }
.app-root.dark .touch-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.app-root.dark .touch-table tbody tr.active-row { background: rgba(59,125,221,0.06); box-shadow: inset 3px 0 0 var(--yl-accent); }
.app-root.dark .touch-detail-panel { background: var(--yl-bg); border-color: var(--yl-border); }
.app-root.dark .tl-card { background: var(--yl-bg); border-color: var(--yl-border); }
.app-root.dark .touch-form { background: var(--yl-bg); border-color: var(--yl-border); }
.app-root.dark .touch-chip-btn { background: var(--yl-bg); border-color: var(--yl-border); }
.app-root.dark .touch-search { background: #161b22; border-color: var(--yl-border); color: var(--yl-text); }
.app-root.dark .touch-search-box svg { color: #6b7280; }
.app-root.dark .touch-filter-select { background-color: #161b22; border-color: var(--yl-border); color: var(--yl-text); background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238b949e' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); }


/* ══ @KULLANICI ETIKETLEME ═════════════════════════════════════════════
   Not alanindaki "@" acilir listesi + notlarda etiket vurgusu.
   Keskin kose kurali (border-radius: 0) gecerli. */
.etn-wrap { position: relative; display: block; }
.etn-wrap .etn-text { width: 100%; box-sizing: border-box; }

.etn-perde {
    position: fixed;
    inset: 0;
    /* Listenin (950) HEMEN ALTINDA. Bak: .etn-liste */
    z-index: 949;
    background: transparent;
}
.etn-liste {
    position: absolute;
    /* PROJE KATMAN OLCEGI:  kenar cubugu 100 < ulke secici 500 < arac cubugu
       acilir listesi 900 < ETIKETLEME 950 < pencereler/modal 999+.
       Bu deger tek basina YETMEZ: ata bir eleman katman baglami yaratiyorsa
       (position+z-index, transform, opacity<1, filter...) liste o baglamin
       DISINA cikamaz. O yuzden kullanildigi yerde ata elemana da
       ":focus-within { z-index: 950 }" verilir — bkz. .dash-tl-item. */
    z-index: 950;
    left: 0;
    right: 0;
    top: 100%;
    max-height: 232px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--yl-border, #cbd5e1);
    border-radius: 0;
    box-shadow: 0 6px 18px rgba(15,23,42,0.14);
}
.etn-baslik {
    padding: 5px 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--yl-text-light, #64748b);
    border-bottom: 1px solid var(--yl-border, #e2e8f0);
    background: #f8fafc;
}
.etn-oge {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border: none;
    border-radius: 0;
    /* Acikca OPAK: sadece listenin beyazina guvenmek, ata katman sirasi
       bozuldugunda altindaki metnin sizmasina yol aciyordu. */
    background: #fff;
    text-align: left;
    cursor: pointer;
    font-size: 0.8rem;
}
.etn-oge:hover, .etn-oge.etn-secili { background: #eef2f8; }
.etn-ad { font-weight: 600; color: var(--yl-text, #0f172a); }
.etn-kullanici { font-size: 0.72rem; color: var(--yl-primary, #185fa5); }

.app-root.dark .etn-liste { background: #161b22; border-color: #3a4250; }
.app-root.dark .etn-baslik { background: #1c2128; border-bottom-color: #3a4250; }
.app-root.dark .etn-oge { background: #161b22; }
.app-root.dark .etn-oge:hover, .app-root.dark .etn-oge.etn-secili { background: #21262d; }

/* Notta gecen etiket — okurken goze carpsin */
.etn-mention {
    color: var(--yl-primary, #185fa5);
    font-weight: 700;
    background: rgba(24,95,165,0.10);
    padding: 0 2px;
}
.app-root.dark .etn-mention { color: #7cb3ea; background: rgba(124,179,234,0.16); }
