/* ============================================================
   KIRAKNOWS — Global Styles
   Dark theme · Inter font · Purple accent #7c6af7
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:            #0e0e0e;
  --bg-card:       #141414;
  --bg-card-hover: #1c1c1c;
  --bg-modal:      #161616;
  --bg-input:      #1a1a1a;
  --bg-hero:       #111;
  --bg-hover:      #222;
  --surface-bg:    #161616;
  --border:        #2a2a2a;
  --border-focus:  #7c6af7;

  --accent:        #7c6af7;
  --accent-dim:    #5b52c4;
  --accent-glow:   rgba(124,106,247,0.22);
  --accent-light:  #a89cf7;

  --text:          #f0f0f0;
  --text-muted:    #888;
  --text-subtle:   #555;

  --success:       #34d399;
  --danger:        #f87171;
  --danger-dim:    #b91c1c;

  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  20px;

  --shadow-card:  0 4px 24px rgba(0,0,0,0.5);
  --shadow-modal: 0 24px 80px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.04);

  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ---- Header ----------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14,14,14,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  user-select: none;
  flex-shrink: 0;
}
.logo-eye {
  font-size: 24px;
  filter: drop-shadow(0 0 8px var(--accent-glow));
  transition: transform var(--transition);
}
.logo:hover .logo-eye { transform: scale(1.2) rotate(-10deg); }
.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 30%, var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Breadcrumb nav */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.breadcrumb-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  transition: color var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.breadcrumb-back:hover { color: var(--text); }
.breadcrumb-sep { color: var(--text-subtle); font-size: 12px; }
.breadcrumb-current {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-light);
  box-shadow: 0 4px 20px rgba(124,106,247,0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-input); color: var(--text); }

.btn-danger { background: var(--danger-dim); color: #fff; }
.btn-danger:hover { background: #ef4444; }

.btn-lg { padding: 12px 24px; font-size: 15px; }

.icon-btn {
  padding: 8px 10px;
}
.icon-btn:hover svg { stroke: var(--accent-light); }

/* ---- List page main --------------------------------------- */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ---- Empty state ------------------------------------------ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  text-align: center;
  animation: fadeInUp 0.5s ease both;
}
.empty-illustration {
  margin-bottom: 8px;
  filter: drop-shadow(0 0 40px var(--accent-glow));
  animation: floatOrb 4s ease-in-out infinite;
}
@keyframes floatOrb {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
.empty-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 40%, var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.empty-subtitle { color: var(--text-muted); font-size: 15px; margin-bottom: 8px; }

/* ---- Section header --------------------------------------- */
.apps-section { animation: fadeInUp 0.4s ease both; }
.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.section-title { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }
.app-count {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---- App grid --------------------------------------------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* ---- App card --------------------------------------------- */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--transition);
  cursor: pointer;
  overflow: hidden;
}
.app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.app-card:hover { background: var(--bg-card-hover); border-color: rgba(124,106,247,0.4); box-shadow: var(--shadow-card); transform: translateY(-2px); }
.app-card:hover::before { opacity: 1; }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* ---- Platform icon (dark bg so all SVG colors are visible) - */
.card-platform-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #111;
  border: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.card-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--success); }
  50%       { opacity: 0.6; box-shadow: 0 0 12px var(--success); }
}

.card-info { flex: 1; min-width: 0; }
.card-name {
  font-size: 16px; font-weight: 600; letter-spacing: -0.2px;
  margin-bottom: 6px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-package {
  font-size: 12px; color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px 8px;
  display: inline-block; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-date { font-size: 12px; color: var(--text-subtle); }
.card-remove-btn {
  background: transparent; border: 1px solid transparent;
  color: var(--text-subtle); font-size: 12px; font-family: inherit;
  padding: 4px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition); opacity: 0;
}
.app-card:hover .card-remove-btn { opacity: 1; }
.card-remove-btn:hover { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.3); color: var(--danger); }

