/* ============================================================
   İŞ TAKİP — UYGULAMA TASARIMI
   Compact • Modern • Kurumsal • Müşteri dostu
   ============================================================ */

:root {
    --brand: #4f46e5;
    --brand-2: #6366f1;
    --brand-dark: #4338ca;
    --app-bg: #eef1f7;
    --surface: #ffffff;
    --border: #e3e8f0;
    --border-2: #d5dce8;
    --text: #1e293b;
    --muted: #6b7688;
    --dark: #0f172a;
    --green: #16a34a;
    --red: #dc2626;
    --amber: #d97706;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 4px 18px rgba(15, 23, 42, .07);
    --sidebar-w: 250px;
}

* { -webkit-tap-highlight-color: transparent; }

html { font-size: 14px; }

body {
    background: var(--app-bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Genel komponent sıkılaştırmaları ---------- */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: .92rem;
    padding: .65rem 1rem;
}
.card-body { padding: 1rem; }

.btn { border-radius: 8px; font-weight: 600; }
.btn-sm { border-radius: 7px; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); }
.btn-icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 8px; }

.form-control, .form-select, .input-group-text {
    border-radius: 8px;
    border-color: var(--border-2);
    font-size: .92rem;
}
.form-control:focus, .form-select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 .2rem rgba(99, 102, 241, .15); }
.form-label { font-size: .8rem; font-weight: 600; margin-bottom: .3rem; color: #3b4557; }
.form-text { font-size: .75rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

.dropdown-menu { border-radius: 10px; border-color: var(--border); box-shadow: var(--shadow); font-size: .9rem; }
.dropdown-item { padding: .45rem .9rem; border-radius: 7px; }
.dropdown-item i { color: var(--muted); }

.modal-content { border: 0; border-radius: 16px; box-shadow: var(--shadow); }
.modal-header { border-bottom: 1px solid var(--border); padding: .85rem 1.2rem; }
.modal-title { font-weight: 700; }
.modal-body { padding: 1.2rem; }
.modal-footer { border-top: 1px solid var(--border); }

.alert { border-radius: 10px; border: 0; }
.alert-dismissible .btn-close { padding: .9rem; }

.badge { font-weight: 600; border-radius: 6px; font-size: .68rem; padding: .32em .6em; }
.badge-lg { font-size: .78rem; padding: .42em .7em; }

.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; color: #fff; font-weight: 700; flex: 0 0 auto;
    letter-spacing: .3px; user-select: none;
}
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }

.text-muted { color: var(--muted) !important; }
a { color: var(--brand); }
hr { opacity: 1; border-color: var(--border); }

/* ---------- Top Bar ---------- */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1030;
    box-shadow: 0 1px 6px rgba(15,23,42,.04);
    height: 58px;
}
.brand {
    display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text);
}
.brand-logo {
    width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--brand-2), var(--brand-dark));
    color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem;
    box-shadow: 0 4px 10px rgba(79,70,229,.35);
}
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -.2px; line-height: 1.1; }
.brand-sub { font-size: .66rem; color: var(--muted); font-weight: 500; letter-spacing: .4px; }

