/* css/style.css - Subscription Manager v2 */

/* ===== Google Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== Design Tokens ===== */
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Main color */
  --color-primary: #f9c78b;
  --color-primary-dark: #e5a54d;
  --color-primary-light: #fbd9a8;
  --color-accent: #f0b466;

  /* Backgrounds */
  --bg-body: linear-gradient(135deg, #0a0a0a 0%, #171513 50%, #12100e 100%);
  --bg-card: rgba(25, 23, 20, 0.6);
  --bg-card-hover: rgba(35, 32, 28, 0.8);
  --bg-card-border: rgba(249, 199, 139, 0.08);

  /* Inputs & Modals */
  --bg-input: rgba(10, 10, 10, 0.5);
  --bg-input-focus: rgba(255, 255, 255, 0.05);
  --bg-modal-overlay: rgba(0, 0, 0, 0.75);

  /* Text colors */
  --text-primary: #f5efe6;
  --text-secondary: #b8a99a;
  --text-muted: #8a7d72;
  --text-accent: #f9c78b;

  /* Semantic colors */
  --color-success: #6bcb77;
  --color-warning: #fbbf24;
  --color-danger: #e86b6b;
  --color-info: #6bc5d4;

  /* Radius & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.30);
  --shadow-glow: 0 0 20px rgba(249, 199, 139, 0.12);

  /* Animations */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Light Theme ===== */
[data-theme="light"] {
  --color-primary: #c77d2e;
  --color-primary-dark: #a86518;
  --color-primary-light: #d4943f;
  --color-accent: #b8722a;

  --bg-body: linear-gradient(135deg, #f5f0eb 0%, #ede6df 50%, #f0ebe5 100%);
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --bg-card-border: rgba(180, 160, 140, 0.2);
  --bg-input: rgba(255, 255, 255, 0.6);
  --bg-input-focus: rgba(255, 255, 255, 0.85);
  --bg-modal-overlay: rgba(0, 0, 0, 0.4);

  --text-primary: #2c2418;
  --text-secondary: #6b5e52;
  --text-muted: #9a8e82;
  --text-accent: #c77d2e;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(199, 125, 46, 0.1);
}

[data-theme="light"] .modal-content {
  background: #f8f4ef;
}

[data-theme="light"] .filter-select option,
[data-theme="light"] .sort-select option,
[data-theme="light"] .form-select option,
[data-theme="light"] .footer-settings select option {
  background: #f8f4ef;
  color: #2c2418;
}

[data-theme="light"] ::-webkit-scrollbar-track {
  background: #ede6df;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(180, 160, 140, 0.4);
  border-color: #ede6df;
}

[data-theme="light"] .btn-primary {
  color: #fff;
}

/* ===== Subscription Status Styles ===== */
.subscription-card.status-paused {
  opacity: 0.55;
}

.subscription-card.status-cancelled {
  opacity: 0.40;
}

.subscription-card.status-cancelled .card-price {
  text-decoration: line-through;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-top: 0.25rem;
}

.status-badge.paused {
  color: #d4a537;
  background: rgba(212, 165, 55, 0.12);
}

.status-badge.cancelled {
  color: #b8892a;
  background: rgba(184, 137, 42, 0.12);
}

/* ===== Billing Reminder Badge ===== */
.billing-reminder-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-warning);
  background: rgba(251, 191, 36, 0.15);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-left: 0.5rem;
  animation: pulse 2s ease-in-out infinite;
  vertical-align: middle;
  will-change: opacity;
}

[data-theme="light"] .billing-reminder-badge {
  color: #b45309;
  background: rgba(180, 83, 9, 0.12);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* ===== Group Header ===== */
.group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-top: 0.75rem;
  border-bottom: 1px solid var(--bg-card-border);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.group-header:first-child {
  margin-top: 0;
}

/* ===== Sample Data Banner ===== */
.sample-data-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  margin-bottom: 0.75rem;
  background: rgba(249, 199, 139, 0.1);
  border: 1px solid rgba(249, 199, 139, 0.25);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.sample-data-banner .material-icons {
  font-size: 1.1rem;
  color: var(--color-accent);
  flex-shrink: 0;
  vertical-align: middle;
  line-height: 1;
}

/* ===== Import Preview ===== */
.import-preview-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--bg-card-border);
  font-size: 0.8125rem;
}

.import-preview-item:last-child {
  border-bottom: none;
}


/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #12100e;
}

