/* ── Clients Design System ── */
/* Dark theme · Poppins · Light blue accent */

:root {
    --bg: #0d0d0d;
    --surface: #161616;
    --border: #222222;
    --text: #ffffff;
    --text-secondary: #999999;
    --text-tertiary: #666666;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-dim: rgba(96, 165, 250, 0.12);
    --red: #ff4d4d;
    --red-dim: rgba(255, 77, 77, 0.12);
    --yellow: #ffc107;
    --yellow-dim: rgba(255, 193, 7, 0.12);
    --green: #22c55e;
    --green-dim: rgba(34, 197, 94, 0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }

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

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* ── Typography ── */
h1 { font-size: 48px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: 32px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
h3 { font-size: 20px; font-weight: 500; line-height: 1.3; }
p { font-size: 16px; color: var(--text-secondary); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-accent { color: var(--accent); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-green { color: var(--green); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

/* ── Top Bar ── */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar-brand { display: inline-flex; align-items: center; font-size: 18px; font-weight: 600; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.topbar-brand span { color: var(--accent); }
.topbar-nav { display: flex; gap: 4px; }
.topbar-nav a { padding: 8px 16px; font-size: 14px; font-weight: 500; color: var(--text-secondary); border-radius: var(--radius-sm); transition: all var(--transition); text-decoration: none; }
.topbar-nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.topbar-nav a.active { color: var(--accent); background: var(--accent-dim); }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); transition: border-color var(--transition); }
.card:hover { border-color: #333; }
.card-interactive { cursor: pointer; }
.card-interactive:hover { border-color: var(--accent); background: rgba(22,22,22,0.8); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card-title { font-size: 18px; font-weight: 500; }
.card-stat { display: flex; flex-direction: column; gap: 2px; }
.card-stat-value { font-size: 24px; font-weight: 600; color: var(--text); }
.card-stat-label { font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-row { display: flex; gap: 32px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 500; border: none; border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition); text-decoration: none; line-height: 1; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); color: #000; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: #444; background: rgba(255,255,255,0.04); }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,77,77,0.2); }
.btn-danger:hover { background: rgba(255,77,77,0.2); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; font-size: 12px; font-weight: 500; border-radius: 100px; line-height: 1; }
.badge-accent { background: var(--accent-dim); color: var(--accent); }
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }

/* ── Tables ── */
.table-wrapper { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 500; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
tr.clickable { cursor: pointer; }

/* ── Inputs / Forms ── */
input, select, textarea { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-family: 'Poppins', sans-serif; font-size: 14px; color: var(--text); transition: border-color var(--transition); width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }
.form-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab { padding: 12px 24px; font-size: 14px; font-weight: 500; color: var(--text-tertiary); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; transition: all var(--transition); font-family: 'Poppins', sans-serif; }
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Search / Filter Bar ── */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.toolbar input[type="search"] { max-width: 320px; }
.toolbar .btn { white-space: nowrap; }

/* ── Page Sections ── */
.page-header { padding: 32px 0 24px; display: flex; align-items: center; justify-content: space-between; }
.page-header h2 { margin: 0; }
.page-content { padding: 0 0 60px; }

/* ── Color Preview ── */
.color-swatch { display: inline-block; width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--border); vertical-align: middle; margin-right: 6px; }

/* ── Brand Logo ── */
.brand-logo-thumb { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; background: var(--bg); border: 1px solid var(--border); }
.brand-logo-placeholder { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; background: var(--accent-dim); color: var(--accent); font-size: 13px; font-weight: 600; }

/* ── App Access Toggles ── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 14px; }
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 12px; transition: var(--transition); }
.toggle-slider:before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: var(--text); border-radius: 50%; transition: var(--transition); }
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ── Flash Messages ── */
.flash { padding: 12px 20px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.flash-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.flash-error { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,77,77,0.2); }
.flash-info { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(96,165,250,0.2); }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 24px; }
.pagination a, .pagination span { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); color: var(--text-secondary); text-decoration: none; transition: all var(--transition); }
.pagination a:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.pagination .current { background: var(--accent-dim); color: var(--accent); font-weight: 500; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-tertiary); }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }

/* ── Mapping Table ── */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.map-chip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px; }
.map-chip strong { color: var(--accent); }

/* ── Utility ── */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
