/*
 * Hexnet panel — mobil / tablet responsive ekleri
 * Desktop: main.css davranışı korunur; bu dosya yalnızca dar ekranlarda devreye girer.
 * Breakpoint hedefleri: 1024px, 768px, 576px
 */

.hexnet-page-title-with-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.hexnet-page-title-text {
  min-width: 0;
  flex: 1;
}

/* Cihaz tablosu işlem hücresi — masaüstünde tek satır flex (JS ile işaretli) */
.hexnet-device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hexnet-device-actions-row {
  display: contents;
}

/* -------------------------------------------------------------------------- */
/* 1024px — tablet: dashboard istatistikleri, filtre barları, topbar          */
/* -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .stats-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar {
    gap: 12px;
  }

  .topbar-search-wrap {
    max-width: none;
    flex: 1 1 220px;
    min-width: 200px;
  }

  .devices-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #page-customers .panel-body > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #page-users .panel-body > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #usersPendingRegistrationsCard .panel-body > div[style*="grid-template-columns"],
  #usersRejectedRegistrationsCard .panel-body > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* -------------------------------------------------------------------------- */
/* 1023px — yan menü: hamburger + slide (main.css 860px kolon düzenini ezer) */
/* -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .hexnet-sidebar-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    flex-shrink: 0;
  }

  .app-layout {
    flex-direction: row !important;
    position: relative;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh !important;
    max-height: none !important;
    width: min(288px, 88vw);
    z-index: 1900;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-bottom: none !important;
    flex: none !important;
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.35);
  }

  body.hexnet-sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.hexnet-sidebar-open {
    overflow: hidden;
  }

  .hexnet-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1800;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.hexnet-sidebar-open .hexnet-sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .main {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 14px 14px 22px;
  }

  .page-title h2 {
    font-size: 22px;
  }
}

/* Hamburger yalnızca dar ekranda */
.hexnet-sidebar-toggle {
  display: none;
}

