/* =============================================
   سیستەمی قەرز - Modern Dark Theme (High Contrast & Mobile Friendly)
   ============================================= */

:root {
  --bg-main: #0b0e14;
  --bg-card: #151b26;
  --bg-input: #1d2433;
  --bg-sidebar: #10151f;
  --border-color: #273142;
  --gold: #f5a623;
  --gold-dark: #d4891a;
  --text-primary: #f0f3f8;
  --text-muted: #9aa7bc;
  /* ڕوونتر و دیارتر */
  --success: #2ecc71;
  --danger: #f05252;
  --warning: #f59e0b;
  --info: #38bdf8;
}

/* ── Base ── */
body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, 'Segoe UI', 'Noto Sans Arabic', Tahoma, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ── Login page ── */
.bg-dark-custom {
  background: radial-gradient(ellipse at center, #141c2e 0%, #0b0e14 100%);
}

.bg-dark-card {
  background-color: var(--bg-card) !important;
}

.bg-dark-input {
  background-color: var(--bg-input) !important;
}

.border-dark-input {
  border-color: var(--border-color) !important;
}

.login-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #1d2433, #2a354c);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(245, 166, 35, .25);
}

/* ── Gold helpers ── */
.text-gold {
  color: var(--gold) !important;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0b0e14;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all .2s ease-in-out;
}

.btn-gold:hover {
  filter: brightness(1.1);
  color: #000;
  box-shadow: 0 4px 15px rgba(245, 166, 35, .4);
}

/* ── Sidebar ── */
#sidebar {
  width: 250px;
  min-height: 100vh;
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  transition: right .3s ease;
  flex-shrink: 0;
  z-index: 1050;
}

#sidebar .brand {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border-color);
}

#sidebar .nav-link {
  color: #b0bcd0;
  border-radius: 8px;
  margin: 3px 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  transition: all .2s;
}

#sidebar .nav-link i {
  font-size: 1.15rem;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
  color: #ffffff;
  background-color: rgba(245, 166, 35, .15);
}

#sidebar .nav-link.active {
  color: var(--gold);
  font-weight: 600;
}

/* ── Main layout ── */
#main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.top-navbar {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
}

/* ── Cards ── */
.card-dark {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.card-dark .card-header {
  background-color: rgba(255, 255, 255, .02);
  border-bottom: 1px solid var(--border-color);
  border-radius: 12px 12px 0 0 !important;
}

/* ── Stat cards ── */
.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

/* ── Tables ── */
.table-dark-custom {
  color: var(--text-primary);
  border-color: var(--border-color);
  margin-bottom: 0;
}

.table-dark-custom thead th {
  background-color: rgba(245, 166, 35, .07);
  color: var(--gold);
  border-color: var(--border-color);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 10px;
  white-space: nowrap;
}

.table-dark-custom tbody tr {
  border-color: var(--border-color);
  transition: background .15s;
}

.table-dark-custom tbody tr:hover {
  background-color: rgba(255, 255, 255, .03);
}

.table-dark-custom td {
  vertical-align: middle;
  border-color: var(--border-color);
  padding: 12px 10px;
  font-size: 0.92rem;
}

/* ── Text helpers ── */
.text-muted {
  color: #9aa7bc !important;
  /* ڕەنگێکی زۆر دیارتر بۆ مۆبایل و دیسکتۆپ */
}

.text-light-sub {
  color: #cbd5e1;
}

/* ── Forms ── */
.form-control,
.form-select,
.input-group-text {
  background-color: var(--bg-input) !important;
  border-color: var(--border-color) !important;
  color: #ffffff !important;
  border-radius: 8px;
  font-size: 0.93rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(245, 166, 35, .2) !important;
  color: #fff !important;
}

.form-label {
  color: #cbd5e1;
  font-size: .88rem;
  font-weight: 500;
}

::placeholder {
  color: #76849b !important;
  opacity: 1;
}

/* ── Modals ── */
.modal-dark .modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 12px;
}

.modal-dark .modal-header {
  border-bottom-color: var(--border-color);
}

.modal-dark .modal-footer {
  border-top-color: var(--border-color);
}

.modal-dark .btn-close {
  filter: invert(1);
}

/* ── Badges ── */
.badge {
  font-size: .78rem;
  padding: .45em .75em;
  border-radius: 6px;
  font-weight: 500;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: #2a354c;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dark);
}

/* ── Backdrop for Mobile Sidebar ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  z-index: 1040;
}

.sidebar-overlay.active {
  display: block;
}

/* ── Responsive Mobile (مۆبایل بێکێشە) ── */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0;
    right: -270px;
    /* RTL: لە لای ڕاستەوە دەشاردرێتەوە */
    left: auto;
    width: 260px;
    height: 100vh;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.6);
  }

  #sidebar.open {
    right: 0 !important;
  }

  .top-navbar {
    padding: 10px 14px;
  }

  .page-content-padding {
    padding: 14px !important;
  }

  .stat-card {
    padding: 14px;
  }

  .table-responsive {
    border-radius: 8px;
    border: 1px solid var(--border-color);
  }
}