/* Final client-panel layer. Keep native WHMCS states, forms and module HTML intact. */
body.dahinet-client-shell {
    --dn-panel-text: #0f172a;
    --dn-panel-muted: #475569;
    --dn-panel-line: #e2e8f0;
    --dn-panel-soft: #f8fafc;
    --dn-panel-radius: 12px;
    --dn-panel-data-size: 14px;
    --dn-panel-help-size: 13px;
    --dn-panel-title-size: 28px;
    --dn-panel-section-size: 18px;
}
body.dahinet-client-shell .dahinet-content {
    font-family: var(--dn-font, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    font-size: var(--dn-panel-data-size);
    line-height: 1.5;
    color: var(--dn-panel-text);
    min-width: 0;
}
body.dahinet-client-shell .dn-page-header {
    gap: 20px;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-color: var(--dn-panel-line);
}
body.dahinet-client-shell .dn-page-header-left {
    flex: 1 1 280px;
    min-width: 0;
    gap: 14px;
}
body.dahinet-client-shell .dn-page-header-left > div:last-child { min-width: 0; }
body.dahinet-client-shell .dn-page-title {
    font-size: var(--dn-panel-title-size) !important;
    line-height: 1.3;
    font-weight: 700;
    overflow-wrap: anywhere;
}
body.dahinet-client-shell .dn-page-subtitle {
    font-size: var(--dn-panel-help-size) !important;
    line-height: 1.5;
    margin-top: 6px;
    overflow-wrap: anywhere;
}
body.dahinet-client-shell .dn-page-header-right { flex: 0 1 auto; gap: 10px; }
body.dahinet-client-shell .dd-copy-feedback { display: block; color: var(--dn-panel-muted); }
body.dahinet-client-shell .dd-copy-feedback:empty { display: none; }

/* Shared section hierarchy and surfaces, including the native detail cards.

   DÜZELTME 2026-10-09 — bu listeden `.dn-panel-title` ve
   `.dn-section-heading h2` ÇIKARILDI.

   Neden: `:is()` özgüllüğü kendi argümanlarının EN ÖZGÜLÜ olanını alır.
   Liste içinde `.dahinet-content .card-title` (0,2,0) ve
   `.dd-overview-wrapper .tab-pane > .card .card-title` (0,4,0) var.
   Bu yüzden tüm `:is()` bloğu (0,5,1) özgüllüğe sahip oluyordu.
   `.dn-panel-title` ise (0,1,0) — listede kaldığı sürece listedeki
   EN ÖZGÜLÜ argümandan değer alıyor, yani kastedilen 15px değil
   `var(--dn-panel-section-size)` (=18px) uygulanıyordu.

   Sonuç (ölçüldü): bölüm başlığı `h2` ve kart başlığı `h3` HER
   genişlikte 18px/600 — hiyerarşi yok. Aşağıda tek sınıflı, net
   kurallar var: kart başlığı 15px, bölüm başlığı 18px.

   NOT: `.dn-panel-title` listeden çıkarılınca kalanlara dokunulmadı;
   onlar hâlâ 18px. Bu kasıtlı. */
body.dahinet-client-shell :is(.dahinet-content .card-title,
    .dahinet-content .panel-title,
    .dd-summary-card-header h2, .dd-actions-header h2, .dd-ssl-section-header h4,
    .dn-pd-card-header, .dn-pd-section-header, .dn-ns-section-title,
    .dd-overview-wrapper .tab-pane > .card .card-title) {
    font-size: var(--dn-panel-section-size) !important;
    line-height: 1.4;
    font-weight: 600;
}
/* `.dn-panel-title` için 15px kuralı zaten aşağıda var (Dashboard panel
   override bölümü). Burada TEKRAR yazılmıyor — aynı özelliğin iki
   yerde tanımlı olması bu hatayı doğuran şeydi. Tek tanım kalsın. */
/* Bölüm başlığı — kart başlığından büyük. Ayrı kural gerekiyor çünkü
   `:is()` listesinden çıkarıldı; yazılmazsa mevcut genel kurallardan
   (dashboard.css) miras alır ve kart başlığıyla aynı ölçüye düşerdi. */
body.dahinet-client-shell .dn-section-heading h2 {
    font-size: var(--dn-panel-section-size) !important;
    line-height: 1.4;
    font-weight: 600;
}
body.dahinet-client-shell :is(.dn-panel-card, .dd-summary-card, .dd-actions-section,
    .dd-ssl-section, .dn-pd-status-card, .dn-pd-billing-card, .dn-pd-section,
    .dn-pd-tabs-wrap, .dn-ns-modern) {
    border-color: var(--dn-panel-line) !important;
    border-radius: var(--dn-panel-radius) !important;
    box-shadow: none !important;
}
body.dahinet-client-shell :is(.dn-pd-info-val, .dn-pd-status-val, .dn-pd-billing-val,
    .dd-billing-list dd, .dd-setting-row strong, .dd-setting-state, .dd-action-text strong,
    .dd-ssl-item-value, .dn-ns-field-label, .dn-ns-default-value, .dn-ns-current-value) {
    font-size: var(--dn-panel-data-size) !important;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
body.dahinet-client-shell :is(.dn-pd-info-label, .dn-pd-billing-label, .dn-pd-last-update,
    .dd-detail-label, .dd-detail-note, .dd-summary-card-header p, .dd-setting-row > div > span,
    .dd-billing-list dt, .dd-action-text small, .dd-ssl-item-label, .dd-copy-feedback,
    .dn-ns-mode-text p, .dn-ns-default-note, .dn-ns-form-note, .dn-ns-field-help) {
    font-size: var(--dn-panel-help-size) !important;
    color: var(--dn-panel-muted);
    line-height: 1.5;
}
body.dahinet-client-shell .dahinet-content :is(.form-control, .dn-field) {
    font-size: var(--dn-panel-data-size) !important;
    min-height: 44px;
}
body.dahinet-client-shell .dahinet-content textarea.form-control { height: auto; }

/* Equal icon slots; Font Awesome's own family, weight and loading animation are retained. */
body.dahinet-client-shell .dahinet-sidebar-panel-title { font-size: 14px !important; white-space: normal; }
body.dahinet-client-shell .dahinet-sidebar-panel-header-left { min-width: 0; }
body.dahinet-client-shell .dahinet-sidebar-panel-title { overflow-wrap: anywhere; }
body.dahinet-client-shell .dahinet-sidebar-panel-header > .dahinet-sidebar-toggle {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
}
body.dahinet-client-shell .dahinet-sidebar :is(.dahinet-sidebar-nav-icon, .dahinet-sidebar-panel-icon) {
    width: 32px !important;
    height: 32px !important;
    flex: 0 0 32px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
}
body.dahinet-client-shell .dahinet-sidebar :is(.dahinet-sidebar-nav-icon, .dahinet-sidebar-panel-icon) i {
    font-size: 16px !important;
    line-height: 1;
}
body.dahinet-client-shell .dahinet-sidebar .dahinet-sidebar-nav-link {
    min-height: 44px;
    font-size: 14px !important;
    padding: 8px 10px !important;
}
body.dahinet-client-shell .dahinet-sidebar :is(.dahinet-sidebar-nav-link, .dahinet-sidebar-nav-icon,
    .dahinet-sidebar-nav-arrow):is(:hover, .active),
body.dahinet-client-shell .dahinet-sidebar .dahinet-sidebar-nav-link:is(:hover, .active) :is(.dahinet-sidebar-nav-icon, .dahinet-sidebar-nav-arrow) {
    transform: none !important;
}
body.dahinet-client-shell .dahinet-sidebar .dahinet-sidebar-nav-label {
    font-size: 14px !important;
    line-height: 1.5;
    min-width: 0;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
}
body.dahinet-client-shell .dahinet-sidebar .sidebar-menu-item-wrapper { min-width: 0; }

/* Longer DNS labels and examples stay readable beside their fields. */
body.dahinet-client-shell .dn-ns-input-group { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
body.dahinet-client-shell .dn-ns-mode-card:focus-within { outline: 3px solid #1d4ed8; outline-offset: 3px; }
body.dahinet-client-shell .dn-ns-field-help { position: static; opacity: 1; cursor: auto; }
body.dahinet-client-shell .dn-ns-default-item { flex-wrap: wrap; }
body.dahinet-client-shell :is(.dn-ns-default-label, .dn-ns-default-value, .dn-ns-current-value) {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* cPanel and other module output is scoped by the template wrapper, never escaped or rewritten. */
body.dahinet-client-shell .dn-pd-module-area { min-width: 0; padding: 0; font-size: var(--dn-panel-data-size); }
body.dahinet-client-shell .dn-pd-module-area :is(h3.panel-title, h3.card-title) {
    font-size: var(--dn-panel-section-size) !important;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}
body.dahinet-client-shell .dn-pd-module-area :is(#cPanelPackagePanel, #cPanelUsagePanel,
    #cPanelSuspendReasonPanel, #cPanelBillingOverviewPanel) {
    background: #fff !important;
    border: 1px solid var(--dn-panel-line) !important;
    border-radius: var(--dn-panel-radius) !important;
    box-shadow: none !important;
    margin-bottom: 20px;
}
body.dahinet-client-shell .dn-pd-module-area :is(.panel-heading, .card-header) {
    background: var(--dn-panel-soft) !important;
    border-color: var(--dn-panel-line) !important;
    padding: 16px 20px;
}
body.dahinet-client-shell .dn-pd-module-area :is(.panel-body, .card-body) {
    font-size: var(--dn-panel-data-size);
    line-height: 1.5;
    padding: 20px;
}
body.dahinet-client-shell .dn-pd-module-area :is(#recurringAmount, #billingCycle, #paymentMethod, #registrationDate, #nextDueDate) {
    font-size: var(--dn-panel-data-size) !important;
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    body.dahinet-client-shell { --dn-panel-title-size: 24px; }
    body.dahinet-client-shell .dn-page-header { flex-direction: column; align-items: stretch; gap: 16px; }
    body.dahinet-client-shell .dn-page-header-left { flex-basis: auto; align-items: flex-start; }
    body.dahinet-client-shell .dn-page-header-right { display: flex; flex-direction: column; align-items: stretch; width: 100%; }
    body.dahinet-client-shell .dahinet-content .dn-page-header-right .dn-btn { flex: 0 0 auto; width: 100%; justify-content: center; }
    body.dahinet-client-shell .dn-page-icon { width: 44px; height: 44px; font-size: 20px; }
    body.dahinet-client-shell .dahinet-content :is(input.form-control, select.form-control, textarea.form-control, .dn-field) { font-size: 16px !important; }
    body.dahinet-client-shell .dn-ns-fields-grid { grid-template-columns: minmax(0, 1fr); }
    body.dahinet-client-shell .dn-pd-module-area :is(.panel-body, .card-body) { padding: 16px; }
}

/* ── Dashboard panel override ────────────────────────────────────
   panel-system.css dashboard.css'ten sonra yüklendiği ve !important
   kullandığı için panel yüzeyi, başlık ölçüsü ve gölge burada
   sabitlenir. Amaç: kartlar "düz ve gürültülü" değil, ince kenarlık +
   yumuşak gölge + 15px başlık ile sakin bir zemin oluşturmak. */
body.dahinet-client-shell :is(.dn-panel-card, .dd-summary-card, .dd-actions-section,
    .dd-ssl-section, .dn-pd-status-card, .dn-pd-billing-card, .dn-pd-section,
    .dn-pd-tabs-wrap, .dn-ns-modern) {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}
body.dahinet-client-shell .dn-panel-card:hover {
    box-shadow: 0 10px 24px -20px rgba(15, 23, 42, 0.45) !important;
}
/* Panel başlıkları dashboard'da 15px; --dn-panel-section-size (18px)
   diğer sayfaların bölüm başlıkları için korunur.

   DÜZELTME 2026-10-09: bu kural 2026-10-09'a kadar ÖLÜYDÜ. Üstteki
   `:is()` listesi `.dn-panel-title`'ı içeriyordu ve `:is()` özgüllüğü
   listedeki en özgül argümandan (0,4,0) geldiği için (0,5,1) oluyordu;
   bu kural (0,2,1) ile hiç uygulanmadı. Sonuç: `h2` ve `h3` her
   genişlikte 18px/600. Yukarıda liste düzeltildi, kural artık çalışıyor. */
body.dahinet-client-shell .dn-panel-title {
    font-size: 15px !important;
    font-weight: 600 !important;
}
/* Hizmet satırı rozetleri: tema kenar çizgisi genişliğini geçersiz kılıyor. */
body.dahinet-client-shell #servicesPanel .div-service-status { width: auto !important; }
body.dahinet-client-shell #servicesPanel .div-service-status .label:not(.label-placeholder) {
    width: auto !important; color: #065f46 !important; background: #ecfdf5 !important;
}

/* ============================================================
   Mobil (≤576px) — dashboard sıkıştırması
   -----------------------------------------------------------
   Bu katman en sonda yüklendiği ve `.dahinet-client-shell` öneki
   taşıdığı için `enterprise.css` / `theme-refresh.css` içindeki
   mobil kuralları burada geçersiz kılır. Ölçülen değerler:
     • 4 istatistik kartı 466px yer kaplıyordu → 2×2 ızgara + kart
       içi sıkıştırma ile ~160px
     • Karşılama bannerı 418px → aksiyonlar yatay şeride
   ============================================================ */
@media (max-width: 576px) {
    body.dahinet-client-shell .dn-dashboard { gap: 16px; }

    /* İstatistik kartı: 2×2 ızgarada ~164px genişlik */
    body.dahinet-client-shell .dn-home-stat-card {
        min-height: 0;
        padding: 10px;
        gap: 8px;
        align-items: center;
        transition: transform .12s ease;
    }
    body.dahinet-client-shell .dn-home-stat-card:active { transform: scale(.985); }
    body.dahinet-client-shell .dn-hstat-icon {
        width: 30px; height: 30px; flex: none;
        border-radius: 9px; font-size: 0.875rem;
    }
    body.dahinet-client-shell .dn-hstat-body { gap: 2px; min-width: 0; }
    body.dahinet-client-shell .dn-hstat-num {
        font-size: 22px; line-height: 1.05; font-weight: 700;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    body.dahinet-client-shell .dn-hstat-label {
        font-size: 11px !important; line-height: 1.2;
        letter-spacing: .01em; color: #475569 !important;
        white-space: normal; overflow: hidden;
        display: -webkit-box; -webkit-box-orient: vertical;
        -webkit-line-clamp: 2; line-clamp: 2;
    }
    /* Ödeme uyarısının görsel sinyali: kart köşesinde küçük rozet */
    body.dahinet-client-shell .dn-hstat-badge {
        display: inline-flex !important;
        position: absolute; top: 6px; right: 6px;
        width: 16px; height: 16px; min-width: 16px; padding: 0;
        border-radius: 999px; font-size: 9px;
        background: #fef3c7 !important; color: #b45309 !important;
    }
    body.dahinet-client-shell .dn-home-stat-card { position: relative; }
    body.dahinet-client-shell .dn-hstat-alert { border-color: #fcd34d; }

    /* Dokunma hedefleri ≥44px (WCAG 2.5.8) */
    body.dahinet-client-shell .dn-panel-btn,
    body.dahinet-client-shell .dn-welcome-action,
    body.dahinet-client-shell .dn-section-heading > a { min-height: 44px; }
    body.dahinet-client-shell .dn-panel-btn { padding: 8px 12px; }

    /* Karşılama bannerı: aksiyonlar yatay kaydırmalı şerit */
    body.dahinet-client-shell .dn-welcome-banner { padding: 16px !important; gap: 14px; }
    body.dahinet-client-shell .dn-welcome-avatar { width: 44px; height: 44px; font-size: 1.125rem; }
    body.dahinet-client-shell .dn-welcome-title { font-size: 18px; }
    body.dahinet-client-shell .dn-welcome-sub {
        font-size: 13px; line-height: 1.4;
        display: -webkit-box; -webkit-box-orient: vertical;
        -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
    }
    body.dahinet-client-shell .dn-welcome-right {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        margin-inline: -16px;
        padding-inline: 16px;
    }
    body.dahinet-client-shell .dn-welcome-right::-webkit-scrollbar { display: none; }
    body.dahinet-client-shell .dn-welcome-right a {
        flex: 0 0 auto;
        min-height: 44px;
        scroll-snap-align: start;
        white-space: nowrap;
    }

    /* Panel kartlarında düzenli ritim */
    body.dahinet-client-shell .dn-home-panels { gap: 12px; }
    body.dahinet-client-shell .dn-panel-card { min-height: 148px; }
    body.dahinet-client-shell .dn-panel-body { padding: 14px 16px; gap: 10px; }
}
