
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, sans-serif; background: #0f172a; color: #e2e8f0; direction: rtl; }
a { text-decoration: none; color: inherit; }

/* ── Navbar ── */
.navbar {
  background: #1e293b; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; border-bottom: 2px solid #3b82f6;
  position: sticky; top: 0; z-index: 1000;
}
.nav-brand { font-size: 1.1rem; font-weight: 700; color: #3b82f6; white-space: nowrap; }
.nav-links { list-style: none; display: flex; gap: 0.3rem; flex-wrap: wrap; }
.nav-links a { padding: 0.4rem 0.7rem; border-radius: 6px; font-size: 0.82rem; color: #94a3b8; transition: all 0.2s; white-space: nowrap; }
.nav-links a:hover { background: #3b82f6; color: #fff; }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; background: none; border: none; }
.hamburger span { display: block; width: 24px; height: 2px; background: #94a3b8; border-radius: 2px; transition: all 0.3s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.nav-drawer {
  display: none; position: fixed; top: 60px; right: 0; left: 0; bottom: 0;
  background: rgba(15,23,42,0.97); z-index: 999; padding: 1.5rem;
  flex-direction: column; gap: 0.5rem; overflow-y: auto;
}
.nav-drawer.open { display: flex; }
.nav-drawer a { display: block; padding: 0.85rem 1rem; border-radius: 8px; font-size: 1rem; color: #e2e8f0; border-bottom: 1px solid #1e293b; }
.nav-drawer a:hover { background: #3b82f6; color: #fff; }

/* ── Container ── */
.container { max-width: 1400px; margin: 0 auto; padding: 1.5rem; }

/* ── Stats Grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #1e293b; border-radius: 12px; padding: 1.2rem; text-align: center; border: 1px solid #334155; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-3px); border-color: #3b82f6; }
.stat-icon { font-size: 1.8rem; }
.stat-num  { font-size: 1.6rem; font-weight: 700; color: #3b82f6; word-break: break-all; }
.stat-label { font-size: 0.78rem; color: #94a3b8; text-align: center; }

/* ── Page Header ── */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem; }
h1 { font-size: 1.5rem; color: #f1f5f9; }
h2 { font-size: 1.2rem; color: #cbd5e1; margin-bottom: 1rem; }

/* ── Buttons ── */
.btn { display: inline-block; padding: 0.4rem 0.9rem; border-radius: 6px; font-size: 0.82rem; cursor: pointer; border: none; background: #334155; color: #e2e8f0; transition: all 0.2s; white-space: nowrap; }
.btn:hover        { background: #475569; }
.btn-primary      { background: #3b82f6; color: #fff; }
.btn-primary:hover{ background: #2563eb; }
.btn-success      { background: #22c55e; color: #fff; }
.btn-success:hover{ background: #16a34a; }
.btn-warning      { background: #f59e0b; color: #fff; }
.btn-warning:hover{ background: #d97706; }
.btn-danger       { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* ── Table (responsive wrapper) ── */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; background: #1e293b; min-width: 600px; }
thead { background: #0f172a; }
th, td { padding: 0.7rem 0.9rem; text-align: right; font-size: 0.82rem; border-bottom: 1px solid #334155; white-space: nowrap; }
th { color: #94a3b8; font-weight: 600; }
tr:hover { background: #283548; }
tr.warning-row { background: #422006; }

/* ── Badge ── */
.badge { padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.72rem; font-weight: 600; }
.badge-success { background: #166534; color: #86efac; }
.badge-danger  { background: #7f1d1d; color: #fca5a5; }
.badge-warning { background: #78350f; color: #fde68a; }

/* ── Forms ── */
.form-card { background: #1e293b; border-radius: 12px; padding: 1.5rem; border: 1px solid #334155; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; min-width: 160px; }
.form-group label { font-size: 0.82rem; color: #94a3b8; }
.form-group input,
.form-group select,
.form-group textarea {
  background: #0f172a; border: 1px solid #334155; border-radius: 6px;
  padding: 0.55rem 0.75rem; color: #e2e8f0; font-size: 0.88rem; font-family: inherit; width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: #3b82f6; }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group small { color: #64748b; font-size: 0.75rem; }
.form-row { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.form-card .btn { margin-top: 1rem; margin-left: 0.5rem; }

/* Search */
.search-form { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; align-items: center; flex-wrap: wrap; }
.search-form input,
.search-form select { background: #1e293b; border: 1px solid #334155; border-radius: 6px; padding: 0.5rem 0.75rem; color: #e2e8f0; font-size: 0.85rem; min-width: 0; flex: 1; }

/* Info box */
.info-box { background: #1e293b; border-right: 4px solid #3b82f6; border-radius: 8px; padding: 1rem 1.5rem; margin-bottom: 1rem; }
.info-box p { margin-bottom: 0.4rem; font-size: 0.88rem; }

/* Final price */
.final-price-display { background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 1rem; margin: 1rem 0; font-size: 1rem; }
.final-price-display strong { color: #22c55e; font-size: 1.2rem; }

/* Input group */
.input-group { display: flex; }
.input-group input  { border-radius: 8px 0 0 8px; flex: 1; border-left: none; }
.input-group select { border-radius: 0 8px 8px 0; background: #1a2a3a; min-width: 70px; text-align: center; }

/* Price wrap */
.price-wrap { position: relative; }
.price-wrap input { padding-left: 2.8rem; }
.price-currency { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 0.82rem; pointer-events: none; }

/* CPU/RAM hints */
.cpu-hint  { font-size: 0.75rem; color: #64748b; margin-top: 0.25rem; }
.ram-display { font-size: 0.75rem; color: #22c55e; margin-top: 0.25rem; min-height: 1rem; }

/* Sub pills */
.sub-pills { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.sub-pill  { font-size: 0.7rem; padding: 0.2rem 0.55rem; border-radius: 20px; background: #1a2d4a; color: #93c5fd; border: 1px solid #1e40af; white-space: nowrap; }
.sub-pill.expired { background: #2d1a1a; color: #fca5a5; border-color: #7f1d1d; }
.sub-pill.pending { background: #2d2500; color: #fde68a; border-color: #78350f; }

/* No data / note */
.no-data { color: #64748b; padding: 1.5rem; text-align: center; }
.note { color: #94a3b8; font-size: 0.82rem; margin: 0.5rem 0; }
code { background: #0f172a; padding: 0.2rem 0.5rem; border-radius: 4px; font-family: monospace; color: #86efac; }

/* Resources */
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.res-card { background: #1e293b; border-radius: 14px; padding: 1.2rem; border: 1px solid #334155; text-align: center; }
.res-card .res-icon { font-size: 2rem; display: block; margin-bottom: 0.4rem; }
.res-card .res-val  { font-size: 1.5rem; font-weight: 700; color: #3b82f6; word-break: break-all; }
.res-card .res-lbl  { font-size: 0.75rem; color: #94a3b8; margin-top: 0.3rem; }
.progress-wrap { margin-bottom: 2rem; }
.progress-item { background: #1e293b; border-radius: 12px; padding: 1rem 1.2rem; border: 1px solid #334155; margin-bottom: 1rem; }
.progress-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.6rem; gap: 0.5rem; flex-wrap: wrap; }
.progress-header span { font-size: 0.8rem; color: #94a3b8; }
.progress-header strong { font-size: 0.9rem; color: #f1f5f9; }
.progress-bar-bg { background: #0f172a; border-radius: 50px; height: 12px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 50px; transition: width 1s ease; }
.bar-blue   { background: linear-gradient(90deg,#3b82f6,#60a5fa); }
.bar-green  { background: linear-gradient(90deg,#22c55e,#4ade80); }
.bar-orange { background: linear-gradient(90deg,#f59e0b,#fbbf24); }
.bar-purple { background: linear-gradient(90deg,#a855f7,#c084fc); }
.progress-sub { font-size: 0.75rem; color: #64748b; margin-top: 0.3rem; }
.section-title { font-size: 1.1rem; color: #cbd5e1; margin: 1.5rem 0 0.8rem; display: flex; align-items: center; gap: 0.5rem; }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .container { padding: 1rem; }
  h1 { font-size: 1.2rem; }

  /* Hide desktop nav, show hamburger */
  .nav-links { display: none; }
  .hamburger { display: flex; }

  /* Stack form rows */
  .form-row { flex-direction: column; gap: 0.75rem; }
  .form-group { min-width: 100%; }

  /* Full-width buttons on mobile */
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header .btn { width: 100%; text-align: center; }

  /* Stat cards smaller */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-num { font-size: 1.2rem; }

  /* Table scroll hint */
  .table-wrap::before {
    content: "← اسحب للتمرير";
    display: block; font-size: 0.72rem; color: #64748b;
    text-align: left; margin-bottom: 0.4rem;
  }

  /* Tighten table */
  th, td { padding: 0.5rem 0.6rem; font-size: 0.75rem; }

  /* Action buttons in table: smaller */
  td .btn { padding: 0.3rem 0.55rem; font-size: 0.72rem; margin-bottom: 0.2rem; }

  /* Form card padding */
  .form-card { padding: 1rem; }

  /* Search form */
  .search-form { flex-direction: column; align-items: stretch; }
  .search-form input,
  .search-form select,
  .search-form .btn { width: 100%; }

  /* Info box */
  .info-box { padding: 0.75rem 1rem; }

  /* Resources grid */
  .res-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .res-grid   { grid-template-columns: 1fr 1fr; }
}
