/* ==========================================================================
   TASARIM v2 — modern kurumsal katman (app.css'ten sonra yuklenir)
   Lacivert-grafit zemin, kirmizi yalnizca vurgu. Dis yazi tipi / CDN yok
   (sistem yazi tipleri); degerler :root degiskenlerinden gelir.
   ========================================================================== */
:root {
    --ink: #0f172a;
    --ink-2: #1e293b;
    --muted: #64748b;
    --mayra-bg: #f1f4f9;
    --mayra-border: #e2e8f0;
    --surface-soft: #f8fafc;
    --radius: .85rem;
    --radius-sm: .6rem;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
    --shadow-md: 0 2px 4px rgba(15, 23, 42, .04), 0 12px 28px -14px rgba(15, 23, 42, .16);
    --bs-body-color: #1f2937;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-size: .925rem;
    --bs-link-color: #b30f29;
    --bs-link-hover-color: #8f0c20;
}

body { letter-spacing: -.005em; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--ink); letter-spacing: -.02em; font-weight: 700; }
.text-muted { color: var(--muted) !important; }
code { color: #be123c; background: #fff1f2; padding: .1em .35em; border-radius: .3rem; font-size: .85em; }

/* ---- Kenar cubugu ---- */
.sidebar, .sidebar-offcanvas {
    background:
        radial-gradient(420px 260px at 0% 0%, rgba(200, 16, 46, .22), transparent 65%),
        linear-gradient(180deg, #0b1220 0%, #0f172a 55%, #0b1220 100%);
    border-right: 1px solid rgba(255, 255, 255, .04);
}
.sidebar-brand { padding: 1.25rem 1.25rem 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.brand-mark {
    background: linear-gradient(135deg, #e11d3f, #a30d25);
    box-shadow: 0 6px 16px -4px rgba(200, 16, 46, .55), inset 0 1px 0 rgba(255, 255, 255, .25);
    border-radius: 11px;
}
.brand-text { font-size: .95rem; letter-spacing: .09em; }
.sidebar-nav { padding: 1rem .75rem; }
.sidebar-link {
    position: relative;
    color: rgba(226, 232, 240, .72);
    font-weight: 500;
    padding: .62rem .85rem;
    border-radius: .65rem;
    margin-bottom: 3px;
}
.sidebar-link i { font-size: 1.08rem; opacity: .85; }
.sidebar-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.sidebar-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(200, 16, 46, .30), rgba(200, 16, 46, .08));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: -.75rem; top: 20%; bottom: 20%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: #ff3b5c;
}
.sidebar-link.active i { opacity: 1; color: #ff6b83; }
.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar-footer .btn-outline-light { border-color: rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .8); border-radius: .65rem; }
.sidebar-footer .btn-outline-light:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---- Ust cubuk ---- */
.topbar {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--mayra-border);
    min-height: 64px;
    padding: .6rem 1.1rem;
}
@media (min-width: 992px) { .topbar { padding: .6rem 1.75rem; } .admin-content { padding: 1.75rem; } }
.topbar-title { font-size: 1.15rem; letter-spacing: -.02em; }
.topbar-user {
    background: var(--surface-soft);
    border: 1px solid var(--mayra-border);
    border-radius: 999px;
    padding: .3rem .8rem;
    color: var(--ink-2) !important;
    font-weight: 500;
}

/* ---- Kartlar ---- */
.card { border: 1px solid var(--mayra-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: #fff; }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--mayra-border);
    padding: .85rem 1.15rem;
    font-weight: 650;
    color: var(--ink);
}
.card-header i.bi:first-child { color: var(--mayra-red); }
.card-body { padding: 1.15rem; }
.card-footer { background: var(--surface-soft); border-top: 1px solid var(--mayra-border); border-radius: 0 0 var(--radius) var(--radius); }

/* ---- Istatistik kartlari ---- */
.stat-card { box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #cbd5e1; }
.stat-card::before { width: 100%; height: 3px; bottom: auto; right: 0; opacity: .9; }
.stat-card .card-body { padding: 1.05rem 1.15rem 1rem; }
.stat-card .stat-icon {
    right: .9rem; top: .95rem;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 11px;
    font-size: 1.15rem;
    opacity: 1;
    background: var(--surface-soft);
}
.stat-primary .stat-icon { background: #eff6ff; }
.stat-indigo .stat-icon  { background: #eef2ff; }
.stat-warning .stat-icon { background: #fffbeb; }
.stat-orange .stat-icon  { background: #fff7ed; }
.stat-success .stat-icon { background: #f0fdf4; }
.stat-dark .stat-icon    { background: #f1f5f9; }
.stat-danger .stat-icon  { background: #fff1f2; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 750; letter-spacing: -.03em; margin-top: .25rem; }
.stat-card .stat-money { font-size: 1.55rem; }
.stat-card .stat-label { font-size: .72rem; font-weight: 650; color: var(--muted); letter-spacing: .06em; }

/* ---- Rozetler ---- */
.status-badge {
    border-radius: 999px;
    padding: .38em .8em;
    font-weight: 600;
    letter-spacing: 0;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12);
}
.badge { font-weight: 600; letter-spacing: 0; }

/* ---- Tablolar ---- */
.table { --bs-table-hover-bg: #f8fafc; --bs-table-border-color: #eef2f6; }
.table > :not(caption) > * > * { padding: .8rem .9rem; }
.table thead th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .7rem;
    letter-spacing: .08em;
    border-bottom: 1px solid var(--mayra-border);
}
.table-clickable tbody tr:hover { background: #fdf2f4; }
.table-clickable tbody tr td:first-child { font-variant-numeric: tabular-nums; }

/* ---- Butonlar ---- */
.btn { border-radius: var(--radius-sm); font-weight: 600; transition: background .12s, box-shadow .12s, transform .06s, border-color .12s; }
.btn:active { transform: translateY(1px); }
.btn-danger { box-shadow: 0 4px 12px -4px rgba(200, 16, 46, .55); }
.btn-danger:hover { box-shadow: 0 6px 16px -4px rgba(200, 16, 46, .6); }
.btn-outline-secondary {
    --bs-btn-color: #334155; --bs-btn-border-color: #cbd5e1;
    --bs-btn-hover-bg: #f1f5f9; --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #94a3b8;
    --bs-btn-active-bg: #e2e8f0; --bs-btn-active-color: var(--ink);
}
.btn-sm { border-radius: .5rem; }
.btn-lg { border-radius: .75rem; }
.btn:focus-visible { box-shadow: 0 0 0 .22rem rgba(200, 16, 46, .22); }

/* ---- Formlar ---- */
.form-control, .form-select { border-color: #cbd5e1; border-radius: var(--radius-sm); }
.input-group-text { border-color: #cbd5e1; background: var(--surface-soft); color: var(--muted); }
.form-control::placeholder { color: #94a3b8; }
.form-label { color: #334155; font-weight: 600; font-size: .82rem; margin-bottom: .35rem; }
.form-text { color: var(--muted); }
.form-check-input:checked { background-color: var(--mayra-red); border-color: var(--mayra-red); }

/* ---- Uyarilar ---- */
.alert { border: 1px solid transparent; border-radius: var(--radius-sm); }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-light   { background: var(--surface-soft); border-color: var(--mayra-border); color: #334155; }
.alert-link { color: inherit; font-weight: 700; }

/* ---- Sekmeler (servis detayi + ayarlar) ---- */
.service-tabs, .settings-tabs { border-bottom: 1px solid var(--mayra-border); gap: .25rem; }
.service-tabs .nav-link, .settings-tabs .nav-link {
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    margin-bottom: -1px;
    padding: .75rem 1rem;
    color: var(--muted);
    font-weight: 600;
}
.service-tabs .nav-link:hover, .settings-tabs .nav-link:hover { color: var(--ink); border-bottom-color: #cbd5e1; }
.service-tabs .nav-link.active, .settings-tabs .nav-link.active {
    color: var(--mayra-red);
    background: transparent;
    border-bottom-color: var(--mayra-red);
}

/* ---- Zaman cizelgesi ---- */
.timeline::before { background: linear-gradient(180deg, #e2e8f0, #f1f5f9); }
.timeline-dot { box-shadow: 0 0 0 4px #fff; }
.timeline-body { background: var(--surface-soft); border: 1px solid #eef2f6; border-radius: .75rem; padding: .65rem .85rem; }

/* ---- Ayrintilar ---- */
dl dt { color: var(--muted); font-weight: 600; font-size: .82rem; }
dl dd { color: var(--ink-2); }
details > summary { cursor: pointer; }
.dropdown-menu { border: 1px solid var(--mayra-border); border-radius: .75rem; box-shadow: var(--shadow-md); padding: .4rem; }
.dropdown-item { border-radius: .5rem; padding: .5rem .75rem; }
.dropdown-item:hover { background: #f1f5f9; }
.modal-content { border: 0; border-radius: 1rem; box-shadow: 0 24px 60px -20px rgba(15, 23, 42, .45); }
.pagination .page-link { border-radius: .5rem; margin: 0 2px; color: var(--ink-2); border-color: var(--mayra-border); }
.pagination .active > .page-link { background: var(--mayra-red); border-color: var(--mayra-red); color: #fff; }
.signature-pad { border-color: #94a3b8; border-radius: .75rem; }
.photo-thumb img { border-radius: .75rem; box-shadow: var(--shadow-sm); }
.device-row { background: var(--surface-soft); border-color: var(--mayra-border) !important; border-radius: var(--radius) !important; }
.quote-summary { background: var(--surface-soft); border-radius: .75rem !important; }
.selected-customer { border-radius: .75rem; }
.track-page { background: var(--mayra-bg); min-height: 100vh; }

/* ---- Giris ekrani: iki panelli ---- */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.login-aside {
    position: relative;
    color: #e2e8f0;
    padding: 3rem 3.5rem;
    display: flex; flex-direction: column; justify-content: space-between;
    background:
        radial-gradient(700px 420px at 100% 0%, rgba(200, 16, 46, .35), transparent 60%),
        radial-gradient(500px 360px at 0% 100%, rgba(59, 130, 246, .18), transparent 60%),
        linear-gradient(160deg, #0b1220, #111a2e 60%, #0b1220);
    overflow: hidden;
}
.login-aside::after {
    content: "";
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%);
    mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%);
    pointer-events: none;
}
.login-aside > * { position: relative; z-index: 1; }
.login-aside h2 { color: #fff; font-size: 2rem; line-height: 1.2; max-width: 22ch; letter-spacing: -.03em; }
.login-aside p { color: rgba(226, 232, 240, .75); max-width: 44ch; }
.login-points { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .85rem; }
.login-points li { display: flex; gap: .75rem; align-items: flex-start; color: rgba(226, 232, 240, .9); }
.login-points i { color: #ff6b83; font-size: 1.1rem; margin-top: .1rem; }
.login-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: var(--mayra-bg); min-height: 100vh; }
.login-main .login-card { width: 100%; max-width: 430px; box-shadow: var(--shadow-md); border: 1px solid var(--mayra-border); border-radius: 1rem; }
@media (max-width: 991.98px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-aside { display: none; }
}

/* ---- Erisilebilirlik ---- */
:focus-visible { outline: 2px solid rgba(200, 16, 46, .55); outline-offset: 2px; }
::selection { background: rgba(200, 16, 46, .18); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* hidden ozelligi her zaman kazansin (Bootstrap'in .d-flex !important kurali ezmesin) */
[hidden] { display: none !important; }