@keyframes cardFlash {
  0%   { opacity: 0; transform: translateY(12px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.app-card.new-card { animation: cardFlash 0.45s cubic-bezier(0.34,1.56,0.64,1) both; }

/* ---- Loading skeleton ------------------------------------- */
.loading-state { display: flex; flex-direction: column; align-items: center; gap: 20px; padding-top: 60px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; width: 100%; }
.skeleton-card {
  height: 160px;
  background: linear-gradient(90deg, var(--bg-card) 25%, #1e1e1e 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius); border: 1px solid var(--border);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.loading-hint { color: var(--text-subtle); font-size: 13px; font-style: italic; }

/* ---- Modals ----------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px); z-index: 100; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 101; background: var(--bg-modal);
  border: 1px solid rgba(255,255,255,0.07); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal); width: 100%; max-width: 520px;
  padding: 28px; animation: modalIn 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
  max-height: 90vh; overflow-y: auto;
}
.modal-sm { max-width: 380px; }
@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 16px)) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.modal-close {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); width: 34px; height: 34px;
  border-radius: 8px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-input); color: var(--text); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
}

/* ---- Form ------------------------------------------------- */
.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.form-group:last-of-type { margin-bottom: 0; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.3px; text-transform: uppercase; }
.form-input, .form-select, .form-textarea {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: inherit;
  font-size: 14px; padding: 11px 14px; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none; appearance: none;
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; cursor: pointer;
}
.form-select option[disabled] { color: var(--text-subtle); }
.form-textarea { resize: vertical; min-height: 160px; font-family: 'SF Mono','Fira Code',monospace; font-size: 12.5px; line-height: 1.7; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-subtle); }

/* Setup guide */
.setup-guide { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #0d0d0d; overflow: hidden; }
.setup-guide-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; font-size: 12px; font-weight: 500; color: var(--accent-light);
  cursor: pointer; user-select: none; list-style: none;
  transition: background var(--transition);
}
.setup-guide-toggle::-webkit-details-marker { display: none; }
.setup-guide-toggle:hover { background: var(--bg-input); }
.setup-guide-arrow { font-size: 10px; transition: transform var(--transition); color: var(--accent); }
.setup-guide[open] .setup-guide-arrow { transform: rotate(90deg); }
.setup-steps { list-style: none; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.setup-steps li { display: flex; gap: 12px; padding: 14px; font-size: 12px; color: var(--text-muted); line-height: 1.6; border-bottom: 1px solid var(--border); }
.setup-steps li:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-glow); border: 1px solid var(--accent);
  color: var(--accent-light); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.step-body strong { color: var(--text); font-weight: 600; display: block; margin-bottom: 3px; }
.step-body em { color: var(--accent-light); font-style: normal; }
.step-body code { font-family: 'SF Mono','Fira Code',monospace; font-size: 11px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--text); }
.setup-link { color: var(--accent-light); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color var(--transition); }
.setup-link:hover { border-bottom-color: var(--accent-light); }

.form-error { font-size: 13px; color: var(--danger); background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.2); border-radius: var(--radius-sm); padding: 10px 13px; line-height: 1.5; margin-top: 8px; }
.confirm-text { color: var(--text-muted); font-size: 14px; line-height: 1.6; }

/* ---- Spinner ---------------------------------------------- */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite; flex-shrink: 0;
}
.spinner-lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Inline status ---------------------------------------- */
.inline-status { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: 13px; }

/* ============================================================
   DETAIL PAGE
   ============================================================ */

/* Detail page loading */
.dp-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 60vh; gap: 16px;
  color: var(--text-subtle); font-size: 13px; font-style: italic;
}

/* Hero band */
.dp-hero {
  background: linear-gradient(180deg, #151520 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.dp-hero-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 36px 32px 32px;
  display: flex; align-items: flex-start; gap: 24px;
}

.dp-hero-icon {
  width: 72px; height: 72px; border-radius: 18px;
  background: #111; border: 1px solid #2a2a2a;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.dp-hero-info { flex: 1; min-width: 0; }
.dp-hero-name {
  font-size: 28px; font-weight: 700; letter-spacing: -0.8px;
  color: var(--text); margin-bottom: 8px; line-height: 1.2;
}
.dp-hero-package {
  font-family: 'SF Mono','Fira Code',monospace;
  font-size: 13px; color: var(--text-muted);
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; display: inline-block;
  margin-bottom: 12px;
}
.dp-hero-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dp-hero-date { font-size: 13px; color: var(--text-subtle); }
.dp-live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--success); font-weight: 500;
  background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.2);
  border-radius: 999px; padding: 4px 10px;
}

/* Page body */
.dp-body {
  max-width: 1200px; margin: 0 auto;
  padding: 32px 32px 80px;
  display: flex; flex-direction: column; gap: 20px;
}

/* Section (metrics) */
.dp-section { }
.dp-section-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-subtle);
  margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.coming-soon-tag {
  font-size: 10px; font-weight: 500; text-transform: none; letter-spacing: 0;
  background: var(--accent-glow); border: 1px solid var(--accent);
  color: var(--accent-light); border-radius: 4px; padding: 2px 7px;
}

/* Metrics grid */
.dp-metrics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.dp-metric-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color var(--transition);
}
.dp-metric-card:hover { border-color: rgba(124,106,247,0.3); }
.dp-metric-icon { font-size: 22px; }
.dp-metric-label { font-size: 11px; color: var(--text-subtle); font-weight: 500; margin-top: 2px; }
.dp-metric-value { font-size: 26px; font-weight: 700; letter-spacing: -1px; color: var(--text-subtle); }

