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

:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
}

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

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.container { max-width: 960px; margin: 0 auto; padding: 0 1rem; }
.page { min-height: 100vh; }

/* Nav */
nav { background: #fff; border-bottom: 1px solid var(--gray-200); padding: 1.1rem 0; position: sticky; top: 0; z-index: 10; }
nav .inner { display: flex; align-items: center; justify-content: space-between; }
nav .logo { font-weight: 700; font-size: 1.5rem; color: var(--brand); }
nav .nav-links { display: flex; gap: 1rem; align-items: center; }

/* Cards */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.card + .card { margin-top: 1rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .5rem 1rem; border-radius: var(--radius); font-size: .875rem; font-weight: 500; cursor: pointer; border: none; transition: background .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: transparent; border: 1px solid var(--gray-200); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-50); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .25rem .625rem; font-size: .75rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .375rem; color: var(--gray-700); }
input, select, textarea { width: 100%; padding: .5rem .75rem; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: .875rem; background: #fff; color: var(--gray-900); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 80px; }

/* Badge */
.badge { display: inline-block; padding: .125rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-free     { background: var(--gray-100); color: var(--gray-700); }
.badge-business { background: #fef3c7; color: #b45309; }
.badge-pro      { background: #dbeafe; color: var(--brand-dark); }

/* Alerts */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .875rem; }
.alert-error { background: #fee2e2; color: var(--danger); }
.alert-success { background: #dcfce7; color: var(--success); }
.alert-info { background: #dbeafe; color: var(--brand-dark); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--gray-100); font-size: .875rem; }
th { font-weight: 600; color: var(--gray-500); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }

/* Upgrade banner */
.upgrade-banner { background: linear-gradient(135deg, #1d4ed8, #7c3aed); color: #fff; border-radius: var(--radius); padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.upgrade-banner p { font-size: .875rem; opacity: .9; }
.upgrade-banner h3 { font-size: 1rem; margin-bottom: .25rem; }
.btn-white { background: #fff; color: var(--brand-dark); }
.btn-white:hover { background: var(--gray-100); }

/* Empty state */
.empty { text-align: center; padding: 3rem 1rem; color: var(--gray-500); }
.empty p { margin-bottom: 1rem; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: var(--radius); padding: 1.5rem; width: 100%; max-width: 480px; }
.modal h2 { font-size: 1.125rem; margin-bottom: 1rem; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.hidden { display: none !important; }

/* Footer */
.app-footer { background: var(--gray-900); color: var(--gray-500); padding: 1.25rem 0; margin-top: auto; }
.app-footer .footer-row { display: flex; justify-content: space-between; align-items: center; font-size: .8125rem; }
.app-footer a { color: var(--gray-500); text-decoration: none; }
.app-footer a:hover { color: #fff; }
