/* AdFlow operator UI — self-hosted styles (no CDN dependencies).
   Components (af-*) plus the small utility subset the templates use. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: #f9f9f9; color: #1a1c1c; font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-spacing: 0; }
a { color: inherit; }

/* --- layout components --- */
.af-sidebar { width: 240px; background: #1A2B4A; min-height: 100vh; position: fixed; left: 0; top: 0; }
.af-main { margin-left: 240px; min-height: 100vh; }
.af-brand { color: #fff; font-weight: 700; font-size: 1.125rem; padding: 1.25rem 1.25rem 0.75rem; letter-spacing: -0.01em; }
.af-nav-item { display: flex; align-items: center; padding: .5rem 1rem; margin: .0625rem .75rem; border-radius: .5rem; font-size: .8125rem; font-weight: 500; color: #B0C4DE; text-decoration: none; }
.af-nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.af-nav-item.active { background: #CC1100; color: #fff; }
.af-topbar { display: flex; align-items: center; justify-content: space-between; padding: .9rem 2rem; background: #fff; border-bottom: 1px solid #e8e8e8; }
.af-card { background: #fff; border-radius: .5rem; padding: 1.5rem; }
.af-badge { display: inline-flex; align-items: center; padding: .125rem .5rem; border-radius: 9999px; font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.af-badge-ok { background: #dcfce7; color: #166534; }
.af-badge-off { background: #e2e2e2; color: #475569; }
.af-badge-warn { background: #fef3c7; color: #92400e; }
.af-badge-info { background: #dbeafe; color: #1e40af; }
.af-input, .af-textarea, .af-select { width: 100%; background: #f3f3f3; border: 1px solid transparent; border-radius: .5rem; padding: .5rem .75rem; font-size: .875rem; color: #1a1c1c; font-family: inherit; }
.af-input:focus, .af-textarea:focus, .af-select:focus { background: #fff; border-color: rgba(30,58,95,.4); outline: none; }
.af-textarea { min-height: 96px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8125rem; }
.af-label { display: block; font-size: .8125rem; font-weight: 500; margin-bottom: .35rem; }
.af-btn-primary { background: #1E3A5F; color: #fff; border: none; border-radius: .5rem; padding: .5rem 1rem; font-size: .875rem; font-weight: 600; cursor: pointer; }
.af-btn-primary:hover { background: #2E5A8E; }
.af-btn-secondary { background: #e8e8e8; color: #1a1c1c; border: none; border-radius: .5rem; padding: .4rem .8rem; font-size: .8125rem; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-block; }
.af-btn-secondary:hover { background: #dadada; }
.af-btn-danger { background: none; color: #CC1100; border: none; font-size: .8125rem; cursor: pointer; padding: .25rem .4rem; }
.af-btn-danger:hover { text-decoration: underline; }
.af-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: .5rem; overflow: hidden; }
.af-table th { text-align: left; font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; padding: .6rem .75rem; border-bottom: 1px solid #eee; }
.af-table td { padding: .6rem .75rem; border-bottom: 1px solid #f3f3f3; font-size: .8125rem; vertical-align: middle; }
.af-flash-error { background: #fecaca; color: #991b1b; padding: .5rem .75rem; border-radius: .5rem; font-size: .8125rem; }
.af-flash-ok { background: #dcfce7; color: #166534; padding: .5rem .75rem; border-radius: .5rem; font-size: .8125rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8125rem; }

/* daypart grid */
.af-dp { border-collapse: collapse; }
.af-dp th { font-size: .625rem; color: #64748b; padding: 0 .1rem; font-weight: 500; text-align: center; }
.af-dp td { padding: 0; text-align: center; }
.af-dp input[type=checkbox] { width: 13px; height: 13px; margin: 1px; accent-color: #1E3A5F; }
.af-dp .af-dp-day { font-size: .6875rem; color: #475569; padding-right: .35rem; text-align: right; }

/* --- utility subset --- */
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.block { display: block; }
.hidden { display: none; }
.w-full { width: 100%; }
.max-w-sm { max-width: 24rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: .75rem; line-height: 1rem; }
.text-sm { font-size: .875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.whitespace-nowrap { white-space: nowrap; }
.text-ink-secondary { color: #475569; }
.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; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-6 { margin-top: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
