/* ── Agency Panel — Enhanced Styles ── */

/* Client list cards */
.ag-clients-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 24px; margin-bottom: 32px; flex-wrap: wrap;
}
.ag-clients-header h1 {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em;
}
.ag-clients-header p {
    color: var(--sc-muted); font-size: .9rem; margin-top: 2px;
}

/* Filter bar */
.ag-filter {
    display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap;
}
.ag-filter-input {
    flex: 1; min-width: 14rem;
    padding: 10px 16px; border-radius: 10px;
    border: 1.5px solid var(--sc-border);
    background: var(--sc-surface-strong);
    font-size: .875rem; color: var(--sc-text);
    outline: none; transition: border-color .2s;
}
.ag-filter-input:focus { border-color: var(--sc-primary); }
.ag-filter-input::placeholder { color: var(--sc-muted); }

.ag-filter-pills {
    display: flex; gap: 4px; background: var(--sc-surface);
    border: 1px solid var(--sc-border); border-radius: 10px; padding: 3px;
}
.ag-filter-pill {
    padding: 7px 14px; border-radius: 8px;
    font-size: .8rem; font-weight: 500; cursor: pointer;
    border: none; background: transparent; color: var(--sc-muted);
    transition: all .15s;
}
.ag-filter-pill.active {
    background: var(--sc-primary); color: #fff;
}
.ag-filter-pill:hover:not(.active) { color: var(--sc-text); }

/* Client list grid */
.ag-client-list {
    display: flex; flex-direction: column; gap: 1px;
    background: var(--sc-border);
    border: 1px solid var(--sc-border);
    border-radius: 14px; overflow: hidden;
}
.ag-client-row {
    display: grid;
    grid-template-columns: 2.5fr 1.5fr 1.5fr .7fr .7fr .6fr;
    align-items: center; gap: 16px;
    padding: 16px 20px;
    background: var(--sc-surface);
    text-decoration: none; color: var(--sc-text);
    transition: background .15s;
}
.ag-client-row:hover { background: var(--sc-surface-strong); }
.ag-client-row-head {
    font-size: .7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .08em; color: var(--sc-muted);
    padding: 12px 20px;
    background: var(--sc-surface);
}
.ag-client-row-head span { padding: 0; }

/* Client identity cell */
.ag-client-identity {
    display: flex; align-items: center; gap: 12px;
}
.ag-avatar {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem; color: #fff;
    flex-shrink: 0;
}
.ag-avatar-1 { background: linear-gradient(135deg, #6366F1, #8B5CF6); }
.ag-avatar-2 { background: linear-gradient(135deg, #F59E0B, #F97316); }
.ag-avatar-3 { background: linear-gradient(135deg, #10B981, #14B8A6); }
.ag-avatar-4 { background: linear-gradient(135deg, #EF4444, #F43F5E); }
.ag-avatar-5 { background: linear-gradient(135deg, #3B82F6, #6366F1); }
.ag-client-name { font-weight: 600; font-size: .925rem; }
.ag-client-email { font-size: .8rem; color: var(--sc-muted); }

/* Status dot */
.ag-status {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .8rem; font-weight: 500;
}
.ag-status-dot {
    width: 8px; height: 8px; border-radius: 50%;
}
.ag-status-active .ag-status-dot { background: #10B981; }
.ag-status-inactive .ag-status-dot { background: #94A3B8; }
.ag-status-blocked .ag-status-dot { background: #EF4444; }

/* Sites count badge */
.ag-sites-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 28px; border-radius: 8px;
    background: var(--sc-surface-strong); border: 1px solid var(--sc-border);
    font-size: .8rem; font-weight: 600; color: var(--sc-text);
}

/* Row actions */
.ag-row-actions {
    display: flex; gap: 8px; justify-content: flex-end;
}
.ag-row-action {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--sc-border); background: var(--sc-surface);
    color: var(--sc-muted); text-decoration: none;
    transition: all .15s; cursor: pointer;
}
.ag-row-action:hover { border-color: var(--sc-primary); color: var(--sc-primary); }
.ag-row-action svg { width: 14px; height: 14px; }

/* Empty state */
.ag-empty {
    text-align: center; padding: 80px 24px;
}
.ag-empty-icon {
    width: 64px; height: 64px; border-radius: 16px;
    background: var(--sc-surface-strong); border: 1px dashed var(--sc-border);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px; color: var(--sc-muted);
}
.ag-empty h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.ag-empty p { color: var(--sc-muted); font-size: .875rem; margin-bottom: 20px; }

/* ── Client Detail ── */
.ag-detail-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 24px; margin-bottom: 32px; flex-wrap: wrap;
}
.ag-detail-identity {
    display: flex; align-items: center; gap: 16px;
}
.ag-detail-avatar {
    width: 56px; height: 56px; border-radius: 14px;
    font-size: 1.2rem;
}
.ag-detail-name {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em;
}
.ag-detail-meta {
    display: flex; gap: 16px; margin-top: 4px; flex-wrap: wrap;
}
.ag-detail-meta-item {
    display: flex; align-items: center; gap: 5px;
    font-size: .8rem; color: var(--sc-muted);
}
.ag-detail-meta-item svg { width: 13px; height: 13px; }

/* Detail stats row */
.ag-detail-stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 32px;
}
.ag-detail-stat {
    background: var(--sc-surface); border: 1px solid var(--sc-border);
    border-radius: 12px; padding: 20px;
}
.ag-detail-stat-label {
    font-size: .7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .08em; color: var(--sc-muted); margin-bottom: 6px;
}
.ag-detail-stat-value {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em;
}

/* Detail sections */
.ag-detail-section {
    background: var(--sc-surface); border: 1px solid var(--sc-border);
    border-radius: 14px; padding: 24px; margin-bottom: 20px;
}
.ag-detail-section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.ag-detail-section-title {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 1.1rem; font-weight: 600;
}

/* Site cards in detail */
.ag-site-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.ag-site-card {
    border: 1px solid var(--sc-border); border-radius: 10px;
    padding: 16px; transition: border-color .15s;
}
.ag-site-card:hover { border-color: var(--sc-primary); }
.ag-site-card-name { font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.ag-site-card-slug { font-size: .8rem; color: var(--sc-muted); margin-bottom: 10px; }
.ag-site-card-footer {
    display: flex; align-items: center; justify-content: space-between;
}

/* Edit form in detail */
.ag-edit-form {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.ag-edit-form .ag-field-full { grid-column: 1 / -1; }
.ag-field {
    display: flex; flex-direction: column; gap: 6px;
}
.ag-field label {
    font-size: .75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--sc-muted);
}
.ag-field input, .ag-field select, .ag-field textarea {
    padding: 10px 14px; border-radius: 8px;
    border: 1.5px solid var(--sc-border);
    background: var(--sc-surface-strong);
    font-size: .875rem; color: var(--sc-text);
    outline: none; transition: border-color .2s;
    font-family: inherit;
}
.ag-field input:focus, .ag-field select:focus, .ag-field textarea:focus {
    border-color: var(--sc-primary);
}
.ag-field textarea { resize: vertical; min-height: 80px; }
.ag-form-actions {
    grid-column: 1 / -1;
    display: flex; gap: 10px; margin-top: 8px;
}

@media (max-width: 900px) {
    .ag-client-row { grid-template-columns: 1fr; gap: 8px; }
    .ag-client-row-head { display: none; }
    .ag-detail-stats { grid-template-columns: 1fr 1fr; }
    .ag-edit-form { grid-template-columns: 1fr; }
    .ag-row-actions { display: none; }
}
