/* ═══════════════════════════════════════════════════════════
   DASHBOARD  —  Sunset Orange Brand
   ═══════════════════════════════════════════════════════════ */

/* ── Top Section Grid ───────────────────────────────────── */
.top-section {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 18px;
}

/* ── Hero Card ──────────────────────────────────────────── */
.hero-card {
  background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-secondary-light) 60%, #2C2C46 100%);
  border-radius: 24px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Subtle dot grid texture */
.hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

/* Orange glow blob top-right */
.hero-card::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(242, 166, 90, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.hero-live {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--brand-teal);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(16, 185, 129, 0.7); }
  50%       { opacity: 0.6; box-shadow: 0 0 14px rgba(16, 185, 129, 0.3); }
}

.network-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.network-pill i { color: var(--brand-primary); font-size: 0.9rem; }

.hero-data { position: relative; z-index: 1; }

.hero-data-num {
  font-size: 4rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.04em;
  line-height: 1;
}

.hero-data-unit {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-left: 6px;
}

.hero-data-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.38);
  margin-top: 6px;
}

.hero-plan-row {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.hero-plan-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.hero-plan-validity {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.38);
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-actions {
  display: flex;
  gap: 10px;
  position: relative;
  z-index: 1;
  align-items: flex-start;
  width: 100%;
  justify-content: flex-end;
}

/* ── Donut Card ─────────────────────────────────────────── */
.donut-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  box-shadow: var(--shadow-xs);
}

.donut-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.donut-card-title { font-size: 0.875rem; font-weight: 700; color: var(--text-main); }

.donut-period {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-main);
  padding: 3px 9px;
  border-radius: 99px;
}

.donut-wrap { position: relative; width: 120px; height: 120px; }
.donut-wrap svg { transform: rotate(-90deg); }
.donut-track { fill: none; stroke: var(--border); stroke-width: 9; }
.donut-fill {
  fill: none;
  stroke: var(--brand-primary);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 399;
  stroke-dashoffset: 189;
  filter: drop-shadow(0 2px 8px rgba(242, 166, 90, 0.5));
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-pct {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1;
}

.donut-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.donut-legend { display: flex; gap: 16px; margin-top: 10px; }
.dl-item { display: flex; align-items: center; gap: 6px; }
.dl-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dl-text { font-size: 0.73rem; color: var(--text-muted); font-weight: 500; }

.donut-conn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg-main);
  border: 1px solid var(--border);
}

.donut-conn .conn-left { display: flex; align-items: center; gap: 10px; }

.donut-conn .conn-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.donut-conn .conn-info { display: flex; flex-direction: column; }
.donut-conn .conn-label { font-size: 0.75rem; color: var(--text-main); font-weight: 700; }
.donut-conn .conn-val   { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; font-weight: 600; }
.donut-conn .conn-sub   { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }
.donut-conn .conn-status { font-size: 0.7rem; color: var(--brand-teal); font-weight: 600; }

/* ── Overview Grid ──────────────────────────────────────── */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.ov-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.ov-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.ov-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ov-icon.indigo  { background: #EEF0FF; color: #4C51BF; }
.ov-icon.blue    { background: var(--brand-primary-soft); color: var(--brand-primary); }
.ov-icon.teal    { background: var(--brand-teal-soft);    color: var(--brand-teal); }

.ov-body { flex: 1; min-width: 0; }

.ov-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ov-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 2px 0;
}

.ov-unit { font-size: 0.7rem; color: var(--text-muted); }

.ov-ring-wrap { position: relative; width: 48px; height: 48px; flex-shrink: 0; }
.ov-ring-wrap svg { transform: rotate(-90deg); }
.mr-bg   { fill: none; stroke: var(--border); stroke-width: 4; }
.mr-fill { fill: none; stroke: var(--brand-primary); stroke-linecap: round; stroke-width: 4; }
.mr-fill.teal-stroke { stroke: var(--brand-teal); }

.ov-pct {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-main);
}

/* ── Middle Section ─────────────────────────────────────── */
.middle-section {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 18px;
}

/* Quick Links */
.ql-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.view-all {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 3px;
  transition: gap 0.15s;
}

.view-all:hover { gap: 6px; }

.ql-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.ql-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-main);
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
}

.ql-item:hover {
  transform: translateY(-2px);
  background: var(--white);
  border-color: var(--brand-primary);
  box-shadow: var(--glow-orange);
}

.ql-icon {
  width: 36px;
  height: 36px;
  background: var(--white);
  border-radius: 10px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-xs);
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s;
}

.ql-item:nth-child(odd)  .ql-icon i { color: var(--brand-primary); }
.ql-item:nth-child(even) .ql-icon i { color: var(--brand-teal); }
.ql-icon i { font-size: 1rem; transition: all 0.22s ease; }

.ql-item:hover .ql-icon   { background: var(--brand-primary); }
.ql-item:hover .ql-icon i { color: var(--white) !important; transform: scale(1.12); }

.ql-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  transition: color 0.22s;
}

.ql-sub { font-size: 0.68rem; color: var(--text-muted); font-weight: 500; }
.ql-item:hover .ql-label { color: var(--brand-primary); }

.ql-text, .ql-icon { position: relative; z-index: 1; }

/* eSIM Card */
.esim-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-xs);
}

.esim-list { display: flex; flex-direction: column; gap: 8px; }

.esim-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

