/* PayReminder — minimal standalone CSS (no CDN required) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #22c55e;
  --brand-dark: #16a34a;
  --brand-light: #dcfce7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --orange: #f97316;
  --orange-light: #ffedd5;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --white: #ffffff;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--gray-50); color: var(--gray-900); line-height: 1.5; min-height: 100vh; }

/* ── Layout ── */
.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.page-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }

/* ── Cards ── */
.card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--gray-200); box-shadow: var(--shadow); padding: 20px; }

/* ── Navbar ── */
.navbar { background: var(--white); border-bottom: 1px solid var(--gray-200); padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.navbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--gray-900); text-decoration: none; }
.navbar-brand .logo { width: 32px; height: 32px; background: var(--brand); border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.navbar-actions { display: flex; align-items: center; gap: 12px; }
.uuid-badge { font-family: monospace; font-size: .8rem; background: var(--gray-100); color: var(--gray-500); padding: 4px 10px; border-radius: 20px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500; cursor: pointer; border: none; transition: background .15s, opacity .15s; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: #fca5a5; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; padding: 10px; font-size: 1rem; }
.btn-ghost { background: none; color: var(--gray-500); font-size: .85rem; }
.btn-ghost:hover { color: var(--gray-900); }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; }
input, select { width: 100%; padding: 9px 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-size: .9rem; color: var(--gray-900); background: var(--white); transition: border-color .15s; outline: none; }
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(34,197,94,.15); }
input[type=number] { -moz-appearance: textfield; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }
.stat-label { font-size: .75rem; color: var(--gray-500); margin-top: 2px; }

/* ── Subscription cards ── */
.subs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.sub-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .15s; }
.sub-card:hover { box-shadow: var(--shadow-md); }
.sub-header { display: flex; align-items: flex-start; justify-content: space-between; }
.sub-name { font-weight: 700; font-size: 1rem; }
.sub-amount { font-size: 1.1rem; font-weight: 700; color: var(--brand-dark); }
.sub-meta { font-size: .78rem; color: var(--gray-500); display: flex; flex-direction: column; gap: 2px; }
.sub-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Badge (days until) ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-success { background: var(--brand-light); color: var(--brand-dark); }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-orange  { background: var(--orange-light); color: #9a3412; }
.badge-danger  { background: var(--danger-light); color: #991b1b; }

/* ── Alert ── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .875rem; margin-bottom: 16px; }
.alert-error { background: var(--danger-light); color: #991b1b; border: 1px solid #fca5a5; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--white); border-radius: var(--radius); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; padding: 24px; box-shadow: var(--shadow-md); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.4rem; color: var(--gray-400); cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--gray-900); }

/* ── Login page ── */
.login-box { width: 100%; max-width: 380px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .icon { width: 64px; height: 64px; background: var(--brand); border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 30px; margin: 0 auto 12px; box-shadow: 0 4px 14px rgba(34,197,94,.3); }
.login-logo h1 { font-size: 1.6rem; font-weight: 800; }
.login-logo p { color: var(--gray-500); font-size: .9rem; margin-top: 4px; }
.uuid-input { font-family: monospace; font-size: 1.4rem; letter-spacing: .2em; text-align: center; text-transform: uppercase; }

/* ── Misc ── */
.section-title { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--gray-400); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.page-content { padding: 24px 0 48px; }
.section { margin-bottom: 28px; }
hr { border: none; border-top: 1px solid var(--gray-100); margin: 20px 0; }
