/* ==========================================================================
   AC Freelance - Panel Tasarimi
   Bootstrap 5 uzerine kurulu, acik tema, modern SaaS gorunumu
   ========================================================================== */

:root {
    --brand:        #4f46e5;
    --brand-dark:   #4338ca;
    --brand-soft:   #eef2ff;
    --brand-ring:   rgba(79, 70, 229, .18);

    --bg:           #f4f6fb;
    --surface:      #ffffff;
    --surface-2:    #fafbfd;
    --border:       #e7e9f0;
    --border-soft:  #f0f2f6;

    --text:         #0f172a;
    --text-muted:   #64748b;
    --text-faint:   #94a3b8;

    --success:      #10b981;
    --success-soft: #ecfdf5;
    --warning:      #f59e0b;
    --warning-soft: #fffbeb;
    --danger:       #ef4444;
    --danger-soft:  #fef2f2;
    --info:         #0ea5e9;
    --info-soft:    #f0f9ff;

    --radius:       14px;
    --radius-sm:    10px;
    --radius-lg:    18px;

    --shadow-xs:    0 1px 2px rgba(16, 24, 40, .05);
    --shadow-sm:    0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-md:    0 4px 16px -6px rgba(16, 24, 40, .12), 0 2px 4px rgba(16, 24, 40, .04);
    --shadow-lg:    0 24px 48px -24px rgba(16, 24, 40, .28);

    --sidebar-w:    264px;
    --topbar-h:     68px;
}

/* ---------- Temel ---------- */
* { -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: .9375rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

::selection { background: var(--brand-ring); }

/* Ince kaydirma cubugu */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d7dbe5; border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #c2c8d6; }

/* ---------- Iskelet ---------- */
.app-shell { min-height: 100vh; }

.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .2s ease;
}

.content {
    padding: 26px 30px 60px;
    flex: 1 1 auto;
    max-width: 1600px;
    width: 100%;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1045;
    transition: transform .22s ease;
}

.sidebar-brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-soft);
    flex: 0 0 auto;
}

.brand-mark {
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--brand) 0%, #7c3aed 100%);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: .95rem; letter-spacing: .5px;
    box-shadow: 0 6px 14px -6px var(--brand);
    flex: 0 0 auto;
    overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.brand-text { line-height: 1.15; min-width: 0; }
.brand-text strong { display: block; font-size: .98rem; font-weight: 650; letter-spacing: -.2px; }
.brand-text span { font-size: .72rem; color: var(--text-faint); }

.sidebar-nav {
    padding: 16px 12px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.nav-label {
    font-size: .69rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-faint);
    font-weight: 600;
    padding: 0 12px;
    margin: 18px 0 8px;
}
.nav-label:first-child { margin-top: 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9.5px 12px;
    border-radius: var(--radius-sm);
    color: #475569;
    font-weight: 500;
    font-size: .895rem;
    margin-bottom: 2px;
    transition: background .14s ease, color .14s ease;
    position: relative;
}
.nav-item i { font-size: 1.06rem; width: 20px; text-align: center; color: var(--text-faint); transition: color .14s ease; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover i { color: var(--text-muted); }

.nav-item.active {
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 600;
}
.nav-item.active i { color: var(--brand); }
.nav-item.active::before {
    content: '';
    position: absolute; left: -12px; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--brand);
}

.nav-item .badge-count {
    margin-left: auto;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: .7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
}

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--border-soft);
    flex: 0 0 auto;
}

.sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 1040;
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}
body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }

/* ---------- Topbar ---------- */
.topbar {
    height: var(--topbar-h);
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-title { min-width: 0; }
.topbar-title h1 {
    font-size: 1.075rem;
    font-weight: 650;
    margin: 0;
    letter-spacing: -.25px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-title p { margin: 0; font-size: .78rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.global-search {
    position: relative;
    width: 320px;
    max-width: 34vw;
    margin-left: auto;
}
.global-search i {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: var(--text-faint); font-size: .95rem; pointer-events: none;
}
.global-search input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 10px;
    padding: 0 12px 0 38px;
    font-size: .875rem;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.global-search input::placeholder { color: var(--text-faint); }
.global-search input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 3.5px var(--brand-ring);
}

.icon-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    display: inline-grid; place-items: center;
    font-size: 1.05rem;
    position: relative;
    transition: all .14s ease;
    flex: 0 0 auto;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: #dcdfe8; }
.icon-btn .dot {
    position: absolute; top: 8px; right: 9px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--danger);
    border: 2px solid var(--surface);
}

.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 10px 5px 5px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: all .14s ease;
}
.user-chip:hover { background: var(--surface-2); border-color: #dcdfe8; }

.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, #7c3aed 100%);
    color: #fff;
    display: grid; place-items: center;
    font-size: .74rem; font-weight: 650;
    flex: 0 0 auto;
}
.avatar.avatar-lg { width: 44px; height: 44px; font-size: .95rem; }

