/* ==========================================================================
   MAYRA IT SOLUTIONS - Teknik Servis Yonetim Sistemi
   Kurumsal tema: kirmizi (#C8102E), siyah (#141414), beyaz.
   Kirmizi vurgu rengi olarak olculu kullanilir; zemin acik ve sakindir.
   ========================================================================== */

:root {
    --mayra-red: #c8102e;
    --mayra-red-dark: #a30d25;
    --mayra-black: #141414;
    --mayra-dark: #1e1f24;
    --mayra-dark-2: #2a2b31;
    --mayra-bg: #f4f5f7;
    --mayra-border: #e4e6ea;
    --sidebar-width: 248px;

    /* Durum renkleri (badge) */
    --st-primary: #2563eb;
    --st-info: #0ea5e9;
    --st-warning: #d97706;
    --st-cyan: #0891b2;
    --st-indigo: #6366f1;
    --st-teal: #0d9488;
    --st-success: #16a34a;
    --st-dark: #374151;
    --st-orange: #ea580c;
    --st-danger: #dc2626;
    --st-secondary: #6b7280;
}

/* Bootstrap ana renklerini kurumsal kimlige cek */
.btn-danger {
    --bs-btn-bg: var(--mayra-red);
    --bs-btn-border-color: var(--mayra-red);
    --bs-btn-hover-bg: var(--mayra-red-dark);
    --bs-btn-hover-border-color: var(--mayra-red-dark);
    --bs-btn-active-bg: var(--mayra-red-dark);
    --bs-btn-active-border-color: var(--mayra-red-dark);
}
.text-danger { color: var(--mayra-red) !important; }
.btn-outline-danger {
    --bs-btn-color: var(--mayra-red);
    --bs-btn-border-color: var(--mayra-red);
    --bs-btn-hover-bg: var(--mayra-red);
    --bs-btn-hover-border-color: var(--mayra-red);
}

body.admin-body,
body.blank-body {
    background: var(--mayra-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Yerlesim
   -------------------------------------------------------------------------- */
.admin-wrapper { display: flex; min-height: 100vh; }

.admin-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-content {
    padding: 1rem;
    flex: 1 1 auto;
}
@media (min-width: 992px) {
    .admin-content { padding: 1.5rem; }
}

/* --------------------------------------------------------------------------
   Kenar cubugu
   -------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    background: var(--mayra-black);
    color: #fff;
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-offcanvas {
    background: var(--mayra-black);
    color: #fff;
    width: var(--sidebar-width) !important;
}

.sidebar-brand {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--mayra-red);
    color: #fff;
    font-weight: 800;
    font-size: 1.25rem;
    flex: 0 0 auto;
}
.brand-mark-lg { width: 56px; height: 56px; font-size: 1.9rem; display: flex; }

.brand-text {
    margin-left: .65rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1.05;
    display: flex;
    flex-direction: column;
}
.brand-text small {
    font-size: .58rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .55);
    letter-spacing: .22em;
}

.sidebar-nav { padding: .75rem .6rem; flex: 1 1 auto; overflow-y: auto; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    color: rgba(255, 255, 255, .78);
    padding: .62rem .8rem;
    border-radius: .5rem;
    font-size: .925rem;
    margin-bottom: 2px;
    transition: background .12s ease, color .12s ease;
}
.sidebar-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; }
.sidebar-link:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.sidebar-link.active {
    color: #fff;
    background: var(--mayra-red);
    box-shadow: 0 2px 8px rgba(200, 16, 46, .35);
}

.sidebar-footer {
    padding: .9rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

/* --------------------------------------------------------------------------
   Ust cubuk
   -------------------------------------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--mayra-border);
    padding: .65rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 60px;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--mayra-black);
}

.topbar-user { font-size: .875rem; }

.btn-menu { font-size: 1.2rem; line-height: 1; padding: .35rem .6rem; }

/* Mobilde dokunmatik hedefler buyusun */
@media (max-width: 575.98px) {
    .btn-new-intake { padding: .5rem .75rem; }
}

/* --------------------------------------------------------------------------
   Kartlar
   -------------------------------------------------------------------------- */
.card {
    border: 1px solid var(--mayra-border);
    border-radius: .65rem;
    box-shadow: 0 1px 2px rgba(20, 20, 20, .04);
}
.card-header {
    background: #fff;
    font-weight: 600;
    border-bottom: 1px solid var(--mayra-border);
}

/* Istatistik kartlari */
.stat-card {
    position: relative;
    overflow: hidden;
    transition: transform .12s ease, box-shadow .12s ease;
    color: inherit;
}
a.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(20, 20, 20, .09);
}
.stat-card .card-body { padding: .9rem 1rem; }

.stat-card .stat-icon {
    position: absolute;
    right: .75rem;
    top: .6rem;
    font-size: 1.5rem;
    opacity: .18;
}
.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--mayra-black);
}
.stat-card .stat-money { font-size: 1.35rem; }
.stat-card .stat-label {
    font-size: .78rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
}
.stat-primary::before { background: var(--st-primary); }
.stat-indigo::before  { background: var(--st-indigo); }
.stat-warning::before { background: var(--st-warning); }
.stat-orange::before  { background: var(--st-orange); }
.stat-success::before { background: var(--st-success); }
.stat-dark::before    { background: var(--st-dark); }
.stat-danger::before  { background: var(--mayra-red); }

.stat-primary .stat-icon { color: var(--st-primary); }
.stat-indigo .stat-icon  { color: var(--st-indigo); }
.stat-warning .stat-icon { color: var(--st-warning); }
.stat-orange .stat-icon  { color: var(--st-orange); }
.stat-success .stat-icon { color: var(--st-success); }
.stat-dark .stat-icon    { color: var(--st-dark); }
.stat-danger .stat-icon  { color: var(--mayra-red); }