/* -------------------------------------------------------------------------- */
/* 768px — küçük tablet: tek sütun filtreler, tablo → kart, modallar          */
/* -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* --- İçerik alanı: okunabilir genişlik, ortalanmış --- */
  .main {
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  .main .main-body {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
  }

  /* --- Üst bar: başlık üst satır | sol hamburger, sağ bildirim + profil | arama tam genişlik --- */
  .topbar {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-rows: auto auto auto;
    gap: 10px 8px;
    align-items: center;
  }

  .top-actions {
    display: contents;
  }

  .page-title.hexnet-page-title-with-toggle {
    display: contents;
  }

  .hexnet-page-title-text {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
  }

  .hexnet-sidebar-toggle {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }

  .topbar-notify-wrap {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
  }

  .topbar-user-wrap {
    grid-column: 4;
    grid-row: 2;
    justify-self: end;
  }

  .topbar-notify-wrap.hidden + .topbar-user-wrap {
    grid-column: 3 / -1;
    justify-self: end;
  }

  .topbar-search-wrap {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
    min-width: 0 !important;
  }

  .search {
    min-width: 0 !important;
    width: 100%;
    max-width: none;
    border-radius: 12px;
  }

  .search input {
    min-height: 44px;
  }

  .main,
  .topbar,
  .top-actions,
  .topbar-notify-wrap {
    overflow: visible !important;
  }

  .topbar-notify-wrap {
    position: relative;
  }

  .topbar-notify-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    margin-top: 8px;
    width: min(320px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
  }

  .topbar-notify-btn--pulse i {
    animation: hexnet-bell-wiggle 1s ease-in-out infinite;
    transform-origin: top center;
  }

  @keyframes hexnet-bell-wiggle {
    0%,
    100% {
      transform: rotate(0deg);
    }
    15% {
      transform: rotate(14deg);
    }
    30% {
      transform: rotate(-12deg);
    }
    45% {
      transform: rotate(10deg);
    }
    60% {
      transform: rotate(-8deg);
    }
    75% {
      transform: rotate(4deg);
    }
  }

  .hexnet-page-title-text h2 {
    margin-bottom: 4px;
    line-height: 1.2;
  }

  .hexnet-page-title-text p {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
  }

  .stats-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }

  /* --- Dashboard operasyon kartları --- */
  #page-dashboard .stats-dashboard {
    gap: 10px;
    margin-bottom: 14px;
  }

  #page-dashboard .stats-dashboard .stat-card {
    min-height: 94px;
    padding: 12px 12px 11px;
    border-radius: 11px;
  }

  #page-dashboard .stats-dashboard .stat-value {
    font-size: 22px;
  }

  #page-dashboard .stats-dashboard .stat-sub {
    font-size: 11px;
    line-height: 1.3;
  }

  #page-dashboard .stats-dashboard .stat-top {
    margin-bottom: 7px;
  }

  #page-dashboard .stats-dashboard .stat-top i {
    font-size: 15px;
    opacity: 0.85;
  }

  #page-dashboard .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  /* --- Genel kart aralığı --- */
  .main-body .page > .card:not(.stats) {
    margin-bottom: 14px;
  }

  .main-body .page .stats.stats-dashboard {
    margin-bottom: 16px;
  }

  .devices-filter-bar,
  .users-filter-bar {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    align-items: stretch !important;
  }

  #devicesFilterClearBtn,
  #usersFilterClearBtn {
    width: 100%;
    min-height: 44px;
    border-radius: 10px;
  }

  .devices-filter-bar .field,
  .users-filter-bar .field {
    width: 100%;
  }

  .devices-filter-bar input,
  .devices-filter-bar select,
  .users-filter-bar input,
  .users-filter-bar select {
    min-height: 44px;
    border-radius: 10px;
    box-sizing: border-box;
  }

  #page-customers .panel-body > div[style*="grid-template-columns"],
  #page-users .panel-body > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .customers-filter-bar{
    grid-template-columns:1fr !important;
  }

  .customers-pagination{
    flex-direction:column;
    align-items:stretch;
  }

  .customers-pagination__right{
    justify-content:space-between;
  }

  .customers-table thead {
    display: none;
  }
  .customers-table,
  .customers-table tbody,
  .customers-table tr,
  .customers-table td {
    display: block;
    width: 100%;
  }
  .customers-table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    background: #fff;
    padding: 8px 10px;
  }
  .customers-table td {
    border-bottom: none;
    padding: 5px 0;
    font-size: 13px;
  }
  .customers-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 2px;
  }
  .customers-table .table-col-no {
    display: none;
  }
  .customers-actions {
    display: none;
  }
  .customers-actions-mobile {
    display: block;
    text-align: right;
  }

  #usersPendingRegistrationsCard .panel-body > div[style*="grid-template-columns"],
  #usersRejectedRegistrationsCard .panel-body > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .btn {
    border-radius: 10px;
  }

  .btn:not(.topbar-notify-btn):not(.topbar-user-btn) {
    min-height: 44px;
  }

  /* ----- Tablolar: thead gizli, satır = kart (Devices) ----- */
  #page-devices table thead {
    display: none;
  }
  #page-devices table tbody tr {
    display: block;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
  }
  #page-devices table tbody tr td {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    line-height: 1.45;
  }
  #page-devices table tbody tr td:last-child {
    border-bottom: none;
  }
  #page-devices table tbody td:nth-child(1)::before,
  #page-devices table tbody td:nth-child(2)::before,
  #page-devices table tbody td:nth-child(3)::before,
  #page-devices table tbody td:nth-child(4)::before,
  #page-devices table tbody td:nth-child(5)::before,
  #page-devices table tbody td:nth-child(6)::before,
  #page-devices table tbody td:nth-child(7)::before,
  #page-devices table tbody td:nth-child(8)::before {
    font-weight: 700;
    color: var(--muted);
    flex-shrink: 0;
    max-width: 42%;
    padding-right: 8px;
  }
  #page-devices table tbody td:nth-child(1)::before {
    content: "No";
  }
  #page-devices table tbody td:nth-child(2)::before {
    content: "Seri";
  }
  #page-devices table tbody td:nth-child(3)::before {
    content: "Ürün";
  }
  #page-devices table tbody td:nth-child(4)::before {
    content: "Firma";
  }
  #page-devices table tbody td:nth-child(5)::before {
    content: "Müşteri";
  }
  #page-devices table tbody td:nth-child(6)::before {
    content: "Bağlılık";
  }
  #page-devices table tbody td:nth-child(7)::before {
    content: "Durum";
  }
  #page-devices table tbody td:nth-child(8)::before {
    content: "Aktiflik";
  }

  #page-devices table tbody tr td:not(.hexnet-device-actions-td) .hexnet-card-val {
    flex: 1;
    min-width: 0;
    text-align: right;
    word-break: break-word;
  }

  #page-devices table tbody tr td:not(.hexnet-device-actions-td) .hexnet-card-val.hexnet-card-val--badges {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }

  #page-devices .hexnet-card-val--badges .status,
  #page-devices .hexnet-card-val--badges .status-badge,
  #page-devices .hexnet-card-val--badges span[style*="border-radius"] {
    font-size: 11px !important;
    font-weight: 600;
    padding: 3px 8px !important;
    border-radius: 10px !important;
    white-space: normal !important;
    max-width: 100%;
    line-height: 1.25;
    box-sizing: border-box;
  }

  #page-devices table tbody td.hexnet-device-actions-td {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 14px;
    margin-top: 2px;
    border-top: 1px solid #e2e8f0;
    border-bottom: none !important;
  }

  #page-devices table tbody td.hexnet-device-actions-td::before {
    content: "İşlem";
    font-weight: 700;
    color: var(--muted);
    display: block;
    margin-bottom: 10px;
    align-self: flex-start;
  }

  .hexnet-device-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }

  .hexnet-device-actions-row {
    display: grid;
    width: 100%;
    gap: 10px;
  }

  .hexnet-device-actions-row--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hexnet-device-actions-row--pair > .btn:only-child {
    grid-column: 1 / -1;
  }

  .hexnet-device-actions-row .status-select,
  .hexnet-device-actions-row--danger .btn {
    width: 100%;
    min-height: 44px;
    border-radius: 10px;
  }

  .hexnet-device-actions-row .btn.btn-secondary,
  .hexnet-device-actions-row .btn.btn-danger {
    min-height: 44px;
    border-radius: 10px;
  }

  /* ----- Customers / Users işlem düzeni: ortak standart ----- */
  #page-customers table tbody td:last-child,
  #page-users .card:first-of-type table tbody td:last-child {
    display: block;
  }

  .hexnet-table-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }

  .hexnet-table-actions-row {
    display: grid;
    width: 100%;
    gap: 10px;
  }

  .hexnet-table-actions-row--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hexnet-table-actions-row--pair > .btn:only-child {
    grid-column: 1 / -1;
  }

  .hexnet-table-actions-row .status-select,
  .hexnet-table-actions-row .btn {
    width: 100%;
    min-height: 44px;
    border-radius: 10px;
    justify-content: center;
  }

  /* ----- Customers tablosu ----- */
  #page-customers table thead {
    display: none;
  }
  #page-customers table tbody tr {
    display: block;
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
  }
  #page-customers table tbody tr td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
  }
  #page-customers table tbody tr td:last-child {
    border-bottom: none;
    display: block;
  }
  #page-customers table tbody td:nth-child(1)::before {
    content: "No";
    font-weight: 700;
    color: var(--muted);
  }
  #page-customers table tbody td:nth-child(2)::before {
    content: "Ad Soyad";
    font-weight: 700;
    color: var(--muted);
  }
  #page-customers table tbody td:nth-child(3)::before {
    content: "Firma";
    font-weight: 700;
    color: var(--muted);
  }
  #page-customers table tbody td:nth-child(4)::before {
    content: "E-posta";
    font-weight: 700;
    color: var(--muted);
  }
  #page-customers table tbody td:nth-child(5)::before {
    content: "Telefon";
    font-weight: 700;
    color: var(--muted);
  }
  #page-customers table tbody td:nth-child(6)::before {
    content: "Durum";
    font-weight: 700;
    color: var(--muted);
  }
  #page-customers table tbody td:nth-child(7)::before {
    content: "İşlem";
    font-weight: 700;
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
  }

  /* ----- Users (aktif kullanıcılar) tablosu ----- */
  #page-users .card:first-of-type table thead {
    display: none;
  }
  #page-users .card:first-of-type table tbody tr {
    display: block;
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
  }
  #page-users .card:first-of-type table tbody tr td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
  }
  #page-users .card:first-of-type table tbody tr td:last-child {
    border-bottom: none;
    display: block;
  }
  #page-users .card:first-of-type table tbody td:nth-child(1)::before {
    content: "No";
    font-weight: 700;
    color: var(--muted);
  }
  #page-users .card:first-of-type table tbody td:nth-child(2)::before {
    content: "Ad Soyad";
    font-weight: 700;
    color: var(--muted);
  }
  #page-users .card:first-of-type table tbody td:nth-child(3)::before {
    content: "E-posta";
    font-weight: 700;
    color: var(--muted);
  }
  #page-users .card:first-of-type table tbody td:nth-child(4)::before {
    content: "Fotoğraf";
    font-weight: 700;
    color: var(--muted);
  }
  #page-users .card:first-of-type table tbody td:nth-child(5)::before {
    content: "Rol";
    font-weight: 700;
    color: var(--muted);
  }
  #page-users .card:first-of-type table tbody td:nth-child(6)::before {
    content: "Firma";
    font-weight: 700;
    color: var(--muted);
  }
  #page-users .card:first-of-type table tbody td:nth-child(7)::before {
    content: "Müşteri";
    font-weight: 700;
    color: var(--muted);
  }
  #page-users .card:first-of-type table tbody td:nth-child(8)::before {
    content: "Durum";
    font-weight: 700;
    color: var(--muted);
  }
  #page-users .card:first-of-type table tbody td:nth-child(9)::before {
    content: "İşlem";
    font-weight: 700;
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
  }

  /* ----- Onay bekleyen / reddedilen başvuru tabloları ----- */
  #usersPendingRegistrationsCard table thead,
  #usersRejectedRegistrationsCard table thead {
    display: none;
  }
  #usersPendingRegistrationsCard table tbody tr,
  #usersRejectedRegistrationsCard table tbody tr {
    display: block;
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
  }
  #usersPendingRegistrationsCard table tbody tr td,
  #usersRejectedRegistrationsCard table tbody tr td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
  }
  #usersPendingRegistrationsCard table tbody tr td:last-child,
  #usersRejectedRegistrationsCard table tbody tr td:last-child {
    border-bottom: none;
    display: block;
  }
  #usersPendingRegistrationsCard table tbody td:nth-child(1)::before {
    content: "No";
    font-weight: 700;
    color: var(--muted);
  }
  #usersPendingRegistrationsCard table tbody td:nth-child(2)::before {
    content: "Ad Soyad";
    font-weight: 700;
    color: var(--muted);
  }
  #usersPendingRegistrationsCard table tbody td:nth-child(3)::before {
    content: "Kullanıcı adı";
    font-weight: 700;
    color: var(--muted);
  }
  #usersPendingRegistrationsCard table tbody td:nth-child(4)::before {
    content: "E-posta";
    font-weight: 700;
    color: var(--muted);
  }
  #usersPendingRegistrationsCard table tbody td:nth-child(5)::before {
    content: "Telefon";
    font-weight: 700;
    color: var(--muted);
  }
  #usersPendingRegistrationsCard table tbody td:nth-child(6)::before {
    content: "Cihaz MAC";
    font-weight: 700;
    color: var(--muted);
  }
  #usersPendingRegistrationsCard table tbody td:nth-child(7)::before {
    content: "Cihaz UID";
    font-weight: 700;
    color: var(--muted);
  }
  #usersPendingRegistrationsCard table tbody td:nth-child(8)::before {
    content: "Fotoğraf";
    font-weight: 700;
    color: var(--muted);
  }
  #usersPendingRegistrationsCard table tbody td:nth-child(9)::before {
    content: "Başvuru tarihi";
    font-weight: 700;
    color: var(--muted);
  }
  #usersPendingRegistrationsCard table tbody td:nth-child(10)::before {
    content: "Durum";
    font-weight: 700;
    color: var(--muted);
  }
  #usersPendingRegistrationsCard table tbody td:nth-child(11)::before {
    content: "İşlem";
    font-weight: 700;
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
  }

  #usersRejectedRegistrationsCard table tbody td:nth-child(1)::before {
    content: "No";
    font-weight: 700;
    color: var(--muted);
  }
  #usersRejectedRegistrationsCard table tbody td:nth-child(2)::before {
    content: "Ad Soyad";
    font-weight: 700;
    color: var(--muted);
  }
  #usersRejectedRegistrationsCard table tbody td:nth-child(3)::before {
    content: "Kullanıcı adı";
    font-weight: 700;
    color: var(--muted);
  }
  #usersRejectedRegistrationsCard table tbody td:nth-child(4)::before {
    content: "E-posta";
    font-weight: 700;
    color: var(--muted);
  }
  #usersRejectedRegistrationsCard table tbody td:nth-child(5)::before {
    content: "Cihaz UID";
    font-weight: 700;
    color: var(--muted);
  }
  #usersRejectedRegistrationsCard table tbody td:nth-child(6)::before {
    content: "Fotoğraf";
    font-weight: 700;
    color: var(--muted);
  }
  #usersRejectedRegistrationsCard table tbody td:nth-child(7)::before {
    content: "Başvuru";
    font-weight: 700;
    color: var(--muted);
  }
  #usersRejectedRegistrationsCard table tbody td:nth-child(8)::before {
    content: "Red nedeni";
    font-weight: 700;
    color: var(--muted);
  }
  #usersRejectedRegistrationsCard table tbody td:nth-child(9)::before {
    content: "Değerlendiren";
    font-weight: 700;
    color: var(--muted);
  }
  #usersRejectedRegistrationsCard table tbody td:nth-child(10)::before {
    content: "Değerlendirme tarihi";
    font-weight: 700;
    color: var(--muted);
  }
  #usersRejectedRegistrationsCard table tbody td:nth-child(11)::before {
    content: "İşlem";
    font-weight: 700;
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
  }

  /* ----- OTA tablosu ----- */
  #page-ota table thead {
    display: none;
  }
  #page-ota table tbody tr {
    display: block;
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
  }
  #page-ota table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid #e2e8f0;
  }
  #page-ota table tbody tr td:last-child {
    border-bottom: none;
  }
  #page-ota table tbody td:nth-child(1)::before {
    content: "Dosya";
    font-weight: 700;
    color: var(--muted);
  }
  #page-ota table tbody td:nth-child(2)::before {
    content: "Ürün";
    font-weight: 700;
    color: var(--muted);
  }
  #page-ota table tbody td:nth-child(3)::before {
    content: "Versiyon";
    font-weight: 700;
    color: var(--muted);
  }
  #page-ota table tbody td:nth-child(4)::before {
    content: "Durum";
    font-weight: 700;
    color: var(--muted);
  }

  /* ----- Badge / durum (pill) ----- */
  .status-badge,
  .status.online,
  .status.warning,
  .status.offline {
    padding: 4px 10px !important;
    font-size: 11px !important;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.3;
  }

  .status.online {
    background: rgba(59, 130, 246, 0.14) !important;
    color: #1d4ed8 !important;
  }

  .status.warning {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #b45309 !important;
  }

  .status.offline {
    background: rgba(148, 163, 184, 0.22) !important;
    color: #64748b !important;
  }

  .status-active {
    background: rgba(34, 197, 94, 0.14) !important;
    color: #15803d !important;
  }

  .status-passive {
    background: rgba(148, 163, 184, 0.22) !important;
    color: #475569 !important;
  }

  /* ----- Ürün kataloğu ----- */
  #page-products .hexnet-products-panel-head {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px;
  }

  #page-products .hexnet-products-panel-head #btnAddProductFamily {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .hexnet-catalog-family-card {
    padding: 14px !important;
  }

  .hexnet-catalog-family-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .hexnet-catalog-family-row > div:last-child {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100% !important;
  }

  .hexnet-catalog-family-row .btn-family-edit,
  .hexnet-catalog-family-row .btn-variant-add {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  #page-products .grid-3 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .hexnet-catalog-variant-card {
    padding: 12px !important;
  }

  .hexnet-catalog-variant-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .hexnet-catalog-variant-row > div:last-child {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100% !important;
    justify-content: stretch !important;
  }

  .hexnet-catalog-variant-row .btn {
    min-height: 44px;
    width: 100%;
    justify-content: center;
  }

  /* ----- Firma kartları ----- */
  #page-companies .firm-card {
    position: relative;
    padding: 16px;
    margin-bottom: 14px;
  }

  #page-companies .firm-card .company-card-header {
    padding-right: 52px;
    margin-bottom: 8px;
    align-items: flex-start;
  }

  #page-companies .firm-card .firm-card-body {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  #page-companies .firm-card .firm-card-logo-slot {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 44px;
    margin: 0;
  }

  #page-companies .firm-card .firm-card-logo-img,
  #page-companies .firm-card .firm-card-logo-placeholder {
    width: 44px !important;
    height: 44px !important;
  }

  #page-companies .firm-card .firm-card-logo-upload {
    font-size: 10px;
    margin-top: 4px;
  }

  #page-companies .firm-card .firm-stats {
    gap: 10px;
    font-size: 12px;
  }

  #page-companies .hexnet-company-row-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
    gap: 10px !important;
  }

  #page-companies .hexnet-company-row-actions .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  /* ----- Profil / güvenlik formları ----- */
  #page-profile .profile-form-grid,
  #page-security .profile-form-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    align-items: stretch !important;
  }

  #page-profile .profile-field-label,
  #page-security .profile-field-label {
    display: block;
    margin-bottom: 6px;
    margin-top: 2px;
  }

  #page-profile .profile-field-label:first-child,
  #page-security .profile-field-label:first-child {
    margin-top: 0;
  }

  #page-profile .profile-field-input,
  #page-security .profile-field-input {
    min-height: 44px;
    padding: 12px 14px;
    box-sizing: border-box;
  }

  #page-profile .profile-actions .btn,
  #page-security .profile-actions .btn,
  #page-profile .profile-upload-btn,
  #page-security .profile-upload-btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  /* ----- Modallar: neredeyse tam ekran (iç gövde genişler) ----- */
  #companyModal[style*="position: fixed"] > div:first-child,
  #customerModal[style*="position: fixed"] > div:first-child,
  #userModal[style*="position: fixed"] > div:first-child,
  #deviceModal[style*="position: fixed"] > div:first-child,
  #familyModal[style*="position: fixed"] > div:first-child,
  #variantModal[style*="position: fixed"] > div:first-child,
  #confirmDeleteModal[style*="position: fixed"] > div:first-child,
  #registrationReviewModal[style*="position: fixed"] > div:first-child {
    max-width: none !important;
    width: 100% !important;
    min-height: 100vh;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  #companyModal[style*="position: fixed"],
  #customerModal[style*="position: fixed"],
  #userModal[style*="position: fixed"],
  #deviceModal[style*="position: fixed"],
  #familyModal[style*="position: fixed"],
  #variantModal[style*="position: fixed"],
  #confirmDeleteModal[style*="position: fixed"],
  #registrationReviewModal[style*="position: fixed"] {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }
}

/* -------------------------------------------------------------------------- */
/* 576px — telefon: tek sütun istatistik, büyük dokunuş alanları               */
/* -------------------------------------------------------------------------- */
@media (max-width: 576px) {
  .stats-dashboard {
    grid-template-columns: 1fr;
  }

  .btn {
    min-height: 44px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .status-select {
    min-height: 44px;
  }

  .topbar-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  #page-dashboard .stats-dashboard {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  #page-dashboard .stats-dashboard .stat-card {
    min-height: 90px;
    padding: 11px 11px 10px;
  }

  #page-dashboard .stats-dashboard .stat-value {
    font-size: 26px;
  }
}