.esim-item:hover {
  background: var(--chalk);
  border-color: var(--brand-primary-soft);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.esim-flag {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.esim-flag img { width: 100%; height: 100%; object-fit: cover; }

.esim-info { flex: 1; min-width: 0; }

.esim-name { font-size: 0.9rem; font-weight: 700; color: var(--brand-primary); }

.esim-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 3px; font-weight: 500; }

/* Status pills */
.esim-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.esim-status-pill.connected {
  background: var(--brand-teal-soft);
  color: var(--brand-teal);
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.esim-status-pill.ready {
  background: var(--brand-primary-soft);
  color: var(--brand-primary-deep);
  border: 1px solid rgba(242, 166, 90, 0.25);
}

.esim-status-pill.expired {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid rgba(220, 38, 38, 0.18);
}

.esim-status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.esim-status-pill.connected::before { background: var(--brand-teal); }
.esim-status-pill.ready::before     { background: var(--brand-primary); }
.esim-status-pill.expired::before   { background: #DC2626; }

/* Progress Bar */
.esim-bar-col { width: 100px; flex-shrink: 0; margin-left: 10px; }

.esim-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.esim-bar-track { height: 6px; background: var(--border); border-radius: 10px; overflow: hidden; }
.esim-bar-fill  { height: 100%; border-radius: 10px; }
.esim-bar-fill.teal  { background: var(--brand-teal); }
.esim-bar-fill.navy  { background: var(--brand-primary); }
.esim-bar-fill.red   { background: #EF4444; }

/* ── Activity Table ─────────────────────────────────────── */
.activity-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
}

.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.activity-table-wrap { overflow-x: auto; }

table.at { width: 100%; border-collapse: collapse; }
table.at thead tr { background: var(--bg-main); }

table.at th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.at th:last-child { text-align: right; }

table.at td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.845rem;
  color: var(--text-muted);
  vertical-align: middle;
}

table.at tbody tr:last-child td { border-bottom: none; }
table.at tbody tr:hover { background: var(--bg-main); }

.td-icon {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.td-icon.success { background: var(--brand-teal-soft); color: var(--brand-teal); }
.td-icon.info    { background: var(--brand-primary-soft); color: var(--brand-primary); }
.td-icon.warn    { background: #FEF2F2; color: #DC2626; }

.td-cell { display: flex; align-items: center; gap: 10px; }
.td-title { font-weight: 600; color: var(--text-main); font-size: 0.845rem; }
.td-desc  { font-size: 0.7rem; color: var(--text-muted); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 600;
}

.status-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; }

.status-badge.success, .esim-status-pill.connected {
  background: var(--brand-teal-soft);
  color: var(--brand-teal);
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.status-badge.success::before { background: var(--brand-teal); }
.esim-status-pill.connected::before { background: var(--brand-teal); }

.status-badge.expired {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid rgba(220, 38, 38, 0.18);
}

.status-badge.expired::before { background: #DC2626; }

.td-amount { text-align: right; font-weight: 700; color: var(--text-main); }
.td-amount.pos { color: var(--brand-teal); }

/* ── Page Header ────────────────────────────────────────── */
.section-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.page-header { line-height: 1.3; }

.page-header h1 {
  font-size: 2rem;
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-header p { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; }

/* ── Generic Modal ──────────────────────────────────────── */
.generic-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.generic-modal.open { display: flex; }

.generic-modal .gm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 46, 0.5);
  backdrop-filter: blur(6px);
}

.generic-modal .gm-box {
  position: relative;
  z-index: 2;
  width: 720px;
  max-width: 94%;
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.gm-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.gm-title { font-size: 1.05rem; font-weight: 800; color: var(--brand-primary); }

.gm-body { padding: 18px 20px; color: var(--text-muted); font-size: 0.95rem; }

.gm-actions {
  padding: 14px 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

.gm-btn { padding: 9px 14px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.gm-btn.primary { background: var(--brand-primary); color: #fff; }
.gm-btn.ghost   { background: transparent; border: 1px solid var(--border); color: var(--text-main); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .top-section        { grid-template-columns: 1fr; gap: 14px; }
  .hero-card          { padding: 20px; border-radius: 18px; }
  .donut-card         { padding: 18px; align-items: stretch; }
  .donut-wrap         { margin: 0 auto; }
  .hero-data          { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .hero-data-num      { font-size: 3rem; }
  .hero-data-unit     { font-size: 1rem; }
  .hero-plan-row      { flex-direction: column; align-items: flex-start; gap: 6px; }
  .hero-actions       { justify-content: space-between; flex-wrap: wrap; gap: 8px; }
  .donut-legend       { flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 12px; }
  .overview-grid      { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .middle-section     { grid-template-columns: 1fr; gap: 14px; }
  .ql-card, .esim-card { padding: 18px; }
  .ql-grid            { grid-template-columns: repeat(3, 1fr); }
  .donut-conn         { flex-direction: column; align-items: stretch; gap: 8px; }
  .donut-conn .conn-status { align-self: flex-start; }
  .page-header h1     { font-size: 1.6rem; }
  .page-header p      { font-size: 0.8rem; }
}

@media (max-width: 600px) {
  .hero-card          { padding: 16px; }
  .hero-data-num      { font-size: 2.4rem; }
  .donut-card         { padding: 14px; }
  .overview-grid      { grid-template-columns: 1fr; }
  .ov-card            { padding: 12px; gap: 10px; }
  .ov-val             { font-size: 1.25rem; }
  .ql-grid            { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ql-item            { padding: 10px; }
  .ql-icon            { width: 34px; height: 34px; }
  .ql-label           { font-size: 0.78rem; }
  .esim-list          { gap: 10px; }
  .esim-item          { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; }
  .esim-flag          { width: 48px; height: 32px; border-radius: 6px; }
  .esim-info          { width: 100%; }
  .esim-bar-col       { width: 100%; margin-left: 0; }
  .esim-bar-header    { margin-bottom: 8px; }
  .esim-bar-track     { height: 8px; }
  .esim-status-pill   { align-self: flex-end; }
  .gm-actions         { flex-direction: column-reverse; align-items: stretch; }
}