/* --------------------------------------------------------------------------
   Durum rozetleri
   -------------------------------------------------------------------------- */
.status-badge {
    font-size: .74rem;
    font-weight: 600;
    padding: .38em .65em;
    border-radius: .4rem;
    white-space: nowrap;
}
.status-primary   { background: var(--st-primary); }
.status-info      { background: var(--st-info); }
.status-warning   { background: var(--st-warning); }
.status-cyan      { background: var(--st-cyan); }
.status-indigo    { background: var(--st-indigo); }
.status-teal      { background: var(--st-teal); }
.status-success   { background: var(--st-success); }
.status-dark      { background: var(--st-dark); }
.status-orange    { background: var(--st-orange); }
.status-danger    { background: var(--st-danger); }
.status-secondary { background: var(--st-secondary); }

/* --------------------------------------------------------------------------
   Tablolar
   -------------------------------------------------------------------------- */
.table thead th {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280;
    font-weight: 700;
    border-bottom-width: 1px;
    white-space: nowrap;
}
.table-clickable tbody tr { cursor: pointer; }
.table-clickable tbody tr:hover { background: #f9eef0; }

/* --------------------------------------------------------------------------
   Formlar
   -------------------------------------------------------------------------- */
.form-label { font-weight: 600; font-size: .875rem; }
.form-label.required::after { content: " *"; color: var(--mayra-red); }

.form-control:focus,
.form-select:focus {
    border-color: rgba(200, 16, 46, .5);
    box-shadow: 0 0 0 .2rem rgba(200, 16, 46, .12);
}

/* Mobilde girise zoom yapmasin diye 16px taban */
@media (max-width: 575.98px) {
    .form-control, .form-select { font-size: 16px; }
}

/* --------------------------------------------------------------------------
   Giris ekrani
   -------------------------------------------------------------------------- */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background:
        radial-gradient(1200px 500px at 85% -10%, rgba(200, 16, 46, .10), transparent 60%),
        radial-gradient(900px 420px at -10% 110%, rgba(20, 20, 20, .07), transparent 55%),
        var(--mayra-bg);
}
.login-card { width: 100%; max-width: 430px; border-radius: .9rem; }

/* --------------------------------------------------------------------------
   Ayarlar sekmeleri
   -------------------------------------------------------------------------- */
.settings-tabs {
    border-bottom: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.settings-tabs .nav-link {
    color: #4b5563;
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: .8rem 1rem;
}
.settings-tabs .nav-link.active {
    color: var(--mayra-red);
    border-bottom-color: var(--mayra-red);
    background: transparent;
}

.settings-logo-preview {
    max-height: 64px;
    max-width: 220px;
    object-fit: contain;
    border: 1px solid var(--mayra-border);
    border-radius: .4rem;
    padding: .3rem .5rem;
    background: #fff;
}

/* --------------------------------------------------------------------------
   Hata sayfasi
   -------------------------------------------------------------------------- */
.error-page { min-height: 100vh; padding: 1.5rem; }
.error-code {
    font-size: 5.5rem;
    font-weight: 800;
    color: var(--mayra-red);
    line-height: 1;
    margin-bottom: .5rem;
}

/* --------------------------------------------------------------------------
   Servis kabul ekrani
   -------------------------------------------------------------------------- */
.customer-results {
    z-index: 1050;
    max-height: 320px;
    overflow-y: auto;
    top: 100%;
}

.selected-customer { border-left: 4px solid var(--st-success); }

.device-row { background: #fbfbfc; }
.device-row:hover { background: #f8f9fa; }

.photo-thumb img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: .5rem;
    border: 1px solid var(--mayra-border);
}

.signature-preview {
    max-width: 200px;
    max-height: 80px;
    background: #fff;
    padding: .25rem;
}

.signature-pad {
    border: 2px dashed #c4c8cf;
    border-radius: .5rem;
    background: #fff;
    touch-action: none;
    display: block;
    max-width: 100%;
    cursor: crosshair;
}

/* --------------------------------------------------------------------------
   Bildirimler
   -------------------------------------------------------------------------- */
.flash-area .alert { border-radius: .55rem; }

/* --------------------------------------------------------------------------
   Servis detayi: sekmeler, zaman cizelgesi, is sirasi
   -------------------------------------------------------------------------- */
.service-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
.service-tabs .nav-link { color: var(--bs-secondary-color); }
.service-tabs .nav-link.active { font-weight: 600; color: var(--bs-body-color); }

.timeline { position: relative; }
.timeline::before {
    content: "";
    position: absolute;
    left: calc(1rem + 15px);
    top: 1.25rem;
    bottom: 1.25rem;
    width: 2px;
    background: var(--mayra-border, #dee2e6);
}
.timeline-item {
    position: relative;
    display: flex;
    gap: .85rem;
    padding-bottom: 1.1rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    z-index: 1;
}
.timeline-body { flex: 1 1 auto; min-width: 0; }
.text-bg-indigo  { background-color: var(--st-indigo, #6610f2) !important; color: #fff !important; }
.text-bg-orange  { background-color: var(--st-orange, #fd7e14) !important; color: #fff !important; }

.work-queue-item { border-bottom: 1px solid var(--mayra-border, #dee2e6); }
.work-queue-item:last-child { border-bottom: 0; }

.pay-table td { vertical-align: middle; }

@media (max-width: 575.98px) {
    .service-tabs .nav-link { padding: .5rem .65rem; font-size: .9rem; }
    .timeline::before { left: calc(1rem + 15px); }
}