.user-chip-name { font-size: .84rem; font-weight: 550; color: var(--text); line-height: 1.1; white-space: nowrap; }
.user-chip-role { font-size: .7rem; color: var(--text-faint); white-space: nowrap; }

/* ---------- Kartlar ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-soft);
    padding: 16px 20px;
    display: flex; align-items: center; gap: 12px;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-header h2, .card-header h3, .card-header h5 {
    font-size: .96rem; font-weight: 620; margin: 0; letter-spacing: -.15px;
}
.card-body { padding: 20px; }
.card-footer { background: var(--surface-2); border-top: 1px solid var(--border-soft); padding: 13px 20px; }

/* Istatistik karti */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-xs);
    height: 100%;
    transition: box-shadow .18s ease, transform .18s ease;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-label {
    font-size: .78rem; color: var(--text-muted); font-weight: 500;
    margin-bottom: 6px;
    line-height: 1.25;
    min-height: 2.5em;           /* tam iki satir: tek satirlik etiketlerde de deger hizasi bozulmaz */
    display: flex; align-items: flex-start;
}
.stat-value { font-size: 1.55rem; font-weight: 680; letter-spacing: -.6px; line-height: 1.15; }
.stat-sub { font-size: .765rem; color: var(--text-faint); margin-top: 5px; }
.stat-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.15rem;
    flex: 0 0 auto;
}
.stat-icon.brand   { background: var(--brand-soft);   color: var(--brand); }
.stat-icon.success { background: var(--success-soft); color: var(--success); }
.stat-icon.warning { background: var(--warning-soft); color: var(--warning); }
.stat-icon.danger  { background: var(--danger-soft);  color: var(--danger); }
.stat-icon.info    { background: var(--info-soft);    color: var(--info); }

/* ---------- Tablolar ---------- */
.table-card { overflow: hidden; }
.table-card .table { margin: 0; }
.table {
    --bs-table-bg: transparent;
    color: var(--text);
    font-size: .875rem;
}
.table > thead > tr > th {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .755rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 11px 16px;
    white-space: nowrap;
}
.table > tbody > tr > td { padding: 13px 16px; border-color: var(--border-soft); vertical-align: middle; }
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { background: var(--surface-2); }

