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

:root {
    --primary:      #4f46e5;
    --primary-dark: #3730a3;
    --success:      #16a34a;
    --danger:       #dc2626;
    --warning:      #d97706;
    --text:         #111827;
    --text-muted:   #6b7280;
    --border:       #e5e7eb;
    --bg:           #f9fafb;
    --white:        #ffffff;
    --radius:       0.5rem;
    --shadow:       0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:    0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
}

html { font-size: 16px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--text); background: var(--bg); line-height: 1.5; }

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

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-radius: var(--radius); font-size: .875rem; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-success   { background: var(--success); color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-outline   { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm        { padding: .25rem .6rem; font-size: .8rem; }
.btn-lg        { padding: .75rem 1.5rem; font-size: 1rem; }

/* Forms */
.form-group   { margin-bottom: 1rem; }
.form-label   { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .3rem; }
.form-control { display: block; width: 100%; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .875rem; background: var(--white); transition: border-color .15s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.form-text    { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }
.form-error   { font-size: .75rem; color: var(--danger); margin-top: .25rem; }

/* Alerts */
.alert         { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .875rem; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* Cards */
.card         { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header  { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 600; }
.card-body    { padding: 1.25rem; }
.card-footer  { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }

/* Tables */
.table-wrapper { overflow-x: auto; }
table         { width: 100%; border-collapse: collapse; font-size: .875rem; }
th            { text-align: left; padding: .6rem .75rem; font-weight: 600; border-bottom: 2px solid var(--border); white-space: nowrap; color: var(--text-muted); }
td            { padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td   { background: var(--bg); }

/* Badges */
.badge        { display: inline-block; padding: .2rem .5rem; border-radius: 9999px; font-size: .75rem; font-weight: 500; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-gray    { background: #f3f4f6; color: #374151; }

/* Utilities */
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: .875rem; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.fw-bold      { font-weight: 600; }
.mt-1 { margin-top: .25rem; }  .mt-2 { margin-top: .5rem; }  .mt-3 { margin-top: .75rem; }  .mt-4 { margin-top: 1rem; }  .mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-2 { gap: .5rem; } .gap-4 { gap: 1rem; }
.w-full { width: 100%; } .hidden { display: none; }