/* Info 2-col grid */
.dp-info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

/* Card */
.dp-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.dp-card-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-subtle); margin-bottom: 18px;
}
.dp-fields { display: flex; flex-direction: column; gap: 14px; }
.dp-field { display: flex; flex-direction: column; gap: 4px; }
.dp-field-label { font-size: 11px; color: var(--text-subtle); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.dp-field-value { font-size: 13px; color: var(--text); word-break: break-all; }
.dp-field-value.mono {
  font-family: 'SF Mono','Fira Code',monospace;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 4px; padding: 4px 8px; font-size: 12px; display: inline-block;
}
.dp-field-value.small { font-size: 11px; opacity: 0.7; }

/* Danger card */
.dp-danger-card { border-color: rgba(248,113,113,0.2); background: rgba(248,113,113,0.03); }
.danger-title-text { color: rgba(248,113,113,0.7); }
.dp-danger-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dp-danger-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.dp-danger-desc { font-size: 12px; color: var(--text-subtle); line-height: 1.5; }

/* ---- Responsive ------------------------------------------- */
@media (max-width: 900px) {
  .dp-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .dp-info-grid    { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-inner { padding: 0 16px; }
  .main         { padding: 32px 16px 60px; }
  .app-grid     { grid-template-columns: 1fr; }
  .modal        { padding: 20px; max-width: calc(100% - 32px); }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; justify-content: center; }
  .section-header { flex-wrap: wrap; }
  .dp-hero-inner  { flex-direction: column; gap: 16px; padding: 24px 16px 20px; }
  .dp-hero-name   { font-size: 22px; }
  .dp-body        { padding: 20px 16px 60px; }
  .dp-metrics-grid { grid-template-columns: 1fr 1fr; }
  .dp-danger-row  { flex-direction: column; align-items: flex-start; }
  .breadcrumb-current { display: none; }
}

/* ============================================================
   DETAIL PAGE TABS
   ============================================================ */
.dp-tabs {
  display: flex;
  gap: 1.5rem;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.dp-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
  padding: 1rem 0;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.dp-tab:hover {
  color: var(--text);
}

.dp-tab.active {
  color: var(--accent-light);
}

.dp-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent-color);
  border-radius: 2px 2px 0 0;
}

/* ============================================================
   PURCHASES TAB
   ============================================================ */
.purchases-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-select, .filter-date {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
  width: auto;
}
.filter-select:focus, .filter-date:focus {
  border-color: var(--accent-color);
}

.stats {
  font-weight: 500;
  color: var(--text-muted);
}

.purchases-table-container, .imports-table {
  width: 100%;
  overflow-x: auto;
  background: var(--surface-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.purchases-table, .imports-table {
  width: 100%;
  border-collapse: collapse;
}

.purchases-table th, .imports-table th {
  text-align: left;
  padding: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
}

.purchases-table td, .imports-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.purchases-table tr:hover td {
  background: var(--bg-hover);
}

.purchases-table tr:last-child td, .imports-table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success  { background: rgba(52, 168, 83, 0.15); color: #34A853; }
.badge-warning  { background: rgba(251, 188, 5, 0.15); color: #FBBC05; }
.badge-danger   { background: rgba(234, 67, 53, 0.15); color: #EA4335; }
.badge-trial    { background: rgba(124, 106, 247, 0.15); color: #a291fb; }
.badge-refund   { background: rgba(234, 67, 53, 0.12); color: #f87171; }
.badge-purchase  { background: rgba(52, 168, 83, 0.15); color: #34A853; }
.badge-renewal   { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.badge-canceled  { background: rgba(234, 67, 53, 0.12); color: #f87171; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.page-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.purchases-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-hover);
  border-radius: 12px;
  border: 1px dashed var(--border);
}
.purchases-empty p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ============================================================
   IMPORTS (SETTINGS TAB)
   ============================================================ */
.dp-import-card {
  margin-bottom: 2rem;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  background: var(--bg-hover);
  margin-bottom: 1.5rem;
}

.upload-zone:hover {
  background: rgba(124, 106, 247, 0.05);
  border-color: var(--accent-light);
}

.upload-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.upload-text {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.import-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.import-feedback {
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}
.import-feedback.success {
  background: rgba(52, 168, 83, 0.1);
  color: #34A853;
  border: 1px solid rgba(52, 168, 83, 0.2);
}
.import-feedback.error {
  background: rgba(234, 67, 53, 0.1);
  color: #EA4335;
  border: 1px solid rgba(234, 67, 53, 0.2);
}

.history-title {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text);
}