::-webkit-scrollbar-thumb {
  background: rgba(249, 199, 139, 0.3);
  border: 2px solid #12100e;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 199, 139, 0.6);
}

/* ===== Layout ===== */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ===== Header ===== */
.app-header {
  text-align: left;
  margin-bottom: 2.5rem;
}

.app-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.app-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 300;
}

/* ===== Toolbar (Search + Filters) ===== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.75rem;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-family);
  transition: var(--transition-fast);
  outline: none;
}

.search-box input:focus {
  background: var(--bg-input-focus);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(249, 199, 139, 0.15);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box .search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.125rem;
  pointer-events: none;
}

.filter-select {
  padding: 0.625rem 2rem 0.625rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-family);
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
  min-width: 140px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.filter-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(249, 199, 139, 0.15);
}

.filter-select option {
  background: #171513;
  color: var(--text-primary);
}

.sort-select {
  padding: 0.625rem 2rem 0.625rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-family);
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
  min-width: 140px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.sort-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(249, 199, 139, 0.15);
}

.sort-select option {
  background: #171513;
  color: var(--text-primary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #1a1510;
  box-shadow: 0 2px 12px rgba(249, 199, 139, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(249, 199, 139, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
  background: var(--bg-input-focus);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

.btn-danger:hover {
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

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

.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-muted);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-icon.danger:hover {
  color: var(--color-danger);
  background: rgba(248, 113, 113, 0.1);
}

.btn-icon.edit:hover {
  color: var(--color-primary-light);
  background: rgba(249, 199, 139, 0.1);
}

/* ===== Glass Card ===== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  transition: var(--transition-normal);
}

.glass-card:hover {
  background: var(--bg-card-hover);
}

/* ===== Main Grid ===== */
.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr 380px;
  }
}

/* ===== Section Title ===== */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  width: 100%;
}

.section-title .title-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title .material-icons {
  color: var(--color-primary-light);
  font-size: 1.375rem;
}

/* ===== Subscription Card ===== */
.subscription-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  transition: var(--transition-normal);
  animation: fadeInUp 0.35s ease-out;
}

.subscription-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.subscription-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.subscription-card .card-info {
  flex: 1;
  min-width: 0;
}

.subscription-card .card-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.subscription-card .card-name h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subscription-card .card-name .brand-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.subscription-card .card-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-top: 0.25rem;
}

.subscription-card .card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0;
  flex-shrink: 0;
  margin-left: 1rem;
}

.subscription-card .price-container {
  display: flex;
  align-items: baseline;
  gap: 0.125rem;
}

.subscription-card .card-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary-light);
}

.subscription-card .card-price-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.subscription-card .card-actions {
  display: flex;
  gap: 0.125rem;
  margin-top: 0.375rem;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.subscription-card:hover .card-actions,
.subscription-card:focus-within .card-actions {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.375rem;
}

.card-badges>div,
.card-badges>span {
  margin: 0;
}

.subscription-card .family-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-accent);
  background: rgba(240, 180, 102, 0.12);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
}

.subscription-card .trial-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-warning);
  padding: 0.125rem 0.5rem;
  background: rgba(251, 191, 36, 0.1);
  border-radius: var(--radius-sm);
}

.subscription-card .yearly-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-primary);
  background: rgba(249, 199, 139, 0.12);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
}

.subscription-card .device-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(156, 163, 175, 0.1);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(156, 163, 175, 0.1);
}

.subscription-card .card-notes {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  font-style: italic;
}

