/* ============================================================
   Caria Rent a Car — Yönetim paneli teması (Metrica üzerine)
   ============================================================ */
:root {
    --cr-navy: #1e2a46;
    --cr-blue: #1a5fd0;
    --cr-blue-soft: #e9f0fd;
    --cr-text: #2b3445;
    --cr-muted: #6b7489;
    --cr-icon: #5b6478;
    --cr-border: #e6e9ef;
    --cr-sidebar-bg: #f8f9fb;
    --cr-hover: #eef1f6;
    --cr-body-bg: #ffffff;
    --cr-sidebar-w: 256px;
    --cr-topbar-h: 64px;
    --cr-danger: #d0263e;
    --cr-success: #1f9d6b;
    --cr-warning: #e08a1e;
}

html, body { height: 100%; }
body.cr-body {
    background: var(--cr-body-bg);
    color: var(--cr-text);
    font-family: Roboto, "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
    overflow-x: hidden;
}

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

/* ---------- Sol menü ---------- */
.cr-sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--cr-sidebar-w);
    background: var(--cr-sidebar-bg);
    border-right: 1px solid var(--cr-border);
    display: flex; flex-direction: column;
    z-index: 1040;
    transition: transform .2s ease;
}
.cr-brand {
    display: block;
    padding: 22px 24px 8px;
    font-size: 22px; font-weight: 700; letter-spacing: -.2px;
    color: var(--cr-navy); text-decoration: none; white-space: nowrap;
}
.cr-brand:hover { color: var(--cr-navy); }
.cr-brand span { color: var(--cr-blue); }
.cr-brand small { display: block; font-size: 11px; font-weight: 500; color: var(--cr-muted); letter-spacing: .3px; margin-top: 2px; }
.cr-menu-scroll { flex: 1; overflow-y: auto; padding: 0 12px 24px; }
.cr-menu-scroll::-webkit-scrollbar { width: 6px; }
.cr-menu-scroll::-webkit-scrollbar-thumb { background: #d9dee7; border-radius: 3px; }
.cr-menu-label { font-size: 14px; font-weight: 600; color: var(--cr-navy); padding: 22px 12px 10px; }
.cr-menu { list-style: none; margin: 0; padding: 0; }
.cr-menu-link {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px 9px 18px;
    border-radius: 8px;
    color: var(--cr-text); font-size: 14.5px; font-weight: 500;
    text-decoration: none; cursor: pointer; user-select: none;
}
.cr-menu-link > i:first-child { font-size: 19px; color: var(--cr-icon); width: 20px; text-align: center; }
.cr-menu-link .cr-chevron { margin-left: auto; font-size: 15px; color: #8b93a5; transition: transform .2s ease; }
.cr-menu-link:hover { background: var(--cr-hover); color: var(--cr-navy); }
.cr-menu-link[aria-expanded="true"] .cr-chevron { transform: rotate(90deg); }
.cr-menu-link.active, .cr-menu-link.active > i:first-child { color: var(--cr-blue); }
.cr-menu-link.cr-single.active { background: var(--cr-blue-soft); }
.cr-submenu { list-style: none; margin: 2px 0 6px; padding: 0; }
.cr-submenu a {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 12px 7px 50px;
    border-radius: 8px;
    color: #4b5568; font-size: 13.5px; text-decoration: none;
    position: relative;
}
.cr-submenu a::before {
    content: ""; position: absolute; left: 34px; top: 50%;
    width: 5px; height: 5px; border-radius: 50%; background: #c3c9d4; transform: translateY(-50%);
}
.cr-submenu a:hover { background: var(--cr-hover); color: var(--cr-navy); }
.cr-submenu a.active { color: var(--cr-blue); font-weight: 500; background: var(--cr-blue-soft); }
.cr-submenu a.active::before { background: var(--cr-blue); }
.cr-submenu .cr-soon { margin-left: auto; font-size: 10.5px; color: #a1a8b8; font-weight: 400; }
.cr-sidebar-footer { padding: 12px 24px 18px; font-size: 11.5px; color: var(--cr-muted); border-top: 1px solid var(--cr-border); }

/* ---------- Üst bar ---------- */
.cr-topbar {
    position: sticky; top: 0; z-index: 1030;
    height: var(--cr-topbar-h);
    display: flex; align-items: center; gap: 16px;
    padding: 0 24px 0 12px;
    background: #fff;
    border-bottom: 1px solid var(--cr-border);
}
.cr-burger {
    width: 42px; height: 42px; border-radius: 50%;
    border: 0; background: var(--cr-hover); color: var(--cr-navy);
    display: inline-flex; align-items: center; justify-content: center; font-size: 21px;
}
.cr-burger:hover { background: #e3e8f0; }
.cr-search { flex: 1; max-width: 520px; position: relative; }
.cr-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8a93a6; font-size: 16px; }
.cr-search input {
    width: 100%; border: 0; background: transparent; padding: 8px 12px 8px 38px;
    font-size: 14px; color: var(--cr-text); outline: none;
}
.cr-search input::placeholder { color: #8a93a6; }
.cr-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cr-user-btn { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 6px; border-radius: 10px; }
.cr-user-btn:hover { background: var(--cr-hover); }
.cr-user-name { font-weight: 500; color: var(--cr-navy); line-height: 1.1; text-align: left; }
.cr-user-name small { display: block; font-weight: 400; color: var(--cr-muted); font-size: 12px; }
.cr-avatar {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
    background: var(--cr-blue-soft); color: var(--cr-blue);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
}

/* ---------- İçerik ---------- */
.cr-content { flex: 1; padding: 18px 24px 32px; }
.cr-breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--cr-navy); margin-bottom: 14px; }
.cr-breadcrumb a { color: var(--cr-navy); text-decoration: none; }
.cr-breadcrumb .sep { color: #9aa2b3; }
.cr-breadcrumb .current { color: #6c7a9c; }
.cr-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.cr-page-title { font-size: 22px; font-weight: 700; color: var(--cr-navy); margin: 0; }
.cr-footer { padding: 14px 24px; border-top: 1px solid var(--cr-border); font-size: 13px; color: var(--cr-muted); }
.cr-footer a { color: var(--cr-muted); text-decoration: none; }
.cr-footer a:hover { color: var(--cr-blue); }

.cr-card { background: #fff; border: 1px solid var(--cr-border); border-radius: 6px; margin-bottom: 20px; }
.cr-card-header { padding: 14px 18px; border-bottom: 1px solid var(--cr-border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cr-card-title { font-size: 16px; font-weight: 600; color: var(--cr-navy); margin: 0; }
.cr-card-body { padding: 18px; }

.cr-kpi { padding: 16px 18px; }
.cr-kpi-label { font-size: 13px; font-weight: 600; color: var(--cr-navy); }
.cr-kpi-value { font-size: 22px; font-weight: 700; color: var(--cr-navy); margin: 8px 0 6px; }
.cr-kpi-note { font-size: 12.5px; color: #6c7a9c; display: flex; align-items: center; gap: 6px; }
.cr-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #9aa2b3; }
.cr-dot.green { background: var(--cr-success); }
.cr-dot.blue { background: var(--cr-blue); }
.cr-dot.red { background: var(--cr-danger); }
.cr-dot.orange { background: var(--cr-warning); }

/* ---------- Tablolar & formlar ---------- */
.cr-table { margin: 0; }
.cr-table thead th {
    font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--cr-muted);
    font-weight: 600; background: #fafbfc; border-bottom: 1px solid var(--cr-border); padding: 10px 14px; white-space: nowrap;
}
.cr-table td { padding: 11px 14px; vertical-align: middle; border-color: #f0f2f6; }
.cr-table tbody tr:hover { background: #fafbfd; }
.cr-empty { text-align: center; color: var(--cr-muted); padding: 40px 16px; }
.cr-empty i { font-size: 34px; color: #c3c9d4; display: block; margin-bottom: 8px; }
.form-label { font-weight: 500; color: var(--cr-navy); font-size: 13px; margin-bottom: 5px; }
.form-control, .form-select { border-color: #dfe3ea; font-size: 14px; }
.form-control:focus, .form-select:focus { border-color: #8db0ec; box-shadow: 0 0 0 .18rem rgba(26, 95, 208, .12); }
.field-validation-error, .text-danger { font-size: 12.5px; }
.input-validation-error { border-color: var(--cr-danger) !important; }
.btn-primary { background: var(--cr-blue); border-color: var(--cr-blue); }
.btn-dark { background: var(--cr-text); border-color: var(--cr-text); }
.badge-soft-success { background: #e3f5ed; color: #167a52; }
.badge-soft-secondary { background: #eef0f4; color: #5b6478; }
.badge-soft-danger { background: #fde8eb; color: #b11d32; }
.badge-soft-primary { background: var(--cr-blue-soft); color: var(--cr-blue); }
.badge-soft-warning { background: #fdf1e1; color: #a35f0b; }
.badge { font-weight: 500; padding: .4em .65em; }
.cr-form-section { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--cr-muted); margin: 6px 0 14px; }
.cr-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 16px; }
.cr-hint { font-size: 12.5px; color: var(--cr-muted); }

/* Rol yetki matrisi */
.cr-perm-group { border: 1px solid var(--cr-border); border-radius: 6px; padding: 12px 14px; }
.cr-perm-group h6 { font-size: 13.5px; font-weight: 600; color: var(--cr-navy); margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; }

/* Görsel kırpma */
.cr-crop-preview {
    width: 96px; height: 96px; border-radius: 10px; border: 1px dashed #cdd3de; background: #fafbfc;
    display: flex; align-items: center; justify-content: center; overflow: hidden; color: #a1a8b8; font-size: 28px;
}
.cr-crop-preview.round { border-radius: 50%; }
.cr-crop-preview.wide { width: 220px; }
.cr-crop-preview img { width: 100%; height: 100%; object-fit: contain; }
.cr-crop-stage { max-height: 60vh; background: #f1f3f7; }
.cr-crop-stage img { display: block; max-width: 100%; }

/* Telefon girişi */
.iti { width: 100%; }
.iti__flag { background-image: url("../lib/intl-tel-input/img/flags.png"); }
@media (min-resolution: 2x) { .iti__flag { background-image: url("../lib/intl-tel-input/img/flags@2x.png"); } }

/* Editör */
.cr-editor .ql-toolbar { border-color: #dfe3ea; border-radius: 6px 6px 0 0; }
.cr-editor .ql-container { border-color: #dfe3ea; border-radius: 0 0 6px 6px; min-height: 180px; font-family: inherit; font-size: 14px; }

/* ---------- Takvim (FullCalendar) ---------- */
.cr-calendar .fc .fc-toolbar-title { font-size: 17px; font-weight: 600; color: var(--cr-navy); text-transform: none; }
.cr-calendar .fc .fc-button { box-shadow: none !important; font-size: 13px; text-transform: none; }
.cr-calendar .fc .fc-prev-button, .cr-calendar .fc .fc-next-button { background: var(--cr-navy); border-color: var(--cr-navy); padding: 6px 12px; }
.cr-calendar .fc .fc-today-button { background: #7d8597; border-color: #7d8597; margin-left: 8px !important; }
.cr-calendar .fc .fc-button-primary:not(:disabled).fc-button-active,
.cr-calendar .fc .fc-dayGridMonth-button, .cr-calendar .fc .fc-listWeek-button { background: #fff; color: var(--cr-text); border-color: #dfe3ea; }
.cr-calendar .fc .fc-button-primary.fc-button-active { background: var(--cr-blue-soft) !important; color: var(--cr-blue) !important; }
.cr-calendar .fc-theme-standard td, .cr-calendar .fc-theme-standard th, .cr-calendar .fc-theme-standard .fc-scrollgrid { border-color: #e7eaf0; }
.cr-calendar .fc .fc-col-header-cell-cushion { color: var(--cr-navy); font-weight: 600; padding: 8px 4px; text-decoration: none; }
.cr-calendar .fc .fc-daygrid-day-number { color: var(--cr-navy); text-decoration: none; padding: 6px 8px; }
.cr-calendar .fc .fc-day-other { background: repeating-linear-gradient(135deg, #f6f7fa, #f6f7fa 6px, #fbfcfd 6px, #fbfcfd 12px); }
.cr-calendar .fc .fc-day-other .fc-daygrid-day-number { color: #b0b6c3; }
.cr-calendar .fc .fc-day-today { background: #f3f7ff !important; }
.cr-legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: #6c7a9c; margin-top: 12px; }
.cr-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Giriş sayfası ---------- */
.cr-auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--cr-sidebar-bg); padding: 24px 16px; }
.cr-auth-card { width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--cr-border); border-radius: 10px; padding: 32px 30px; }
.cr-auth .cr-brand { padding: 0 0 4px; text-align: center; font-size: 26px; }
.cr-auth-footer { margin-top: 20px; font-size: 13px; }
.cr-auth-footer a { color: var(--cr-muted); text-decoration: none; }

/* ---------- Yakında sayfası ---------- */
.cr-soon-hero { display: flex; gap: 18px; align-items: flex-start; }
.cr-soon-icon { width: 54px; height: 54px; border-radius: 12px; background: var(--cr-blue-soft); color: var(--cr-blue); display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.cr-feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cr-feature-list li { display: flex; gap: 8px; align-items: flex-start; }
.cr-feature-list i { color: var(--cr-success); margin-top: 2px; }

/* ---------- Duyarlı / daraltılmış menü ---------- */
.cr-backdrop { display: none; }
body.cr-collapsed .cr-sidebar { transform: translateX(-100%); }
body.cr-collapsed .cr-main { margin-left: 0; }

@media (max-width: 991.98px) {
    .cr-main { margin-left: 0; }
    .cr-sidebar { transform: translateX(-100%); }
    body.cr-sidebar-open .cr-sidebar { transform: none !important; box-shadow: 0 0 40px rgba(16, 24, 40, .18); }
    body.cr-sidebar-open .cr-backdrop { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 1035; }
    .cr-content { padding: 16px; }
    .cr-topbar { padding: 0 16px 0 10px; }
    .cr-user-name { display: none; }
}

/* ---------- Faz 2/3 bileşenleri ---------- */
.cr-tabs .nav-link { color: var(--cr-muted); font-weight: 500; }
.cr-tabs .nav-link.active { color: var(--cr-blue); }
.cr-dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
.cr-dl dt { color: var(--cr-muted); font-weight: 400; }
.cr-dl dd { margin: 0; color: var(--cr-text); font-weight: 500; }
.cr-stat { border: 1px solid var(--cr-border); border-radius: 6px; padding: 10px 14px; }
.cr-stat small { display: block; color: var(--cr-muted); font-size: 12px; }
.cr-stat strong { font-size: 18px; color: var(--cr-navy); }
.cr-thumb { width: 54px; height: 38px; object-fit: cover; border-radius: 4px; background: #eef1f6; }
.cr-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cr-chip { padding: 6px 12px; border-radius: 20px; border: 1px solid var(--cr-border); background: #fff; color: var(--cr-text); font-size: 13px; text-decoration: none; }
.cr-chip:hover { border-color: #b9c6dd; color: var(--cr-navy); }
.cr-chip.active { background: var(--cr-blue-soft); border-color: #c7d8f8; color: var(--cr-blue); font-weight: 500; }
.cr-chip b { margin-left: 4px; }

/* Müşteri arama */
.cr-customer-picker { position: relative; }
.cr-ac-list { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--cr-border);
    border-radius: 6px; box-shadow: 0 8px 24px rgba(16,24,40,.12); max-height: 280px; overflow-y: auto; }
.cr-ac-list.show { display: block; }
.cr-ac-item { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 8px 12px; border-bottom: 1px solid #f1f3f7; }
.cr-ac-item:hover { background: var(--cr-hover); }
.cr-ac-item small { display: block; color: var(--cr-muted); }
.cr-ac-empty { padding: 10px 12px; color: var(--cr-muted); }
.cr-ac-warning { color: var(--cr-danger); font-size: 12.5px; font-weight: 500; }

/* Fiyat paneli */
.cr-quote { position: sticky; top: calc(var(--cr-topbar-h) + 16px); }
.cr-quote .table td { padding: 5px 0; border-color: #f0f2f6; font-size: 13.5px; }

/* İmza */
.cr-signature canvas { width: 100%; height: 170px; border: 1px dashed #c5ccd8; border-radius: 6px; background: #fcfcfd; touch-action: none; display: block; }

/* Hasar krokisi */
.cr-damage svg { width: 100%; max-width: 230px; display: block; margin: 0 auto; cursor: crosshair; }
.cr-damage[data-readonly] svg { cursor: default; }
.cr-damage .car-body { fill: #f3f5f9; stroke: #9aa4b6; stroke-width: 2; }
.cr-damage .car-glass { fill: #dfe7f3; stroke: #9aa4b6; stroke-width: 1.5; }
.cr-damage .car-wheel { fill: #5b6478; }
.cr-mark circle { fill: var(--cr-danger); stroke: #fff; stroke-width: 2; cursor: pointer; }
.cr-mark text { fill: #fff; font-size: 9px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.cr-damage-list { margin: 8px 0 0; padding-left: 0; list-style: none; font-size: 13px; color: var(--cr-text); }

/* Çoklu fotoğraf */
.cr-photo-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cr-photo { position: relative; width: 96px; height: 72px; border-radius: 6px; overflow: hidden; border: 1px solid var(--cr-border); }
.cr-photo img { width: 100%; height: 100%; object-fit: cover; }
.cr-photo .btn-close { position: absolute; top: 3px; right: 3px; background-color: #fff; border-radius: 50%; padding: 4px; font-size: 9px; opacity: .9; }
.cr-gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.cr-gallery a img { width: 110px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid var(--cr-border); }

/* Yakıt seçici */
.cr-fuel { display: flex; gap: 4px; }
.cr-fuel input { display: none; }
.cr-fuel label { flex: 1; text-align: center; padding: 6px 0; border: 1px solid #dfe3ea; border-radius: 4px; font-size: 11.5px; cursor: pointer; color: var(--cr-muted); }
.cr-fuel input:checked + label { background: var(--cr-blue); border-color: var(--cr-blue); color: #fff; }

/* Planlama tablosu */
.cr-plan { overflow-x: auto; }
.cr-plan-grid { min-width: 980px; }
.cr-plan-head, .cr-plan-row { display: grid; grid-template-columns: 210px 1fr; }
.cr-plan-head { position: sticky; top: 0; background: #fafbfc; border-bottom: 1px solid var(--cr-border); z-index: 2; }
.cr-plan-days { display: grid; }
.cr-plan-day { text-align: center; font-size: 11.5px; color: var(--cr-muted); padding: 6px 0; border-left: 1px solid #eef0f4; line-height: 1.2; }
.cr-plan-day b { display: block; color: var(--cr-navy); font-size: 13px; }
.cr-plan-day.weekend { background: #f6f7fa; }
.cr-plan-day.today { background: #eaf1ff; }
.cr-plan-row { border-bottom: 1px solid #f0f2f6; min-height: 46px; }
.cr-plan-label { padding: 6px 12px; border-right: 1px solid var(--cr-border); background: #fff; position: sticky; left: 0; z-index: 1; }
.cr-plan-label a { font-weight: 600; color: var(--cr-navy); text-decoration: none; }
.cr-plan-label small { display: block; color: var(--cr-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-plan-track { position: relative; background-image: linear-gradient(to right, #f0f2f6 1px, transparent 1px); }
.cr-plan-bar { position: absolute; top: 8px; height: 30px; border-radius: 5px; padding: 0 8px; font-size: 12px; line-height: 30px; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cr-plan-bar:hover { color: #fff; filter: brightness(1.06); }
.cr-plan-bar.t-Rezervasyon { background: #1f9d6b; }
.cr-plan-bar.t-Kiralama { background: #1a5fd0; }
.cr-plan-bar.t-Gecikme { background: #d0263e; }
.cr-plan-bar.t-Blokaj { background: repeating-linear-gradient(135deg, #8c95a6, #8c95a6 6px, #7d8597 6px, #7d8597 12px); }

/* Sözleşme baskısı */
.cr-contract { max-width: 900px; margin: 0 auto; background: #fff; padding: 32px 40px; color: #111; font-size: 12.5px; }
.cr-contract h1 { font-size: 18px; margin: 0; }
.cr-contract table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.cr-contract th, .cr-contract td { border: 1px solid #c9ced8; padding: 5px 8px; vertical-align: top; }
.cr-contract th { background: #f3f5f9; text-align: left; width: 22%; font-weight: 600; }
.cr-contract .section { font-weight: 700; font-size: 13px; margin: 16px 0 6px; text-transform: uppercase; letter-spacing: .3px; }
.cr-contract .sign { height: 90px; border: 1px solid #c9ced8; display: flex; align-items: flex-end; justify-content: center; padding: 6px; }
.cr-contract .sign img { max-height: 70px; }
@media print {
    body { background: #fff !important; }
    .no-print { display: none !important; }
    .cr-contract { padding: 0; max-width: none; }
}
