/* SEO Panel — Midero Branding */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --crimson: #E3004F;
    --crimson-light: #fff0f4;
    --dark: #1A1A1A;
    --dark-2: #2a2a2a;
    --bg: #f5f5f7;
    --white: #ffffff;
    --gray-1: #f8f8f8;
    --gray-2: #eee;
    --gray-3: #999;
    --gray-4: #666;
    --blue: #1976d2;
    --green: #2e7d32;
    --green-light: #e8f5e9;
    --orange: #ff9800;
    --orange-light: #fff8e1;
    --red: #e53935;
    --red-light: #fce4ec;
    --sidebar-w: 240px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    color: var(--dark);
    background: var(--bg);
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--dark);
    color: white;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-icon {
    width: 36px; height: 36px;
    background: var(--crimson);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 18px;
}
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 10px; color: rgba(255,255,255,0.4); letter-spacing: 0.5px; }

.sidebar-section {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 8px 18px 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}
.sidebar-link.active {
    background: rgba(227,0,79,0.15);
    color: white;
    border-left-color: var(--crimson);
}

.client-link { font-size: 12px; padding: 6px 18px 6px 24px; }
.client-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.add-link {
    color: rgba(255,255,255,0.3);
    font-size: 12px;
}
.add-link:hover { color: var(--crimson); }

.sidebar-footer {
    margin-top: auto;
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.version {
    padding: 4px 18px;
    font-size: 10px;
    color: rgba(255,255,255,0.2);
}

.badge-count {
    background: var(--crimson);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
}
.badge-count.small { font-size: 9px; padding: 0 4px; }
.icon { font-size: 16px; width: 20px; text-align: center; }

/* ========== MAIN CONTENT ========== */
.content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 24px 32px;
    min-height: 100vh;
}

/* Client sub-nav */
.client-nav {
    display: flex;
    gap: 2px;
    margin-bottom: 24px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 4px;
    box-shadow: var(--shadow);
}
.client-nav a {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--gray-4);
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s;
}
.client-nav a:hover { background: var(--gray-1); color: var(--dark); }
.client-nav a.active { background: var(--crimson); color: white; }

/* ========== CARDS ========== */
.page-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--dark);
}
.page-subtitle {
    font-size: 14px;
    color: var(--gray-3);
    margin-top: -16px;
    margin-bottom: 20px;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
}

/* Metric cards grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.metric-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    border-top: 3px solid var(--crimson);
}
.metric-card .value {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
}
.metric-card .label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}
.metric-card .change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}
.metric-card .change.up { color: var(--green); }
.metric-card .change.down { color: var(--red); }

/* Client cards on dashboard */
.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.client-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}
.client-card:hover { box-shadow: var(--shadow-lg); }
.client-card .name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}
.client-card .domain {
    font-size: 12px;
    color: var(--crimson);
    font-weight: 500;
    margin-bottom: 12px;
}
.client-card .stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--gray-4);
}
.client-card .stat-val {
    font-weight: 700;
    color: var(--dark);
    font-size: 14px;
}
.client-card .last-audit {
    font-size: 11px;
    color: var(--gray-3);
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-2);
}

/* ========== TABLES ========== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th {
    background: var(--dark);
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
th:first-child { border-radius: var(--radius) 0 0 0; }
th:last-child { border-radius: 0 var(--radius) 0 0; }
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-2);
}
tr:nth-child(even) td { background: var(--gray-1); }
tr:hover td { background: var(--crimson-light); }
tr.highlight td { background: var(--crimson-light); font-weight: 600; }

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.badge-green { background: var(--green-light); color: var(--green); }
.badge-yellow { background: var(--orange-light); color: #f57f17; }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-blue { background: #e3f2fd; color: var(--blue); }
.badge-gray { background: var(--gray-2); color: var(--gray-4); }
.badge-crimson { background: var(--crimson); color: white; }

.intent-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    color: white;
}
.intent-com { background: var(--crimson); }
.intent-inf { background: var(--blue); }
.intent-trx { background: var(--green); }
.intent-nav { background: var(--orange); }

/* ========== FORMS ========== */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-4);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-2);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--crimson);
    box-shadow: 0 0 0 3px rgba(227,0,79,0.1);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-hint { font-size: 11px; color: var(--gray-3); margin-top: 4px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-primary { background: var(--crimson); color: white; }
.btn-primary:hover { background: #c8003f; }
.btn-secondary { background: var(--gray-2); color: var(--dark); }
.btn-secondary:hover { background: #ddd; }
.btn-success { background: var(--green); color: white; }
.btn-danger { background: var(--red); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-2);
    color: var(--gray-4);
}
.btn-outline:hover { border-color: var(--crimson); color: var(--crimson); }

/* ========== CALLOUTS ========== */
.callout {
    padding: 14px 18px;
    border-radius: 0 var(--radius) var(--radius) 0;
    border-left: 4px solid var(--crimson);
    background: var(--crimson-light);
    margin-bottom: 16px;
    font-size: 13px;
}
.callout-info { background: #e3f2fd; border-left-color: var(--blue); }
.callout-warn { background: var(--orange-light); border-left-color: var(--orange); }
.callout-danger { background: var(--red-light); border-left-color: var(--red); }
.callout-success { background: var(--green-light); border-left-color: var(--green); }

/* ========== ALERTS LIST ========== */
.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--gray-2);
}
.alert-item:last-child { border-bottom: none; }
.alert-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.alert-icon.danger { background: var(--red-light); }
.alert-icon.warn { background: var(--orange-light); }
.alert-icon.success { background: var(--green-light); }

/* ========== BRIEF SECTION ========== */
.brief-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.brief-card {
    background: var(--gray-1);
    border-radius: var(--radius);
    padding: 16px;
}
.brief-card h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--crimson);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.tag {
    display: inline-block;
    padding: 3px 10px;
    background: white;
    border: 1px solid var(--gray-2);
    border-radius: 20px;
    font-size: 12px;
    margin: 2px;
}
.tag-high { border-color: var(--green); color: var(--green); background: var(--green-light); }
.tag-low { border-color: var(--gray-3); color: var(--gray-3); }
.tag-avoid { border-color: var(--red); color: var(--red); background: var(--red-light); }

/* ========== PROGRESS ========== */
.progress-bar {
    height: 6px;
    background: var(--gray-2);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--crimson);
    border-radius: 3px;
    transition: width 0.3s;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .content { margin-left: 0; padding: 16px; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .brief-grid { grid-template-columns: 1fr; }
}

/* ========== USER WIDGET ========== */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 4px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 13px;
    flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.5px; }
.user-logout {
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}
.user-logout:hover { color: var(--crimson); background: rgba(255,255,255,0.1); }

/* ========== UTILITIES ========== */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-gray { color: var(--gray-3); }
.text-crimson { color: var(--crimson); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'Consolas', monospace; }