.subscriptions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.no-subscriptions {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.no-subscriptions .material-icons {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.3;
}

.summary-panel {
  position: sticky;
  top: 1.5rem;
  will-change: transform;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.stat-card {
  background: linear-gradient(135deg, rgba(249, 199, 139, 0.08), rgba(229, 165, 77, 0.03));
  border: 1px solid rgba(249, 199, 139, 0.12);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.stat-card h3 {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.chart-container {
  margin-top: 1.5rem;
  position: relative;
  height: 280px;
  width: 100%;
  max-width: 280px;
  margin-inline: auto;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-modal-overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #171513;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.97);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
}

#add-subscription-modal .modal-content {
  width: min(94vw, 920px);
  max-width: 920px;
  max-height: 90vh;
}

.modal-body {
  overflow-y: auto;
  padding: 2rem;
  flex: 1;
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--bg-card-border);
  flex-shrink: 0;
}

.modal-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-header h2 .material-icons {
  color: var(--color-primary-light);
}

/* ===== Form ===== */
.form-group {
  margin-bottom: 1rem;
}

.service-country-toggle {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  margin-top: 0.25rem;
  margin-bottom: 0.4rem;
  padding: 0;
}

.service-country-toggle:hover {
  color: var(--text-primary);
}

.service-country-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.service-country-btn {
  border: 1px solid var(--bg-card-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.service-country-btn:hover {
  border-color: rgba(249, 199, 139, 0.45);
  color: var(--text-primary);
}

.service-country-btn.active {
  border-color: rgba(249, 199, 139, 0.6);
  color: #1d1205;
  background: linear-gradient(160deg, #f9c78b, #e5a54d);
}

.service-group-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.375rem;
  margin-bottom: 0.75rem;
}

.service-group-btn {
  flex: 0 0 auto;
  border: 1px solid var(--bg-card-border);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.service-group-btn.active {
  color: var(--text-accent);
  border-color: rgba(249, 199, 139, 0.5);
  background: rgba(249, 199, 139, 0.12);
}

.service-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.service-item-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-card-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
}

.service-item-btn i {
  width: 16px;
  text-align: center;
}

.service-item-btn span {
  line-height: 1.2;
}

.service-item-btn:hover {
  border-color: rgba(249, 199, 139, 0.4);
  color: var(--text-primary);
}

.service-item-btn.active {
  border-color: rgba(249, 199, 139, 0.65);
  background: rgba(249, 199, 139, 0.14);
  color: var(--text-primary);
}

.service-item-btn.custom i {
  color: var(--color-info);
}

.service-select-hidden {
  display: none !important;
}

#price-hint {
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--text-muted);
}

.price-hint-row {
  margin-top: -0.3rem;
  margin-bottom: 0.6rem;
  white-space: nowrap;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.875rem;
  transition: var(--transition-fast);
  outline: none;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background: var(--bg-input-focus);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(249, 199, 139, 0.15);
}

.form-select option {
  background: #171513;
  color: var(--text-primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.form-checkbox label {
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
}

input.form-input[type="date"] {
  min-height: 0;
  height: 38px;
  line-height: 1.2;
}

.checkbox-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.checkbox-stack .form-checkbox {
  margin-bottom: 0;
}

.checkbox-option {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ===== Footer ===== */
.app-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--bg-card-border);
  text-align: center;
}

.footer-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.footer-settings {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto 1.5rem;
}

.footer-settings label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-align: left;
}

.footer-settings select {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  color: var(--text-primary);
  padding: 0.5rem 2rem 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  cursor: pointer;
  outline: none;
  width: 100%;
  max-width: 250px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.footer-settings select option {
  background: #171513;
}

.footer-settings select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(249, 199, 139, 0.12);
}

.footer-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ===== Delete Confirm Modal ===== */
.confirm-modal .modal-content {
  max-width: 380px;
  text-align: center;
  padding: 2rem;
}

.confirm-modal .modal-content h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.confirm-modal .confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ===== Utilities ===== */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .app-container {
    padding: 1rem 0.5rem 2.5rem;
  }

  .glass-card {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .app-header {
    flex-direction: row;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
    text-align: left;
  }

  .app-header>div:first-child {
    flex: 1;
    min-width: 0;
  }

  .app-header h1 {
    font-size: 1.35rem;
  }

  .app-header p {
    font-size: 0.8rem;
    line-height: 1.3;
  }

  .auth-wrapper {
    width: auto;
    margin-top: 0;
    flex-shrink: 0;
  }

  .auth-wrapper .btn {
    width: auto;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }

  .auth-wrapper .btn .material-icons,
  .auth-wrapper .btn .fab {
    margin-right: 0.25rem !important;
    font-size: 0.9rem;
  }

  .user-profile {
    width: auto;
    justify-content: center;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem !important;
  }

  .user-profile img {
    width: 24px !important;
    height: 24px !important;
  }

  .toolbar {
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .toolbar .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .filter-select,
  .sort-select {
    width: 100%;
  }

  .footer-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .footer-settings>div:nth-child(3) {
    grid-column: span 2;
  }

  .footer-settings .form-group {
    width: 100%;
  }

  .stat-card .stat-value {
    font-size: 1.5rem;
  }

  .modal-content {
    padding: 0.9rem;
    width: 95%;
    border-radius: var(--radius-lg);
  }

  .modal-header {
    padding: 0.875rem 0.875rem 0.75rem;
  }

  .modal-body {
    padding: 0;
  }

  #add-subscription-modal .modal-content {
    width: 96%;
    max-height: 92vh;
  }

  .service-country-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