/* ---------- Rozetler ---------- */
.badge-soft {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .745rem; font-weight: 600;
    padding: 4px 10px; border-radius: 999px;
    line-height: 1.35;
}
.badge-soft.gray    { background: #f1f5f9; color: #475569; }
.badge-soft.blue    { background: var(--info-soft);    color: #0369a1; }
.badge-soft.green   { background: var(--success-soft); color: #047857; }
.badge-soft.orange  { background: var(--warning-soft); color: #b45309; }
.badge-soft.red     { background: var(--danger-soft);  color: #b91c1c; }
.badge-soft.purple  { background: #f5f3ff; color: #6d28d9; }
.badge-soft.indigo  { background: var(--brand-soft);   color: var(--brand-dark); }
.badge-soft.yellow  { background: #fefce8; color: #a16207; }

.dot-color { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

/* ---------- Butonlar ---------- */
.btn { font-size: .875rem; font-weight: 550; border-radius: var(--radius-sm); padding: .5rem .95rem; }
.btn-lg { padding: .7rem 1.2rem; font-size: .95rem; }
.btn-sm { padding: .34rem .7rem; font-size: .8rem; border-radius: 8px; }

.btn-primary {
    background: var(--brand); border-color: var(--brand);
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
.btn-primary:hover, .btn-primary:focus { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-primary:focus-visible { box-shadow: 0 0 0 3.5px var(--brand-ring); }

.btn-light-soft {
    background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
}
.btn-light-soft:hover { background: var(--surface-2); color: var(--text); border-color: #dcdfe8; }

.btn-outline-secondary { border-color: var(--border); color: var(--text-muted); }
.btn-outline-secondary:hover { background: var(--surface-2); border-color: #dcdfe8; color: var(--text); }

/* Secim butonlari (btn-check) - marka rengiyle yumusak dolgu */
.btn-check:checked + .btn-outline-secondary,
.btn-check:active + .btn-outline-secondary {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand-dark);
    font-weight: 600;
}
.btn-check:focus-visible + .btn-outline-secondary { box-shadow: 0 0 0 3.5px var(--brand-ring); }

/* ---------- Formlar ---------- */
.form-label { font-size: .82rem; font-weight: 550; color: #334155; margin-bottom: 6px; }
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .55rem .8rem;
    font-size: .89rem;
    color: var(--text);
    background-color: var(--surface);
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3.5px var(--brand-ring);
}
.form-control::placeholder { color: var(--text-faint); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); }
.form-text { font-size: .78rem; color: var(--text-faint); }
.input-group-text { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); font-size: .85rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3.5px var(--brand-ring); border-color: var(--brand); }
.form-check-label { font-size: .875rem; color: #475569; }

/* ---------- Ilerleme ---------- */
.progress { height: 7px; background: #eef1f6; border-radius: 999px; }
.progress-bar { background: var(--brand); border-radius: 999px; }

/* ---------- Dropdown ---------- */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    font-size: .875rem;
    min-width: 220px;
}
.dropdown-item { border-radius: 8px; padding: .5rem .7rem; color: #475569; display: flex; align-items: center; gap: 10px; }
.dropdown-item i { font-size: 1rem; color: var(--text-faint); width: 18px; text-align: center; }
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.dropdown-item.text-danger:hover { background: var(--danger-soft); color: var(--danger) !important; }
.dropdown-item.text-danger i { color: var(--danger); }
.dropdown-header { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 600; padding: 8px 10px 4px; }
.dropdown-divider { border-color: var(--border-soft); margin: 5px 0; }

/* ---------- Uyarilar ---------- */
.alert { border: 1px solid transparent; border-radius: var(--radius); font-size: .875rem; padding: .8rem 1rem; }
.alert-success { background: var(--success-soft); border-color: #a7f3d0; color: #065f46; }
.alert-danger  { background: var(--danger-soft);  border-color: #fecaca; color: #991b1b; }
.alert-warning { background: var(--warning-soft); border-color: #fde68a; color: #92400e; }
.alert-info    { background: var(--info-soft);    border-color: #bae6fd; color: #075985; }

/* ---------- Bos durum ---------- */
.empty-state { text-align: center; padding: 54px 24px; }
.empty-state .icon {
    width: 62px; height: 62px; border-radius: 18px;
    background: var(--surface-2); border: 1px solid var(--border);
    display: grid; place-items: center; margin: 0 auto 16px;
    font-size: 1.6rem; color: var(--text-faint);
}
.empty-state h3 { font-size: 1rem; font-weight: 620; margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); font-size: .875rem; max-width: 420px; margin: 0 auto 18px; }

/* ---------- Sayfa basligi bolumu ---------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 1.4rem; font-weight: 680; letter-spacing: -.5px; margin: 0 0 3px; }
.page-head p { color: var(--text-muted); font-size: .875rem; margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------- Giris ekrani ---------- */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--bg);
}
.auth-wrap { display: grid; place-items: center; padding: 32px 20px; }
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 36px 34px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-card h1 { font-size: 1.35rem; font-weight: 680; letter-spacing: -.4px; margin: 0 0 5px; }
.auth-card .sub { color: var(--text-muted); font-size: .875rem; margin-bottom: 24px; }
.auth-side {
    display: none;
    background: linear-gradient(150deg, #4f46e5 0%, #6d28d9 55%, #4c1d95 100%);
    color: #fff;
    padding: 56px;
    position: relative;
    overflow: hidden;
}
.auth-side::after {
    content: '';
    position: absolute; inset: auto -120px -180px auto;
    width: 460px; height: 460px; border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.auth-side::before {
    content: '';
    position: absolute; inset: -140px auto auto -100px;
    width: 340px; height: 340px; border-radius: 50%;
    background: rgba(255,255,255,.06);
}
.auth-side .inner { position: relative; z-index: 1; max-width: 420px; margin: auto; }
.auth-side h2 { font-size: 1.8rem; font-weight: 680; letter-spacing: -.7px; line-height: 1.25; margin-bottom: 14px; }
.auth-side p { color: rgba(255,255,255,.82); font-size: .95rem; }
.auth-feature { display: flex; gap: 13px; align-items: flex-start; margin-top: 22px; }
.auth-feature i {
    width: 34px; height: 34px; border-radius: 10px;
    background: rgba(255,255,255,.14); display: grid; place-items: center;
    font-size: 1rem; flex: 0 0 auto;
}
.auth-feature strong { display: block; font-size: .92rem; font-weight: 600; }
.auth-feature span { color: rgba(255,255,255,.76); font-size: .82rem; }

.password-toggle {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: var(--text-faint);
    width: 38px; height: 38px; border-radius: 8px;
}
.password-toggle:hover { color: var(--text-muted); }

/* ---------- Yardimci siniflar ---------- */
.text-muted-2 { color: var(--text-muted) !important; }
.text-faint { color: var(--text-faint) !important; }
.fw-550 { font-weight: 550; }
.fw-650 { font-weight: 650; }
.fs-13 { font-size: .8125rem; }
.fs-12 { font-size: .75rem; }
.divider { height: 1px; background: var(--border-soft); margin: 16px 0; }
.cursor-pointer { cursor: pointer; }
.text-money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.hover-lift { transition: transform .16s ease, box-shadow .16s ease; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- Responsive ---------- */
@media (min-width: 992px) {
    .auth-page { grid-template-columns: 1fr 1fr; }
    .auth-side { display: flex; }
}

@media (max-width: 1199.98px) {
    .content { padding: 22px 22px 50px; }
    .topbar { padding: 0 22px; }
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .topbar-title { display: none; }
    .global-search { max-width: none; width: auto; flex: 1 1 auto; margin-left: 0; }
}

@media (max-width: 767.98px) {
    .content { padding: 18px 15px 44px; }
    .topbar { padding: 0 15px; gap: 9px; }
    .global-search { width: 100%; }
    .user-chip-info { display: none; }
    .user-chip { padding: 4px; border: 0; background: transparent; }
    .stat-value { font-size: 1.35rem; }
    .page-head .actions { margin-left: 0; width: 100%; }
    .page-head .actions .btn { flex: 1 1 auto; }
    .auth-card { padding: 28px 22px; border: 0; box-shadow: none; background: transparent; }
    .auth-wrap { padding: 24px 16px; }
}

@media (max-width: 575.98px) {
    .global-search { display: none; }
    .table-responsive-wrap { overflow-x: auto; }
}

@media print {
    .sidebar, .topbar, .no-print, footer, .btn, .pagination { display: none !important; }
    .app-main { margin-left: 0; }
    .content { padding: 0; max-width: none; }
    body { background: #fff; font-size: 11pt; }

    .card {
        box-shadow: none;
        border-color: #d5d9e2;
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 10px;
    }
    .card-header { padding: 10px 14px; }
    .card-body { padding: 12px 14px; }

    .stat-card { box-shadow: none; border-color: #d5d9e2; padding: 10px 12px; }
    .stat-value { font-size: 1.15rem; }
    .stat-icon { display: none !important; }

    .table > thead > tr > th { background: #f3f4f7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .badge-soft, .progress, .progress-bar, .dot-color {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }

    a { color: inherit !important; text-decoration: none !important; }
    .table-responsive { overflow: visible !important; }
}

/* ==========================================================================
   Firmalar modulu
   ========================================================================== */

.company-logo {
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    font-weight: 650;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    line-height: 1;
}
.company-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.company-logo.is-initials { border-color: transparent; }

/* Filtre cubugu */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar .search-field { position: relative; flex: 1 1 260px; min-width: 200px; }
.filter-bar .search-field i {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-faint); font-size: .9rem; pointer-events: none;
}
.filter-bar .search-field input { padding-left: 36px; }

/* Filtre sekmeleri (Tumu / Aktif / Pasif) */
.pill-tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.pill-tabs a {
    padding: 5px 13px; border-radius: 8px; font-size: .82rem; font-weight: 550;
    color: var(--text-muted); white-space: nowrap;
}
.pill-tabs a:hover { color: var(--text); }
.pill-tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* Tablo satirinda firma hucresi */
.company-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.company-cell .name { font-weight: 600; color: var(--text); display: block; line-height: 1.25; }
.company-cell .meta { font-size: .765rem; color: var(--text-faint); }
.company-cell a.name:hover { color: var(--brand); }

/* Firma renk seridi */
.color-stripe { width: 4px; align-self: stretch; border-radius: 4px; flex: 0 0 auto; }

/* Renk secici */
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.color-swatch {
    width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
    border: 2px solid transparent; position: relative; padding: 0;
    transition: transform .12s ease;
}
.color-swatch:hover { transform: scale(1.08); }
.color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.color-swatch input { position: absolute; opacity: 0; pointer-events: none; }

/* Logo yukleme alani */
.logo-upload { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-preview {
    width: 76px; height: 76px; border-radius: 18px;
    border: 1px dashed var(--border); background: var(--surface-2);
    display: grid; place-items: center; overflow: hidden;
    color: var(--text-faint); font-size: 1.3rem; flex: 0 0 auto;
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Detay sayfasi ust bilgi */
.entity-header { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.entity-header .meta-list { display: flex; gap: 8px 22px; flex-wrap: wrap; margin-top: 8px; }
.entity-header .meta-list span { font-size: .82rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.entity-header .meta-list i { color: var(--text-faint); font-size: .95rem; }
.entity-header .meta-list a { color: var(--text-muted); }
.entity-header .meta-list a:hover { color: var(--brand); }

/* Sekmeler */
.nav-tabs { border-bottom: 1px solid var(--border); gap: 2px; }
.nav-tabs .nav-link {
    border: 0; border-bottom: 2px solid transparent; border-radius: 0;
    color: var(--text-muted); font-size: .875rem; font-weight: 550;
    padding: .6rem .9rem; margin-bottom: -1px;
    white-space: nowrap;   /* sekme etiketleri satira bolunmesin, gerekirse yatay kaydirilir */
}
.nav-tabs .nav-link:hover { border-bottom-color: var(--border); color: var(--text); }
.nav-tabs .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: transparent; }
.nav-tabs .nav-link .count {
    background: var(--surface-2); border: 1px solid var(--border-soft);
    color: var(--text-muted); font-size: .7rem; padding: 1px 6px; border-radius: 20px; margin-left: 6px;
}

/* Bilgi satirlari */
.info-row { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: .875rem; }
.info-row:last-child { border-bottom: 0; }
.info-row dt { color: var(--text-muted); font-weight: 500; width: 150px; flex: 0 0 auto; margin: 0; }
.info-row dd { margin: 0; color: var(--text); min-width: 0; word-break: break-word; }

@media (max-width: 575.98px) {
    .info-row { flex-direction: column; gap: 2px; }
    .info-row dt { width: auto; }
}

/* ==========================================================================
   Isler modulu
   ========================================================================== */

/* Tablo icinde ilerleme */
.progress-cell { min-width: 110px; }
.progress-cell .progress { height: 6px; }
.progress-cell .progress-label { font-size: .72rem; color: var(--text-muted); margin-top: 4px; display: flex; justify-content: space-between; gap: 6px; }

.progress-bar.is-complete { background: var(--success); }
.progress-bar.is-idle { background: #cbd5e1; }

/* Is basligi hucresi */
.job-cell .title { font-weight: 600; color: var(--text); display: block; line-height: 1.3; }
.job-cell a.title:hover { color: var(--brand); }
.job-cell .sub { font-size: .765rem; color: var(--text-faint); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.job-cell .sub .sep { color: var(--border); }

/* Tur etiketi */
.type-tag {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .745rem; font-weight: 550;
    padding: 3px 9px; border-radius: 7px;
    background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text-muted);
}
.type-tag .dot-color { width: 7px; height: 7px; }

/* Teslim tarihi */
.due-date { font-size: .82rem; white-space: nowrap; }
.due-date.overdue { color: var(--danger); font-weight: 600; }
.due-date.soon { color: var(--warning); font-weight: 550; }
.due-date .days { display: block; font-size: .72rem; font-weight: 400; opacity: .85; }

/* Ilerleme hizli secim */
.progress-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.progress-steps button {
    border: 1px solid var(--border); background: var(--surface);
    border-radius: 8px; padding: 5px 11px; font-size: .8rem; color: var(--text-muted);
    transition: all .13s ease;
}
.progress-steps button:hover { border-color: var(--brand); color: var(--brand); }
.progress-steps button.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 550; }

/* Durum secimi (form) */
.status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; }
.status-option {
    display: flex; align-items: center; gap: 9px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 9px 12px; cursor: pointer; font-size: .85rem;
    transition: all .13s ease; background: var(--surface);
}
.status-option:hover { border-color: #cbd5e1; background: var(--surface-2); }
.status-option input { display: none; }
.status-option .dot-color { width: 10px; height: 10px; }
.status-option.selected { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; color: var(--brand-dark); }

/* Anlasma / ek is secimi */
.scope-option {
    display: block; border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 13px 15px; cursor: pointer; transition: all .13s ease; height: 100%;
}
.scope-option:hover { border-color: #cbd5e1; background: var(--surface-2); }
.scope-option input { display: none; }
.scope-option .t { font-weight: 600; font-size: .875rem; display: flex; align-items: center; gap: 8px; }
.scope-option .d { font-size: .78rem; color: var(--text-muted); margin-top: 3px; }
.scope-option.selected { border-color: var(--brand); background: var(--brand-soft); }
.scope-option.selected .t { color: var(--brand-dark); }

/* Is turleri yonetimi */
.type-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.type-row:last-child { border-bottom: 0; }
.type-row .swatch { width: 12px; height: 12px; border-radius: 4px; flex: 0 0 auto; }

@media (max-width: 767.98px) {
    .status-grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   Gorevler modulu
   ========================================================================== */

.task-group + .task-group { margin-top: 22px; }
.task-group-head {
    display: flex; align-items: center; gap: 9px;
    font-size: .78rem; font-weight: 650;
    text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-muted);
    padding: 0 2px 9px;
}
.task-group-head i { font-size: .95rem; }
.task-group-head .count {
    background: var(--surface-2); border: 1px solid var(--border-soft);
    color: var(--text-muted); font-size: .7rem; font-weight: 600;
    padding: 1px 7px; border-radius: 20px; letter-spacing: 0;
}
.task-group-head.is-overdue { color: var(--danger); }
.task-group-head.is-overdue .count { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.task-group-head.is-today { color: var(--brand); }
.task-group-head.is-today .count { background: var(--brand-soft); border-color: transparent; color: var(--brand-dark); }

.task-row {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: border-color .14s ease, box-shadow .14s ease, opacity .2s ease;
}
.task-row:hover { border-color: #dcdfe8; box-shadow: var(--shadow-xs); }
.task-row.is-done { opacity: .6; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--text-muted); }

.task-check {
    width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 auto; cursor: pointer;
    border-radius: 6px; border: 1.5px solid #cbd5e1;
}
.task-check:checked { background-color: var(--success); border-color: var(--success); }
.task-check:focus { box-shadow: 0 0 0 3.5px rgba(16,185,129,.18); border-color: var(--success); }

.task-body { flex: 1 1 auto; min-width: 0; }
.task-title { font-size: .89rem; font-weight: 550; color: var(--text); line-height: 1.35; display: block; }
a.task-title:hover { color: var(--brand); }
.task-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 5px; font-size: .765rem; color: var(--text-faint); }
.task-meta > * { min-width: 0; }
/* Dar kolonlarda (dashboard) firma/is adi satira bolunmek yerine kisaltilir */
.task-meta a { color: var(--text-muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta a:hover { color: var(--brand); }
.task-meta .sep { color: var(--border); }

.task-side { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.task-due { font-size: .78rem; white-space: nowrap; color: var(--text-muted); }
.task-due.overdue { color: var(--danger); font-weight: 600; }
.task-due.today { color: var(--brand); font-weight: 600; }

/* Hizli gorev ekleme */
.quick-add {
    display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
}
.quick-add .title-field { flex: 1 1 240px; min-width: 180px; }

@media (max-width: 575.98px) {
    .task-row { flex-wrap: wrap; }
    .task-side { width: 100%; padding-left: 32px; justify-content: flex-start; }
    .quick-add > * { flex: 1 1 100%; }
}

/* ==========================================================================
   Dashboard
   ========================================================================== */

/* Firma ozet karti */
.company-summary {
    display: flex; align-items: stretch; gap: 13px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
    height: 100%;
}
.company-summary:hover { border-color: #dcdfe8; box-shadow: var(--shadow-md); transform: translateY(-1px); }

.company-summary .cs-body { flex: 1 1 auto; min-width: 0; }
.company-summary .cs-name {
    font-weight: 600; font-size: .89rem; color: var(--text);
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.company-summary .cs-sub { font-size: .74rem; color: var(--text-faint); display: block; }

.cs-figures { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 11px; }
.cs-figure { min-width: 0; }
.cs-figure .k { font-size: .68rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; display: block; }
.cs-figure .v { font-size: .875rem; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-figure .v.paid { color: var(--success); }
.cs-figure .v.due { color: var(--danger); }
.cs-figure .v.muted { color: var(--text-faint); font-weight: 500; }

/* <a> icinde oldugu icin span kullaniliyor; inline eleman yukseklik almaz, blok yapiyoruz */
.cs-progress { display: block; height: 5px; background: #eef1f6; border-radius: 999px; margin-top: 11px; overflow: hidden; }
.cs-progress > span { display: block; height: 100%; border-radius: 999px; background: var(--success); }

/* Kucuk liste satiri (geciken odeme / is) */
.mini-row {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
}
.mini-row:last-child { border-bottom: 0; }
.mini-row .mr-body { flex: 1 1 auto; min-width: 0; }
.mini-row .mr-title {
    font-size: .85rem; font-weight: 550; color: var(--text);
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-row a.mr-title:hover { color: var(--brand); }
.mini-row .mr-meta { font-size: .74rem; color: var(--text-faint); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.mini-row .mr-side { flex: 0 0 auto; text-align: right; }
.mini-row .mr-amount { font-size: .875rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-row .mr-note { font-size: .72rem; color: var(--text-faint); white-space: nowrap; }

/* Grafik alani */
.chart-wrap { position: relative; height: 260px; }

@media (max-width: 575.98px) {
    .cs-figures { gap: 12px; }
    .chart-wrap { height: 220px; }
}

/* ==========================================================================
   Notlar ve dosyalar
   ========================================================================== */

.note-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 15px 17px;
    margin-bottom: 10px;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.note-card:hover { border-color: #dcdfe8; box-shadow: var(--shadow-xs); }
.note-card.is-pinned { border-color: #fde68a; background: #fffcf3; }

.note-head { display: flex; align-items: flex-start; gap: 10px; }
.note-title { font-size: .92rem; font-weight: 620; color: var(--text); line-height: 1.35; flex: 1 1 auto; min-width: 0; }
.note-date { font-size: .75rem; color: var(--text-faint); white-space: nowrap; }
.note-body {
    font-size: .875rem; color: #475569; line-height: 1.6;
    margin-top: 8px; white-space: pre-wrap; word-break: break-word;
}
.note-pin { color: var(--warning); font-size: .95rem; flex: 0 0 auto; margin-top: 2px; }

/* Dosya satiri */
.file-row {
    display: flex; align-items: center; gap: 13px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    margin-bottom: 8px;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.file-row:hover { border-color: #dcdfe8; box-shadow: var(--shadow-xs); }

.file-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: grid; place-items: center; font-size: 1.15rem;
    flex: 0 0 auto; background: var(--surface-2);
}
.file-body { flex: 1 1 auto; min-width: 0; }
.file-name {
    font-size: .875rem; font-weight: 550; color: var(--text);
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
a.file-name:hover { color: var(--brand); }
.file-meta { font-size: .74rem; color: var(--text-faint); display: flex; gap: 7px; flex-wrap: wrap; margin-top: 2px; }
.file-meta .sep { color: var(--border); }

/* Surukle-birak yukleme alani */
.dropzone {
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    padding: 26px 20px;
    text-align: center;
    transition: border-color .15s ease, background .15s ease;
    cursor: pointer;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .dz-icon { font-size: 1.7rem; color: var(--text-faint); }
.dropzone.is-over .dz-icon { color: var(--brand); }
.dropzone .dz-title { font-size: .89rem; font-weight: 550; color: var(--text); margin-top: 8px; }
.dropzone .dz-sub { font-size: .78rem; color: var(--text-muted); margin-top: 3px; }
.dropzone input[type="file"] { display: none; }

.text-brand { color: var(--brand) !important; }

/* ==========================================================================
   Takvim
   ========================================================================== */

.cal-grid { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.cal-grid th {
    font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-faint); padding: 0 0 9px; text-align: center;
}
.cal-grid td {
    border: 1px solid var(--border-soft);
    vertical-align: top;
    padding: 6px 6px 8px;
    height: 108px;
    background: var(--surface);
}
.cal-grid td.is-other { background: var(--surface-2); }
.cal-grid td.is-today { background: var(--brand-soft); border-color: var(--brand); }
.cal-grid td.is-weekend { background: #fafbfd; }
.cal-grid td.is-other.is-weekend { background: var(--surface-2); }

.cal-day {
    font-size: .78rem; font-weight: 600; color: var(--text-muted);
    display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 5px;
}
.cal-grid td.is-other .cal-day { color: var(--text-faint); font-weight: 500; }
.cal-grid td.is-today .cal-day { color: var(--brand-dark); }
.cal-day .num {
    width: 22px; height: 22px; border-radius: 7px;
    display: inline-grid; place-items: center;
}
.cal-grid td.is-today .cal-day .num { background: var(--brand); color: #fff; }

.cal-event {
    display: flex; align-items: center; gap: 5px;
    font-size: .72rem; line-height: 1.3;
    padding: 3px 6px; border-radius: 6px;
    background: var(--surface-2); border: 1px solid var(--border-soft);
    margin-bottom: 3px;
    color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-event:hover { border-color: #cbd5e1; color: var(--brand); }
.cal-event .ev-icon { font-size: .72rem; flex: 0 0 auto; line-height: 1; }
.cal-event.is-overdue .ev-icon { color: inherit !important; }
.cal-event .txt { overflow: hidden; text-overflow: ellipsis; }
.cal-event.is-done { opacity: .5; text-decoration: line-through; }
.cal-event.is-overdue { background: var(--danger-soft); border-color: transparent; color: #b91c1c; }
.cal-more { font-size: .69rem; color: var(--text-faint); padding-left: 6px; }

.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--text-muted); }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

@media (max-width: 991.98px) {
    .cal-grid td { height: 84px; padding: 4px; }
    .cal-event { font-size: .66rem; padding: 2px 4px; }
}
@media (max-width: 575.98px) {
    .cal-grid td { height: 62px; }
    .cal-event .txt { display: none; }
    .cal-event { padding: 3px; justify-content: center; }
}

/* ==========================================================================
   Arama sonuclari
   ========================================================================== */

.search-group + .search-group { margin-top: 22px; }
.search-hit {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); margin-bottom: 8px;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.search-hit:hover { border-color: #dcdfe8; box-shadow: var(--shadow-xs); }
.search-hit .hit-icon {
    width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
    display: grid; place-items: center; font-size: 1rem;
    background: var(--surface-2); color: var(--text-muted);
}
.search-hit .hit-body { flex: 1 1 auto; min-width: 0; }
.search-hit .hit-title { font-size: .89rem; font-weight: 550; color: var(--text); display: block; }
.search-hit a.hit-title:hover { color: var(--brand); }
.search-hit .hit-sub { font-size: .765rem; color: var(--text-faint); margin-top: 2px; }
mark { background: #fef08a; padding: 0 2px; border-radius: 3px; color: inherit; }

/* Bildirim listesi */
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 9px; }
.notif-item:hover { background: var(--surface-2); }
.notif-item .n-icon {
    width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
    display: grid; place-items: center; font-size: .9rem;
}
.notif-item .n-title { font-size: .82rem; font-weight: 550; color: var(--text); line-height: 1.3; }
.notif-item .n-sub { font-size: .72rem; color: var(--text-faint); }

/* Toplu islem cubugu */
.bulk-bar {
    position: sticky;
    bottom: 16px;
    z-index: 1035;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 12px 18px;
    background: var(--text);
    color: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.bulk-bar .bulk-count { font-size: .875rem; }
.bulk-bar .bulk-count strong { font-size: 1rem; }
.bulk-bar .bulk-note { font-size: .78rem; color: #cbd5e1; }
.bulk-bar .bulk-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.bulk-bar .btn-light-soft { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; }
.bulk-bar .btn-light-soft:hover { background: rgba(255,255,255,.2); color: #fff; }

@media (max-width: 575.98px) {
    .bulk-bar { padding: 12px 14px; }
    .bulk-bar .bulk-actions { margin-left: 0; width: 100%; }
    .bulk-bar .bulk-actions .btn { flex: 1 1 auto; }
}