.topnav-link {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .42rem .8rem; border-radius: 9px; color: #475569; font-weight: 600;
    font-size: .86rem; text-decoration: none; white-space: nowrap;
}
.topnav-link i { font-size: 1rem; }
.topnav-link:hover { background: #eef0ff; color: var(--brand); }
.topnav-link.active { background: #eef0ff; color: var(--brand); }

.icon-btn {
    width: 38px; height: 38px; border-radius: 10px; position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    color: #475569; text-decoration: none; font-size: 1.15rem; background: transparent; border: 0;
}
.icon-btn:hover { background: #eef0ff; color: var(--brand); }
.icon-btn .count-badge {
    position: absolute; top: 2px; right: 0;
    min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    background: var(--red); color: #fff; font-size: .62rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px #fff;
}

.bell-panel { width: 360px; max-width: 92vw; }
.bell-panel .notif-item { display: flex; gap: .7rem; padding: .6rem .8rem; border-radius: 10px; text-decoration: none; color: inherit; }
.bell-panel .notif-item:hover { background: #f5f6ff; }
.bell-panel .notif-ico { width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.bell-panel .notif-unread { background: #f1f2ff; }

.user-chip { display: flex; align-items: center; gap: .55rem; padding: .25rem .5rem .25rem .25rem; border-radius: 30px; text-decoration: none; color: var(--text); }
.user-chip:hover { background: #eef0ff; }

/* ---------- Sayfa & içerik ---------- */
.page-wrap { max-width: 1440px; margin: 0 auto; }
.page-head { padding: 1.1rem 0 .9rem; }

.empty-state {
    text-align: center; color: var(--muted); padding: 2.2rem 1rem;
}
.empty-state i { font-size: 2.4rem; opacity: .5; display: block; margin-bottom: .5rem; }

/* ---------- İstatistik kartları ---------- */
.stat-card { display: flex; align-items: center; gap: .85rem; }
.stat-ico {
    width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.stat-num { font-size: 1.5rem; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.stat-lbl { font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }

.ico-blue  { background: #eef0ff; color: var(--brand); }
.ico-green { background: #e7f7ee; color: var(--green); }
.ico-red   { background: #fee9e9; color: var(--red); }
.ico-amber { background: #fef3e2; color: var(--amber); }
.ico-purple{ background: #f1ecff; color: #7c3aed; }
.ico-cyan  { background: #e3f5fb; color: #0e7490; }

/* ---------- Firma / Proje kartları ---------- */
.firma-item {
    display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem;
    border-radius: 10px; text-decoration: none; color: var(--text);
}
.firma-item:hover { background: #eef0ff; }
.firma-item.active { background: #e6e8ff; }
.firma-badge {
    width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem;
}
.firma-star { color: #f59e0b; font-size: .7rem; }

.proj-card { transition: transform .12s ease, box-shadow .12s ease; }
.proj-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.proj-card .proj-title { font-weight: 700; color: var(--text); text-decoration: none; }
.proj-card .proj-title:hover { color: var(--brand); }

/* ---------- Info liste ---------- */
.info-row { display: flex; justify-content: space-between; gap: 1rem; padding: .42rem 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.info-row:last-child { border-bottom: 0; }
.info-row .k { color: var(--muted); font-weight: 500; }
.info-row .v { text-align: right; font-weight: 600; }

/* ---------- Dikey menü (firma) ---------- */
.vnav { display: flex; flex-direction: column; gap: 2px; }
.vnav .vn-link {
    display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 9px;
    color: #94a3b8; text-decoration: none; font-weight: 500; font-size: .88rem;
}
.vnav .vn-link i { font-size: .95rem; width: 20px; text-align: center; }
.vnav .vn-link:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.vnav .vn-link.active { background: var(--brand); color: #fff; }
.vnav .vn-link .vn-note { margin-left: auto; font-size: .66rem; opacity: .8; }

.sidebar-dark {
    background: var(--dark); border-radius: var(--radius); color: #cbd5e1;
}
.sidebar-dark .sd-head { padding: 1rem 1rem .4rem; font-size: .7rem; letter-spacing: 1px; color: #64748b; font-weight: 700; }

/* ---------- Sekmeler ---------- */
.tabs-scroll { overflow-x: auto; scrollbar-width: none; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.work-tab {
    display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1rem; margin-right: .2rem;
    color: #475569; font-weight: 600; font-size: .86rem; text-decoration: none; border-radius: 10px 10px 0 0;
    border: 1px solid transparent; border-bottom: 0; white-space: nowrap;
}
.work-tab.active { background: var(--surface); border-color: var(--border); color: var(--brand); box-shadow: var(--shadow-sm); }
.work-tab:hover:not(.active) { background: rgba(255,255,255,.5); color: var(--brand); }

/* ---------- Yazışma (chat) ---------- */
.chat-layout { display: flex; gap: 1rem; min-height: calc(100vh - 300px); }

.chat-box {
    display: flex; flex-direction: column; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.chat-msgs {
    flex: 1; overflow-y: auto; padding: 1rem;
    background: #f7f8fc;
    background-image: radial-gradient(#e6e9f2 1px, transparent 1px);
    background-size: 18px 18px;
}
.msg-row { display: flex; gap: .6rem; margin-bottom: .9rem; }
.msg-row .msg-side { flex: 0 0 auto; }
.msg-mine { flex-direction: row-reverse; }
.msg-bubble {
    max-width: 74%; background: #fff; border: 1px solid var(--border);
    border-radius: 4px 14px 14px 14px; padding: .55rem .8rem;
    box-shadow: var(--shadow-sm);
}
.msg-mine .msg-bubble {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff; border: 0; border-radius: 14px 4px 14px 14px;
}
.msg-author { font-size: .74rem; font-weight: 700; margin-bottom: .15rem; color: var(--brand); display: block; }
.msg-mine .msg-author { color: rgba(255,255,255,.85); }
.msg-text { white-space: pre-wrap; word-break: break-word; font-size: .9rem; }
.msg-time { font-size: .66rem; color: var(--muted); display: block; margin-top: .25rem; text-align: right; }
.msg-mine .msg-time { color: rgba(255,255,255,.7); }
.msg-task-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .68rem; font-weight: 600; margin-bottom: .35rem; }
.msg-attach { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.55); border: 1px solid var(--border); border-radius: 8px; padding: .3rem .55rem; font-size: .78rem; margin-top: .35rem; text-decoration: none; color: var(--text); max-width: 100%; }
.msg-mine .msg-attach { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; }

.chat-composer { border-top: 1px solid var(--border); padding: .6rem .8rem; background: #fff; }
.chat-composer textarea { border: 0; resize: none; box-shadow: none !important; max-height: 120px; padding: .4rem .2rem; font-size: .9rem; }
.chat-composer textarea:focus { border: 0; }
.attach-label { cursor: pointer; color: var(--muted); }
.attach-label:hover { color: var(--brand); }

/* ---------- İş öğeleri ---------- */
.task-item {
    display: flex; align-items: flex-start; gap: .7rem; padding: .65rem .75rem;
    border: 1px solid var(--border); border-radius: 10px; background: #fff;
    transition: box-shadow .12s ease; cursor: pointer; text-decoration: none; color: var(--text);
}
.task-item:hover { box-shadow: var(--shadow); border-color: var(--border-2); }
.task-item.selected { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(79,70,229,.15); }
.task-check { margin-top: 2px; }
.task-title { font-weight: 600; font-size: .9rem; }
.task-meta { font-size: .75rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .2rem; }
.task-meta span i { margin-right: .2rem; }

.status-mini { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- Timeline (geçmiş) ---------- */
.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--border); margin-left: .3rem; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
    content: ""; position: absolute; left: -6px; top: 2px; width: 10px; height: 10px;
    border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 2px #cdd4ff;
}
.timeline .tl-time { font-size: .7rem; color: var(--muted); }
.timeline .tl-txt { font-size: .84rem; color: var(--text); }

/* ---------- Dosya listesi ---------- */
.file-item { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.file-item:hover { border-color: var(--border-2); }
.file-ico { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex: 0 0 auto; }

/* ---------- Not defteri ---------- */
.note-item { border: 1px solid var(--border); border-left: 4px solid var(--amber); border-radius: 10px; padding: .8rem 1rem; background: #fffdf5; white-space: pre-wrap; }
.note-time { font-size: .7rem; color: var(--muted); }

/* ---------- Yardımcılar ---------- */
.cursor-pointer { cursor: pointer; }
.fs-xs { font-size: .72rem; }
.fs-xs2 { font-size: .78rem; }
.fs-sm2 { font-size: .82rem; }
.min-w-0 { min-width: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fw-600 { font-weight: 600; }
.divider { border-top: 1px dashed var(--border-2); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid #fff; margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* Koyu sidebar içinde arama girişi */
.inp-dark { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); color: #e2e8f0; }
.inp-dark::placeholder { color: #64748b; }
.inp-dark:focus { background: rgba(255,255,255,.1); color: #fff; border-color: var(--brand); box-shadow: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c6cdd9; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aab3c2; background-clip: content-box; }

/* Login */
.login-bg {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(1000px 500px at 10% -10%, #4f46e5, transparent), radial-gradient(800px 500px at 110% 20%, #4338ca, transparent), var(--dark);
    padding: 1rem;
}
.login-card { width: 100%; max-width: 410px; }
.feature-tick li { list-style: none; display: flex; gap: .5rem; align-items: center; padding: .3rem 0; color: #cbd5e1; font-size: .85rem; }

/* ---------- Dashboard: Tüm Firmalar · Açık İşler ---------- */
.firm-group {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .45rem .6rem .6rem;
    background: #fff;
}
.firm-group-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem .1rem .5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .55rem;
}
.firm-group-head .firma-name { min-width: 0; }
.firm-group-head .badge { white-space: nowrap; }
/* Yeni/önemli öğeleri vurgulayan canlı nokta */
.live-dot {
    display: inline-block;
    width: 7px; height: 7px; border-radius: 50%;
    background: currentColor;
    margin-right: .35rem;
    vertical-align: middle;
    animation: livepulse 1.4s ease-in-out infinite;
}
@keyframes livepulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .35; transform: scale(.7); }
}

/* Mobil */
@media (max-width: 991px) {
    .msg-bubble { max-width: 88%; }
    .chat-layout { flex-direction: column; }
}
