/* AIBL Network Admin Panel - Brand Styles */
/* Font loaded via <link> in index.html (eliminates render-blocking @import chain) */

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

:root {
    /* AIBL Brand Colors */
    --primary-red: #C94A2A;
    --primary-red-dark: #b8432a;
    --accent-green: #2A5C4E;
    --charcoal: #2C2625;
    --cream: #FBF7F2;
    --cream-alt: #F9F3EB;
    --gold: #D4925A;
    --white: #FFFFFF;

    /* Semantic Colors */
    --success: #2A5C4E;
    --danger: #C94A2A;
    --warning: #D4925A;

    /* Shadows - Organic AIBL style */
    --shadow-soft: 3px 7px 19px rgba(201, 74, 42, 0.09), -2px 3px 12px rgba(42, 92, 78, 0.04);
    --shadow-medium: 5px 12px 25px rgba(201, 74, 42, 0.12), -3px 5px 15px rgba(44, 38, 37, 0.07);
    --shadow-strong: 8px 18px 35px rgba(201, 74, 42, 0.15), -5px 8px 22px rgba(44, 38, 37, 0.08);
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--cream);
    color: var(--charcoal);
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Login Screen */
#login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
}

.login-card {
    background: var(--white);
    padding: 48px;
    border-radius: 20px 15px 25px 10px;
    box-shadow: var(--shadow-strong);
    text-align: center;
    max-width: 420px;
    width: 90%;
}

.login-card h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    color: var(--primary-red);
    margin-bottom: 8px;
}

.login-card h2 {
    font-size: 1.1rem;
    color: rgba(44, 38, 37, 0.6);
    font-weight: 400;
    margin-bottom: 32px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--charcoal);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--cream-alt);
    border-radius: 12px 8px 15px 10px;
    font-size: 16px;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--charcoal);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(201, 74, 42, 0.1);
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-row input {
    flex: 1;
    min-width: 150px;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px 8px 15px 10px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-red);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-red-dark);
}

.btn-success {
    background: var(--accent-green);
    color: var(--white);
}

.btn-success:hover {
    background: #245347;
}

.btn-danger {
    background: var(--primary-red);
    color: var(--white);
}

.btn-danger:hover {
    background: var(--primary-red-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--cream-alt);
    color: var(--charcoal);
}

.btn-outline:hover {
    background: var(--cream-alt);
}

.btn-sm {
    padding: 10px 18px;
    font-size: 14px;
}

/* ===== SIDEBAR LAYOUT ===== */

/* SVG Icon styles */
.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.stat-icon .icon {
    width: 24px;
    height: 24px;
}

#dashboard.screen {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--charcoal);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.4rem;
    color: var(--primary-red);
    margin-bottom: 4px;
}

.sidebar-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px 20px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    gap: 12px;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
}

.sidebar-item.active {
    background: rgba(201, 74, 42, 0.15);
    color: var(--white);
    border-left: 3px solid var(--primary-red);
}

.sidebar-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-label {
    flex: 1;
}

.sidebar-badge {
    background: var(--primary-red);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.sidebar-badge.badge-success {
    background: var(--accent-green);
}

.sidebar-badge.badge-danger {
    background: var(--danger);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-user {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

.sidebar-footer .btn-outline {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
}

.sidebar-footer .btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    background: var(--cream);
    min-height: 100vh;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    color: var(--charcoal);
    margin-bottom: 8px;
}

.page-subtitle {
    color: rgba(44, 38, 37, 0.6);
    font-size: 15px;
}
.pending-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.pending-toolbar label {
    font-size: 14px;
    color: rgba(44, 38, 37, 0.78);
}
.pending-toolbar input[type="number"] {
    width: 86px;
    padding: 8px 10px;
    border: 1px solid var(--warm-gray);
    border-radius: 10px;
    background: var(--white);
    color: var(--charcoal);
    font-size: 14px;
}

/* ===== DASHBOARD STYLES ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card.stat-success {
    background: linear-gradient(135deg, rgba(42, 92, 78, 0.1) 0%, var(--white) 100%);
    border-left: 4px solid var(--accent-green);
}

.stat-card.stat-accent {
    background: linear-gradient(135deg, rgba(201, 74, 42, 0.08) 0%, var(--white) 100%);
    border-left: 4px solid var(--primary-red);
}

.stat-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    border-radius: 12px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--charcoal);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: rgba(44, 38, 37, 0.6);
    margin-top: 4px;
}

.dashboard-section {
    background: var(--white);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
}

.dashboard-section h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    color: var(--charcoal);
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    margin-bottom: 0;
}

.section-header select {
    padding: 8px 12px;
    border: 1px solid var(--cream-alt);
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    background: var(--white);
}

.section-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* AWS Metrics Grid */
.aws-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.aws-card {
    background: var(--cream);
    padding: 20px;
    border-radius: 12px;
    border-left: 3px solid var(--accent-green);
}

.aws-card h4 {
    font-size: 14px;
    color: var(--accent-green);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aws-card h4 span {
    font-size: 18px;
}

.aws-metrics-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aws-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.aws-metric-row .label {
    color: rgba(44, 38, 37, 0.7);
}

.aws-metric-row .value {
    font-weight: 600;
    color: var(--charcoal);
    font-family: 'JetBrains Mono', monospace;
}

.aws-card.bedrock {
    border-left-color: var(--gold);
}

.aws-card.bedrock h4 {
    color: var(--gold);
}

.aws-card.lambda {
    border-left-color: #FF9900;
}

.aws-card.lambda h4 {
    color: #FF9900;
}

.aws-card.dynamodb {
    border-left-color: #4053D6;
}

.aws-card.dynamodb h4 {
    color: #4053D6;
}

.aws-card.ses {
    border-left-color: #5C95A5;
}

.aws-card.ses h4 {
    color: #5C95A5;
}

.aws-card.api {
    border-left-color: var(--primary-red);
}

.aws-card.api h4 {
    color: var(--primary-red);
}

.aws-card.cognito {
    border-left-color: #DD344C;
}

.aws-card.cognito h4 {
    color: #DD344C;
}

.aws-card.s3 {
    border-left-color: #569A31;
}

.aws-card.s3 h4 {
    color: #569A31;
}

.aws-card.cloudfront {
    border-left-color: #8C4FFF;
}

.aws-card.cloudfront h4 {
    color: #8C4FFF;
}

.aws-card.eventbridge {
    border-left-color: #E7157B;
}

.aws-card.eventbridge h4 {
    color: #E7157B;
}

.aws-card.sns {
    border-left-color: #D93B3B;
}

.aws-card.sns h4 {
    color: #D93B3B;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Header (legacy, keeping for compatibility) */
header {
    background: var(--white);
    box-shadow: var(--shadow-soft);
    padding: 16px 32px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--primary-red);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    background: var(--cream);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--accent-green);
}

.user-badge:empty {
    display: none;
}

/* Tabs (legacy, keeping for compatibility) */
.tabs {
    display: flex;
    background: var(--white);
    border-bottom: 2px solid var(--cream-alt);
    padding: 0 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.tab {
    padding: 16px 28px;
    background: none;
    border: none;
    font-size: 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    cursor: pointer;
    color: rgba(44, 38, 37, 0.6);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--charcoal);
}

.tab.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

.badge {
    display: inline-block;
    background: var(--primary-red);
    color: var(--white);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Profiles Grid */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

.profile-card {
    background: var(--white);
    border-radius: 15px 12px 18px 10px;
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.2s;
}

.profile-card:hover {
    box-shadow: var(--shadow-medium);
}

.profile-card-compact {
    cursor: pointer;
}

.profile-card-compact .profile-header {
    padding: 16px 20px;
}

.profile-card-compact .profile-body {
    padding: 0 20px 16px;
}

.profile-card-compact .profile-bio {
    font-size: 14px;
    margin-bottom: 12px;
    color: rgba(44, 38, 37, 0.8);
}

.profile-card-compact .profile-tags {
    margin-bottom: 0;
}

.profile-detail {
    padding: 16px;
}

.profile-detail h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--charcoal);
    margin-bottom: 8px;
}

.profile-detail .meta {
    color: rgba(44, 38, 37, 0.6);
    font-size: 14px;
    margin-bottom: 16px;
}

.profile-detail .profile-bio {
    margin-bottom: 20px;
    line-height: 1.6;
}

.profile-header {
    padding: 24px;
    border-bottom: 1px solid var(--cream-alt);
}

.profile-header h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    color: var(--charcoal);
    margin-bottom: 6px;
}

.profile-header .meta {
    color: rgba(44, 38, 37, 0.6);
    font-size: 14px;
}

.profile-body {
    padding: 24px;
}

.profile-bio {
    color: var(--charcoal);
    margin-bottom: 16px;
    line-height: 1.5;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag {
    background: var(--cream);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--accent-green);
    font-weight: 500;
}

.profile-section {
    margin-bottom: 16px;
}

.profile-section h4 {
    font-size: 14px;
    color: var(--primary-red);
    margin-bottom: 8px;
    font-weight: 600;
}

.profile-section ul {
    list-style: none;
    font-size: 14px;
}

.profile-section li {
    padding: 4px 0;
    color: var(--charcoal);
}

.profile-actions {
    padding: 12px 20px;
    background: var(--cream);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-radius: 0 0 18px 10px;
}

.profile-actions-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-actions-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-action-secondary {
    font-size: 12px;
    padding: 6px 12px;
    opacity: 0.75;
    border-color: var(--charcoal-light, #999);
}

.btn-action-secondary:hover {
    opacity: 1;
}

/* Whitelist */
.whitelist-actions {
    background: var(--white);
    padding: 28px;
    border-radius: 15px 12px 18px 10px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
}

.whitelist-actions h3 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--primary-red);
    margin-bottom: 16px;
}

.cert-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 12px;
    margin-bottom: 12px;
}

.cert-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 12px;
    font-size: 14px;
}

.cert-badges-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cert-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.demo-url-box {
    margin-top: 10px;
}

.demo-url-box input {
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: #faf8f5;
}

/* #whitelist-stats replaced by .whitelist-stats-row */

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 38, 37, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    padding: 36px;
    border-radius: 20px 15px 25px 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-strong);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f0ede8;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--charcoal);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    background: var(--primary-red);
    color: white;
}

/* Messages */
.error {
    color: var(--primary-red);
    font-size: 14px;
    margin-top: 12px;
}

.message {
    font-size: 14px;
    margin-top: 12px;
}

.message.success {
    color: var(--accent-green);
}

.message.error {
    color: var(--primary-red);
}

.success {
    color: var(--accent-green);
    font-size: 14px;
    margin-top: 12px;
}

/* Forgot Password Link */
.forgot-password-link {
    display: block;
    margin-top: 16px;
    color: rgba(44, 38, 37, 0.6);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: var(--primary-red);
}

/* Modal Small */
.modal-sm {
    max-width: 400px;
}

.modal-sm h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--charcoal);
    margin-bottom: 24px;
    text-align: center;
}

/* Sidebar Actions */
.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

/* Login Card Hint */
.login-card .hint {
    font-size: 14px;
    color: rgba(44, 38, 37, 0.6);
    margin-bottom: 16px;
}

.empty-state {
    text-align: center;
    padding: 48px;
    color: rgba(44, 38, 37, 0.6);
    font-size: 16px;
}

/* Reject Form */
.reject-form {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--cream-alt);
}

.reject-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--charcoal);
}

.reject-form textarea {
    margin-bottom: 16px;
    min-height: 120px;
}

/* Analytics */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 24px;
    margin-bottom: 24px;
}

.analytics-card {
    background: var(--white);
    border-radius: 15px 12px 18px 10px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.analytics-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--cream-alt);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.analytics-header h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    color: var(--primary-red);
    margin: 0;
}

.analytics-header select {
    padding: 6px 12px;
    border: 1px solid var(--cream-alt);
    border-radius: 6px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    background: var(--white);
}

.analytics-header .hint {
    font-size: 12px;
    color: rgba(44, 38, 37, 0.5);
}

.analytics-list {
    padding: 16px 24px;
    max-height: 350px;
    overflow-y: auto;
}

.analytics-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--cream-alt);
}

.analytics-row:last-child {
    border-bottom: none;
}

.analytics-row .rank {
    width: 32px;
    height: 32px;
    background: var(--cream);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--accent-green);
    margin-right: 12px;
}

.analytics-row .rank.top {
    background: var(--gold);
    color: var(--white);
}

.analytics-row .keyword {
    flex: 1;
    font-weight: 500;
    color: var(--charcoal);
}

.analytics-row .count {
    font-size: 13px;
    color: rgba(44, 38, 37, 0.6);
}

/* Gap rows */
.gap-row {
    flex-wrap: wrap;
}

.gap-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gap-detail {
    font-size: 12px;
    color: rgba(44, 38, 37, 0.5);
}

.gap-score {
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
}

.gap-score.high {
    background: rgba(201, 74, 42, 0.1);
    color: var(--primary-red);
}

.gap-score.medium {
    background: rgba(212, 146, 90, 0.15);
    color: var(--gold);
}

/* Trend rows */
.trend-section {
    margin-bottom: 16px;
}

.trend-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(44, 38, 37, 0.5);
    margin-bottom: 8px;
}

.trend-value {
    font-weight: 600;
    font-size: 14px;
}

.trend-value.up {
    color: var(--accent-green);
}

.trend-value.down {
    color: var(--primary-red);
}

/* Leaderboard */
.leaderboard-row {
    gap: 12px;
}

.leader-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.leader-name {
    font-weight: 500;
    color: var(--charcoal);
}

.leader-tier {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
}

.tier-bronze {
    background: #CD7F32;
    color: white;
}

.tier-silver {
    background: #C0C0C0;
    color: var(--charcoal);
}

.tier-gold {
    background: var(--gold);
    color: white;
}

.tier-platinum {
    background: #E5E4E2;
    color: var(--charcoal);
}

.leader-points {
    font-weight: 600;
    color: var(--accent-green);
}

.analytics-actions {
    background: var(--white);
    padding: 24px;
    border-radius: 15px 12px 18px 10px;
    box-shadow: var(--shadow-soft);
}

/* Success Stories */
.stories-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.filter-btn {
    padding: 10px 20px;
    background: var(--white);
    border: 2px solid var(--cream-alt);
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary-red);
}

.filter-btn.active {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
}

.story-card .deal-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.story-card .deal-type.free {
    background: rgba(42, 92, 78, 0.1);
    color: var(--accent-green);
}

.story-card .deal-type.paid {
    background: rgba(212, 146, 90, 0.15);
    color: var(--gold);
}

.story-value {
    margin-left: 8px;
    font-weight: 600;
    color: var(--accent-green);
}

.story-date {
    font-size: 12px;
    color: rgba(44, 38, 37, 0.5);
    margin-top: 12px;
}

/* ===== SECURITY TAB ===== */
.security-header {
    margin-bottom: 24px;
}

.security-header h2 {
    font-family: 'Playfair Display', serif;
    color: var(--charcoal);
    margin-bottom: 4px;
}

.security-header .hint {
    color: rgba(44, 38, 37, 0.6);
    font-size: 14px;
}

.security-card {
    border-left: 4px solid var(--warning);
}

.security-card.status-hold {
    border-left-color: var(--warning);
}

.security-card.status-banned {
    border-left-color: var(--danger);
}

.security-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.security-badge.status-hold {
    background: rgba(212, 146, 90, 0.2);
    color: var(--gold);
}

.security-badge.status-banned {
    background: rgba(201, 74, 42, 0.15);
    color: var(--danger);
}

.security-badge.status-active {
    background: rgba(42, 92, 78, 0.15);
    color: var(--accent-green);
}

.security-reason {
    margin-bottom: 8px;
    font-size: 14px;
}

.security-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: rgba(44, 38, 37, 0.6);
}

.badge-danger {
    background: var(--danger) !important;
    color: white !important;
}

/* User Details Modal */
.user-details {
    padding: 16px 0;
}

.user-details p {
    margin-bottom: 8px;
}

.user-details h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 16px;
    color: var(--charcoal);
}

.incidents-list {
    max-height: 300px;
    overflow-y: auto;
}

.incident-item {
    padding: 12px;
    margin-bottom: 8px;
    background: var(--cream-alt);
    border-radius: 8px;
    border-left: 3px solid var(--danger);
}

.incident-type {
    font-weight: 600;
    color: var(--danger);
    margin-right: 12px;
}

.incident-score {
    background: rgba(201, 74, 42, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 12px;
}

.incident-date {
    font-size: 12px;
    color: rgba(44, 38, 37, 0.5);
}

.incident-detections {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(44, 38, 37, 0.7);
    font-family: 'JetBrains Mono', monospace;
}

/* ===== MATCHES TAB ===== */
.matches-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.matches-header h2 {
    font-family: 'Playfair Display', serif;
    color: var(--charcoal);
    margin: 0;
}

.matches-header .hint {
    color: rgba(44, 38, 37, 0.6);
    font-size: 14px;
    flex-basis: 100%;
    margin-top: -8px;
}

.matches-stats {
    background: var(--white);
    padding: 20px 24px;
    border-radius: 15px 12px 18px 10px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
}

.stats-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 24px;
    background: var(--cream);
    border-radius: 10px;
    min-width: 100px;
}

.stat-item .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--charcoal);
    font-family: 'Playfair Display', serif;
}

.stat-item .stat-label {
    font-size: 12px;
    color: rgba(44, 38, 37, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item.stat-success {
    background: rgba(42, 92, 78, 0.1);
}

.stat-item.stat-success .stat-value {
    color: var(--accent-green);
}

.match-card {
    position: relative;
}

.match-card .profile-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.match-score {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    flex-shrink: 0;
}

.match-score.score-high {
    background: rgba(42, 92, 78, 0.15);
    color: var(--accent-green);
}

.match-score.score-medium {
    background: rgba(212, 146, 90, 0.15);
    color: var(--gold);
}

.match-score.score-low {
    background: rgba(44, 38, 37, 0.1);
    color: rgba(44, 38, 37, 0.6);
}

.match-title {
    flex: 1;
}

.match-title h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.match-category {
    font-size: 13px;
    color: var(--accent-green);
    margin-right: 12px;
}

.match-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.match-status.status-queued,
.match-status.status-created {
    background: rgba(212, 146, 90, 0.2);
    color: var(--gold);
}

.match-status.status-sent {
    background: rgba(42, 92, 78, 0.15);
    color: var(--accent-green);
}

.match-status.status-clicked {
    background: rgba(201, 74, 42, 0.1);
    color: var(--primary-red);
}

.match-status.status-contacted,
.match-status.status-success {
    background: var(--accent-green);
    color: white;
}

.match-status.status-rejected,
.match-status.status-ignored {
    background: rgba(44, 38, 37, 0.1);
    color: rgba(44, 38, 37, 0.6);
}

.match-reasoning {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--cream);
    border-radius: 8px;
    border-left: 3px solid var(--accent-green);
}

.match-reasoning strong {
    display: block;
    font-size: 12px;
    color: var(--accent-green);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.match-reasoning p {
    margin: 0;
    font-size: 14px;
    color: var(--charcoal);
}

.match-intros {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.intro-preview {
    padding: 12px;
    background: var(--cream-alt);
    border-radius: 8px;
}

.intro-preview strong {
    display: block;
    font-size: 11px;
    color: rgba(44, 38, 37, 0.6);
    margin-bottom: 4px;
}

.intro-preview p {
    margin: 0;
    font-size: 13px;
    font-style: italic;
    color: var(--charcoal);
}

.match-date {
    font-size: 12px;
    color: rgba(44, 38, 37, 0.5);
}

.badge-success {
    background: var(--accent-green) !important;
    color: white !important;
}

/* ===== ENHANCED MATCH ACTIONS ===== */
.match-actions-bar {
    padding: 16px 24px;
    background: var(--cream);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.match-actions-primary {
    display: flex;
    gap: 12px;
    align-items: center;
}

.match-send-btn {
    padding: 14px 28px !important;
    font-size: 16px !important;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(42, 92, 78, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(42, 92, 78, 0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* ===== MATCH DETAIL MODAL ===== */
.match-detail-modal {
    max-width: 900px;
}

.match-detail-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--cream-alt);
}

.match-score-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    flex-shrink: 0;
}

.match-detail-title h2 {
    font-family: 'Playfair Display', serif;
    color: var(--charcoal);
    margin-bottom: 8px;
}

.match-reasoning-modal {
    color: var(--accent-green);
    font-size: 15px;
    line-height: 1.5;
}

.match-profiles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.match-profile-preview {
    background: var(--cream);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--cream-alt);
}

.match-profile-preview h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--charcoal);
    margin-bottom: 8px;
}

.profile-location {
    color: rgba(44, 38, 37, 0.6);
    font-size: 13px;
    margin-bottom: 12px;
}

.profile-bio-preview {
    font-size: 14px;
    color: var(--charcoal);
    margin-bottom: 12px;
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
}

.profile-tags-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.profile-tags-preview .tag {
    font-size: 11px;
    padding: 4px 8px;
}

.profile-section-preview {
    margin-bottom: 12px;
    padding: 10px;
    background: var(--white);
    border-radius: 8px;
}

.profile-section-preview h4 {
    font-size: 12px;
    color: var(--primary-red);
    margin-bottom: 6px;
    font-weight: 600;
}

.profile-section-preview ul {
    list-style: none;
    font-size: 13px;
}

.profile-section-preview li {
    padding: 2px 0;
    color: var(--charcoal);
}

.profile-section-preview.szukam-section {
    background: rgba(42, 92, 78, 0.05);
    border-left: 3px solid var(--accent-green);
}

.more-items {
    font-size: 11px;
    color: rgba(44, 38, 37, 0.5);
    margin-top: 4px;
    font-style: italic;
}

.intro-highlight {
    margin-top: 16px;
    padding: 12px;
    background: var(--white);
    border-radius: 8px;
    border-left: 3px solid var(--gold);
}

.intro-highlight strong {
    display: block;
    font-size: 11px;
    color: var(--gold);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.intro-highlight p {
    margin: 0;
    font-size: 13px;
    font-style: italic;
    color: var(--charcoal);
}

.match-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding-top: 20px;
    border-top: 2px solid var(--cream-alt);
}

.match-modal-actions .btn-success {
    padding: 16px 32px;
    font-size: 16px;
}

.match-modal-info {
    padding: 16px;
    background: var(--cream);
    border-radius: 8px;
    text-align: center;
}

.match-modal-info p {
    margin: 4px 0;
    font-size: 14px;
}

/* Responsive for match modal */
@media (max-width: 768px) {
    .match-profiles-grid {
        grid-template-columns: 1fr;
    }

    .match-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .match-modal-actions {
        flex-direction: column;
    }

    .match-actions-bar {
        flex-direction: column;
    }

    .match-actions-primary {
        width: 100%;
        justify-content: space-between;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .profiles-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row input {
        width: 100%;
    }

    .tabs {
        overflow-x: auto;
        padding: 0 16px;
    }

    main {
        padding: 16px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .security-meta {
        flex-direction: column;
        gap: 4px;
    }
}

/* ===== SYSTEM HEALTH ===== */
.system-health {
    padding: 0;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

@media (max-width: 900px) {
    .health-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .health-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.health-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: 8px;
    text-align: center;
}

.health-badge.ok {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
}

.health-badge.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid #ffc107;
}

.health-badge.error, .health-badge.critical {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #dc3545;
}

.health-badge.healthy {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
}

.badge-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(0,0,0,0.6);
    margin-bottom: 4px;
}

.badge-value {
    font-size: 18px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.health-badge.ok .badge-value { color: #155724; }
.health-badge.warning .badge-value { color: #856404; }
.health-badge.error .badge-value, .health-badge.critical .badge-value { color: #721c24; }
.health-badge.healthy .badge-value { color: #155724; }

/* ===== BATCH SEND CONTROLS ===== */
.batch-controls {
    background: linear-gradient(135deg, var(--white) 0%, #f8f5f1 100%);
    border: 2px solid var(--accent-green);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
}

.batch-header {
    margin-bottom: 20px;
}

.batch-header h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    color: var(--accent-green);
    margin-bottom: 8px;
}

.batch-description {
    font-size: 14px;
    color: rgba(44, 38, 37, 0.7);
    line-height: 1.5;
}

.batch-form {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.batch-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.batch-input-group label {
    font-weight: 500;
    color: var(--charcoal);
    white-space: nowrap;
}

.batch-input-group select {
    padding: 10px 16px;
    border: 2px solid var(--cream-alt);
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    background: var(--white);
    cursor: pointer;
}

.batch-input-group select:focus {
    outline: none;
    border-color: var(--accent-green);
}

.batch-preview {
    padding: 12px 20px;
    background: var(--cream);
    border-radius: 8px;
    font-size: 14px;
    color: var(--charcoal);
    font-weight: 500;
}

.batch-preview span {
    color: var(--accent-green);
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    font-size: 18px;
}

#batch-send-btn {
    background: linear-gradient(135deg, var(--accent-green) 0%, #3A7D6A 100%);
    padding: 14px 32px;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(42, 92, 78, 0.3);
    transition: all 0.3s ease;
}

#batch-send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 92, 78, 0.4);
}

#batch-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Batch History */
.batch-history {
    background: var(--white);
    border-radius: 15px 12px 18px 10px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
}

.batch-history h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    color: var(--charcoal);
    margin-bottom: 16px;
}

.batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.batch-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--cream);
    font-weight: 600;
    color: var(--charcoal);
    border-bottom: 2px solid var(--cream-alt);
}

.batch-table td {
    padding: 12px;
    border-bottom: 1px solid var(--cream-alt);
    color: var(--charcoal);
}

.batch-table tr:hover td {
    background: var(--cream);
}

.batch-table td:nth-child(n+2) {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

/* Status for sent_to_users */
.match-status.status-sent_to_users {
    background: rgba(42, 92, 78, 0.15);
    color: var(--accent-green);
}

@media (max-width: 768px) {
    .batch-form {
        flex-direction: column;
        align-items: stretch;
    }

    .batch-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .batch-preview {
        text-align: center;
    }

    #batch-send-btn {
        width: 100%;
    }

    .batch-table {
        font-size: 12px;
    }

    .batch-table th,
    .batch-table td {
        padding: 8px;
    }
}


/* ===== AI LEARNING TAB ===== */

.ai-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.ai-metric-card {
    background: var(--white);
    border-radius: 12px 8px 15px 10px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.ai-metric-card .metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-green);
    display: block;
    margin-bottom: 4px;
}

.ai-metric-card .metric-label {
    color: rgba(44, 38, 37, 0.6);
    font-size: 0.85rem;
}

.ai-section {
    background: var(--white);
    border-radius: 16px 12px 20px 14px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
}

.ai-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--charcoal);
    margin-bottom: 16px;
    border-bottom: 2px solid var(--cream-alt);
    padding-bottom: 8px;
}

.ai-recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-insight-card {
    background: var(--cream-alt);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid var(--accent-green);
}

.ai-insight-card h4 {
    font-size: 0.9rem;
    color: var(--accent-green);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-insight-card p {
    color: var(--charcoal);
    line-height: 1.6;
}

.ai-insight-card ul {
    list-style: none;
    padding: 0;
}

.ai-insight-card ul li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(44, 38, 37, 0.1);
    padding-left: 20px;
    position: relative;
}

.ai-insight-card ul li::before {
    content: "•";
    color: var(--primary-red);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.ai-insight-card ul li:last-child {
    border-bottom: none;
}

.ai-insight-card.recommendations {
    border-left-color: var(--primary-red);
}

.ai-insight-card.recommendations h4 {
    color: var(--primary-red);
}

.ai-insight-card pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: var(--white);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    white-space: pre-wrap;
}

.confidence-high {
    color: var(--success);
    font-weight: 600;
}

.confidence-medium {
    color: var(--warning);
    font-weight: 600;
}

.confidence-low {
    color: var(--danger);
    font-weight: 600;
}

.ai-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--cream-alt);
    flex-wrap: wrap;
    gap: 12px;
}

.ai-status-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-category-grid,
.ai-score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.ai-stat-card {
    background: var(--cream-alt);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.ai-stat-card .ai-stat-header {
    font-size: 0.75rem;
    color: rgba(44, 38, 37, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.ai-stat-card .ai-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-green);
    display: block;
}

.ai-stat-card .ai-stat-detail {
    font-size: 0.8rem;
    color: rgba(44, 38, 37, 0.5);
    margin-top: 4px;
}

.ai-stat-card.score-excellent {
    background: rgba(42, 92, 78, 0.15);
}

.ai-stat-card.score-excellent .ai-stat-value {
    color: var(--accent-green);
}

.ai-stat-card.score-high {
    background: rgba(212, 146, 90, 0.15);
}

.ai-stat-card.score-high .ai-stat-value {
    color: var(--warning);
}

.ai-stat-card.score-medium {
    background: rgba(201, 74, 42, 0.1);
}

.ai-stat-card.score-medium .ai-stat-value {
    color: var(--primary-red);
}

.ai-stat-card.score-low {
    background: rgba(44, 38, 37, 0.1);
}

.ai-stat-card.score-low .ai-stat-value {
    color: var(--charcoal);
}

.ai-history-table {
    width: 100%;
    border-collapse: collapse;
}

.ai-history-table th,
.ai-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--cream-alt);
}

.ai-history-table th {
    font-size: 0.8rem;
    color: rgba(44, 38, 37, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-history-table tr.current {
    background: rgba(42, 92, 78, 0.08);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-generated {
    background: rgba(212, 146, 90, 0.2);
    color: var(--warning);
}

.status-badge.status-reviewed {
    background: rgba(42, 92, 78, 0.2);
    color: var(--accent-green);
}

.status-badge.status-applied {
    background: var(--accent-green);
    color: white;
}

.status-badge.status-rejected {
    background: rgba(201, 74, 42, 0.2);
    color: var(--danger);
}

@media (max-width: 768px) {
    .ai-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ai-category-grid,
    .ai-score-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ai-status-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .ai-status-actions {
        width: 100%;
    }

    .ai-status-actions .btn {
        flex: 1;
    }
}


/* ===== MATCHMAKING STATS ON DASHBOARD ===== */

.matchmaking-stats {
    padding: 0;
}

.matchmaking-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .matchmaking-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.match-stat-card {
    background: var(--cream);
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.match-stat-card.highlight-green {
    background: rgba(42, 92, 78, 0.15);
    border: 2px solid var(--accent-green);
}

.match-stat-card.highlight-orange {
    background: rgba(200, 140, 60, 0.12);
    border: 2px solid #c88c3c;
}

.match-stat-card.highlight-orange .match-stat-value {
    color: #c88c3c;
}

.match-stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--charcoal);
}

.match-stat-card.highlight-green .match-stat-value {
    color: var(--accent-green);
}

.match-stat-label {
    font-size: 0.75rem;
    color: rgba(44, 38, 37, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.matchmaking-funnel {
    background: var(--cream-alt);
    padding: 16px 20px;
    border-radius: 10px;
    border-left: 4px solid var(--accent-green);
}

.matchmaking-funnel h4 {
    font-size: 0.85rem;
    color: var(--accent-green);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.funnel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(44, 38, 37, 0.1);
}

.funnel-row:last-child {
    border-bottom: none;
}

.funnel-label {
    color: var(--charcoal);
    font-size: 0.9rem;
}

.funnel-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 1rem;
    color: var(--charcoal);
}

.funnel-value.highlight {
    color: var(--accent-green);
    font-size: 1.1rem;
}


/* ===== HEALTH DETAILS MODAL ===== */

#health-modal .modal-content {
    max-width: 700px;
}

.health-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.health-detail-section {
    background: var(--cream);
    padding: 16px 20px;
    border-radius: 10px;
    border-left: 4px solid var(--charcoal);
}

.health-detail-section:nth-child(1) {
    border-left-color: #dc3545;  /* 5XX - red */
}

.health-detail-section:nth-child(2) {
    border-left-color: #ffc107;  /* 4XX - yellow */
}

.health-detail-section:nth-child(3) {
    border-left-color: #FF9900;  /* Lambda - orange */
}

.health-detail-section:nth-child(4) {
    border-left-color: var(--accent-green);  /* SQS - green */
}

.health-detail-section h4 {
    font-size: 1rem;
    color: var(--charcoal);
    margin: 0 0 8px 0;
}

.health-detail-section p {
    color: rgba(44, 38, 37, 0.8);
    font-size: 0.9rem;
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.health-detail-section ul {
    margin: 8px 0;
    padding-left: 20px;
}

.health-detail-section li {
    color: rgba(44, 38, 37, 0.7);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.health-detail-section p:last-child {
    margin-bottom: 0;
}

/* Tooltip styles for health badges */
.health-badge[title] {
    cursor: help;
    position: relative;
}

.health-badge[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--charcoal);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    max-width: 200px;
    white-space: normal;
    text-align: center;
    z-index: 100;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.health-badge[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--charcoal);
    margin-bottom: 2px;
    z-index: 100;
}


/* ===== SQS CARD ENHANCEMENTS ===== */

.aws-card.sqs {
    position: relative;
}

.sqs-info-icon {
    font-size: 12px;
    color: rgba(44, 38, 37, 0.4);
    cursor: help;
}

.sqs-realtime-note {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(44, 38, 37, 0.1);
    font-size: 11px;
    color: rgba(44, 38, 37, 0.5);
    text-align: center;
    font-style: italic;
}

.aws-card[title] {
    cursor: help;
}

.aws-note {
    margin-top: 8px;
    padding: 6px 8px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 4px;
    font-size: 10px;
    color: rgba(44, 38, 37, 0.7);
    text-align: center;
}

.aws-note-small {
    margin-top: 6px;
    font-size: 10px;
    color: rgba(44, 38, 37, 0.4);
    text-align: center;
    font-style: italic;
}


/* ===== DEAL FUNNEL METRICS ===== */

.deal-funnel-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .deal-funnel-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .deal-funnel-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.funnel-stat {
    background: var(--cream);
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.funnel-stat.highlight {
    background: rgba(42, 92, 78, 0.15);
    border: 2px solid var(--accent-green);
}

.funnel-stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--charcoal);
}

.funnel-stat.highlight .funnel-stat-value {
    color: var(--accent-green);
}

.funnel-stat-label {
    font-size: 0.75rem;
    color: rgba(44, 38, 37, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.deal-funnel-summary {
    background: var(--cream-alt);
    padding: 16px 20px;
    border-radius: 10px;
    border-left: 4px solid var(--accent-green);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(44, 38, 37, 0.1);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row span {
    color: var(--charcoal);
    font-size: 0.9rem;
}

.summary-row strong {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-green);
    font-size: 1rem;
}


/* ===== DEAL STAGE MODAL ===== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 38, 37, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay .modal-content {
    background: var(--white);
    padding: 32px;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    box-shadow: var(--shadow-strong);
}

.modal-overlay .modal-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--charcoal);
    margin-bottom: 20px;
}

.modal-overlay select,
.modal-overlay input[type="number"],
.modal-overlay input[type="date"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--cream-alt);
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    margin-top: 6px;
}

.modal-overlay select:focus,
.modal-overlay input:focus {
    border-color: var(--primary-red);
    outline: none;
}

.modal-overlay label {
    display: block;
    font-weight: 500;
    color: var(--charcoal);
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-small {
    max-width: 400px;
}

.modal-small h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--charcoal);
    margin-bottom: 20px;
}

.modal-small .form-group {
    margin-bottom: 16px;
}

.modal-small select,
.modal-small input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--cream-alt);
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
}

.modal-small select:focus,
.modal-small input[type="number"]:focus {
    border-color: var(--primary-red);
    outline: none;
}


/* ===== DEAL STAGE BADGES ===== */

.deal-stage-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
}

.deal-stage-badge.stage-intro {
    background: rgba(212, 146, 90, 0.2);
    color: var(--gold);
}

.deal-stage-badge.stage-talking {
    background: rgba(92, 149, 165, 0.2);
    color: #5C95A5;
}

.deal-stage-badge.stage-negotiating {
    background: rgba(201, 74, 42, 0.15);
    color: var(--primary-red);
}

.deal-stage-badge.stage-closed {
    background: rgba(42, 92, 78, 0.15);
    color: var(--accent-green);
}

.deal-stage-badge.stage-completed {
    background: #28a745;
    color: white;
}


/* ===== CASE STUDY BADGE ===== */

.case-study-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(136, 58, 234, 0.15);
    color: #883aea;
    margin-left: 8px;
}


/* ===== STORY CARD ENHANCEMENTS ===== */

.story-card .story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.story-card .story-actions-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.story-card .btn-icon {
    padding: 8px 14px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.story-match-link {
    font-size: 12px;
    color: var(--accent-green);
    text-decoration: underline;
    cursor: pointer;
}

.story-match-link:hover {
    color: var(--primary-red);
}


/* ===== PROFILE BADGES ROW ===== */

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 4px;
}

.profile-badges:empty {
    display: none;
}

/* ===== VERIFICATION BADGES ===== */

.verification-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: help;
    white-space: nowrap;
}

.verification-badge.verified {
    background: var(--accent-green);
    color: white;
}

.verification-badge.unverified {
    background: #D4925A;
    color: white;
}

.verification-badge.flagged {
    background: var(--danger);
    color: white;
}

/* ===== IDENTITY BADGES ===== */

.identity-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: help;
    white-space: nowrap;
}

.identity-badge.verified {
    background: #1a7a4c;
    color: white;
}

.identity-badge.unverified {
    background: #8B7355;
    color: white;
}

.identity-badge.suspicious {
    background: var(--danger);
    color: white;
}

.verification-score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    margin-left: 4px;
}

.verification-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

/* ===== AI CLEANUP ===== */

.cleanup-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(42, 92, 78, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(42, 92, 78, 0.2);
}

.cleanup-meta {
    font-size: 12px;
    color: rgba(44, 38, 37, 0.6);
    margin-top: 4px;
}

.cleanup-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.cleanup-field {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    background: var(--cream-alt);
    color: rgba(44, 38, 37, 0.75);
    border: 1px solid rgba(44, 38, 37, 0.1);
}

.verification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.verification-card {
    background: var(--cream);
    padding: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.verification-card.verified {
    border-left: 4px solid var(--accent-green);
}

.verification-card.unverified {
    border-left: 4px solid var(--gold);
}

.verification-card.flagged {
    border-left: 4px solid var(--danger);
}

.verification-card.neutral {
    border-left: 4px solid var(--charcoal);
}

.verification-value {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--charcoal);
    line-height: 1;
}

.verification-label {
    font-size: 12px;
    color: rgba(44, 38, 37, 0.7);
}


/* ===== PROFILE CARD VERIFICATION FLAGS ===== */

.profile-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.profile-flag {
    background: rgba(212, 146, 90, 0.15);
    color: var(--gold);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

.profile-suggestions {
    margin-top: 12px;
    padding: 10px;
    background: rgba(42, 92, 78, 0.08);
    border-radius: 8px;
    border-left: 3px solid var(--accent-green);
}

.profile-suggestions h5 {
    font-size: 11px;
    color: var(--accent-green);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-suggestions li {
    font-size: 12px;
    color: var(--charcoal);
    padding: 2px 0;
}

/* ===== SEARCH BOX ===== */
.search-box {
    margin-bottom: 16px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8e4df;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(42, 92, 78, 0.1);
}

/* ===== WHITELIST LIST ===== */
.whitelist-list-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e8e4df;
}

.whitelist-list-section h3 {
    margin-bottom: 12px;
}

.whitelist-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e8e4df;
    border-radius: 12px;
    background: #faf8f5;
}

.whitelist-entry {
    display: grid;
    grid-template-columns: 2fr 1.2fr 100px 90px 90px 140px;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #e8e4df;
    font-size: 13px;
    align-items: center;
}

.whitelist-entry:last-child {
    border-bottom: none;
}

.whitelist-entry:hover {
    background: rgba(42, 92, 78, 0.05);
}

.cert-entry {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #e8e4df;
}

.cert-entry:last-child {
    border-bottom: none;
}

.cert-entry:hover {
    background: rgba(42, 92, 78, 0.05);
}

.cert-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.cert-badges-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.cert-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(42, 92, 78, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(42, 92, 78, 0.2);
}

.cert-pill-profile {
    margin-left: 6px;
    vertical-align: middle;
}

.cert-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.whitelist-email {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--charcoal);
}

.whitelist-name {
    color: var(--text-muted);
}

.whitelist-date {
    color: var(--text-muted);
    font-size: 11px;
}

/* ===== HINT STYLES ===== */
[title] {
    cursor: help;
}

.match-stat-card[title],
.funnel-row[title] {
    cursor: help;
    position: relative;
}

.match-stat-card[title]:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Custom tooltips for match stat cards */
.match-stat-card[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--charcoal);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: normal;
    max-width: 220px;
    text-align: center;
    z-index: 100;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    pointer-events: none;
}

.match-stat-card[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--charcoal);
    margin-bottom: 2px;
    z-index: 100;
    pointer-events: none;
}

/* Custom tooltips for verification badges */
.verification-badge[title] {
    position: relative;
}

.verification-badge[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--charcoal);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: normal;
    max-width: 250px;
    text-align: center;
    z-index: 100;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    pointer-events: none;
}

.verification-badge[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--charcoal);
    margin-bottom: 2px;
    z-index: 100;
    pointer-events: none;
}


/* ===== FULL PROFILE DETAIL (text-based) ===== */

.profile-detail-full {
    padding: 24px;
}

.profile-detail-full h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--charcoal);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cream-alt);
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-red);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--cream-alt);
}

.detail-field {
    display: flex;
    padding: 4px 0;
    font-size: 14px;
    line-height: 1.5;
}

.detail-label {
    min-width: 140px;
    color: rgba(44, 38, 37, 0.6);
    font-weight: 500;
    flex-shrink: 0;
}

.detail-value {
    color: var(--charcoal);
    word-break: break-word;
}

.detail-item {
    padding: 2px 0;
    color: var(--charcoal);
    font-size: 14px;
}


/* ===== HEALTH ALERTS (actionable context) ===== */

.health-alerts {
    margin-top: 16px;
}

.health-alert {
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.health-alert-error {
    background: rgba(201, 74, 42, 0.1);
    border-left: 3px solid var(--primary-red);
    color: var(--charcoal);
}

.health-alert-warning {
    background: rgba(212, 146, 90, 0.15);
    border-left: 3px solid var(--gold);
    color: var(--charcoal);
}


/* ===== AI INSIGHTS IN ANALYTICS ===== */

#analytics-insights-section {
    margin-top: 0;
}

#analytics-insights-section .ai-insight-card {
    border-left-color: var(--gold);
}

#analytics-insights-section .ai-insight-card h4 {
    color: var(--gold);
}


/* ===== DELTA SUMMARY ===== */

.delta-summary {
    background: rgba(42, 42, 62, 0.6);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--charcoal);
    border: 1px solid var(--border);
}


/* ===== HISTORICAL INSIGHTS ===== */

#analytics-insights-history-section {
    margin-top: 0;
}

.history-insight-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.history-insight-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    background: var(--cream);
    transition: background 0.2s;
}

.history-insight-header:hover {
    background: var(--pearl);
}

.history-period {
    font-weight: 600;
    font-size: 13px;
    min-width: 80px;
    color: var(--espresso);
}

.history-date {
    font-size: 12px;
    color: var(--charcoal);
    min-width: 90px;
}

.history-summary {
    flex: 1;
    font-size: 13px;
    color: var(--charcoal);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-toggle {
    font-size: 12px;
    color: var(--charcoal);
    transition: transform 0.2s;
}

.history-insight-body {
    padding: 14px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.6;
    background: var(--white);
}

.engagement-hint {
    background: rgba(212, 146, 90, 0.12);
    border-left: 3px solid var(--gold);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    color: var(--charcoal);
    font-size: 13px;
    line-height: 1.45;
}


/* ===== RESPONSIVE: ANALYTICS GRID ===== */

@media (max-width: 768px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== WHITELIST STATS ROW ===== */
.whitelist-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.wl-stat-card {
    background: var(--white);
    padding: 20px 24px;
    border-radius: 15px 12px 18px 10px;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.wl-stat-value {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--charcoal);
}

.wl-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.wl-stat-active .wl-stat-value { color: #2a5c4e; }
.wl-stat-inactive .wl-stat-value { color: #b54a4a; }

/* Source breakdown */
.wl-source-breakdown {
    margin-bottom: 24px;
}

.wl-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wl-source-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #f0ebe4;
    color: var(--charcoal);
}

.wl-source-master { background: #e8d5c4; color: #7a4a1e; }
.wl-source-elite { background: #d4e8d4; color: #2a5c2e; }
.wl-source-manual { background: #d4d8e8; color: #2a3c5c; }
.wl-source-skool { background: #e8d4e8; color: #5c2a5c; }
.wl-source-import { background: #f0ebe4; color: #6b5b4e; }

/* Filters row */
.wl-filters-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.wl-filters-row input,
.wl-filters-row select {
    padding: 8px 12px;
    border: 1px solid #d8d4ce;
    border-radius: 8px;
    font-size: 13px;
    background: #faf8f5;
}

.wl-filters-row input { flex: 2; }
.wl-filters-row select { flex: 1; }

/* Table header */
.wl-table-header {
    display: grid;
    grid-template-columns: 2fr 1.2fr 100px 90px 90px 140px;
    gap: 12px;
    padding: 10px 16px;
    background: #f0ebe4;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-radius: 8px 8px 0 0;
}

/* Status badges */
.wl-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    text-align: center;
}

.wl-status-active {
    background: #d4e8d4;
    color: #2a5c2e;
}

.wl-status-inactive {
    background: #e8d4d4;
    color: #5c2a2a;
}

/* Action buttons */
.wl-actions {
    display: flex;
    gap: 4px;
}

.wl-actions .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
    border: 1px solid #d8d4ce;
    cursor: pointer;
    background: var(--white);
    color: var(--charcoal);
}

.wl-actions .btn-sm:hover {
    background: #f0ebe4;
}

.wl-actions .btn-sm.btn-danger {
    border-color: #d4a0a0;
    color: #b54a4a;
}

.wl-actions .btn-sm.btn-danger:hover {
    background: #fde8e8;
}

.wl-actions .btn-sm.btn-success {
    border-color: #a0d4a0;
    color: #2a5c2e;
}

.wl-actions .btn-sm.btn-success:hover {
    background: #e8fde8;
}

/* Edit modal extras */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--primary-red);
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--charcoal);
    padding: 0 4px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.modal-body .form-group input,
.modal-body .form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d8d4ce;
    border-radius: 8px;
    font-size: 13px;
    background: #faf8f5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid #e8e4df;
}

/* ===== AGENTS TAB ===== */

.agents-overview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .agents-overview {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 500px) {
    .agents-overview {
        grid-template-columns: repeat(2, 1fr);
    }
}

.agents-brief-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.agents-metric {
    background: var(--cream);
    padding: 14px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.agents-metric-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--charcoal);
}

.agents-metric-label {
    font-size: 0.75rem;
    color: rgba(44, 38, 37, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tablica-sample-card {
    background: var(--cream-alt);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid var(--accent-green);
}

.tablica-sample-header {
    margin-bottom: 8px;
    font-size: 14px;
}

.tablica-sample-body {
    font-size: 13px;
    line-height: 1.5;
}


/* ===== AI PULSE TAB ===== */

.pulse-status-bar {
    margin-bottom: 24px;
}

.pulse-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.pulse-status-ok {
    background: rgba(42, 92, 78, 0.1);
    color: var(--accent-green);
}

.pulse-status-stale {
    background: rgba(212, 146, 90, 0.15);
    color: var(--gold);
}

.pulse-status-error {
    background: rgba(201, 74, 42, 0.1);
    color: var(--primary-red);
}

.pulse-status-loading {
    background: var(--cream-alt);
    color: rgba(44, 38, 37, 0.6);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pulse-dot-ok {
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(42, 92, 78, 0.4);
}

.pulse-dot-stale {
    background: var(--gold);
    box-shadow: 0 0 6px rgba(212, 146, 90, 0.4);
}

.pulse-dot-error {
    background: var(--primary-red);
    box-shadow: 0 0 6px rgba(201, 74, 42, 0.4);
}

.pulse-dot-loading {
    background: rgba(44, 38, 37, 0.3);
    animation: pulse-blink 1.5s infinite;
}

@keyframes pulse-blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.pulse-status-text {
    font-size: 14px;
}

/* Pulse Recommendations */

.pulse-recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pulse-recommendation {
    background: var(--white);
    border-radius: 12px;
    padding: 16px 20px;
    border-left: 5px solid #6c757d;
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.2s;
}

.pulse-recommendation:hover {
    box-shadow: var(--shadow-medium);
}

.pulse-priority-pilne {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.04) 0%, var(--white) 100%);
}

.pulse-priority-wazne {
    border-left-color: #fd7e14;
    background: linear-gradient(135deg, rgba(253, 126, 20, 0.04) 0%, var(--white) 100%);
}

.pulse-priority-growth {
    border-left-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.04) 0%, var(--white) 100%);
}

.pulse-priority-info {
    border-left-color: #6c757d;
}

.pulse-rec-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pulse-rec-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pulse-category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    flex-shrink: 0;
}

.pulse-rec-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--charcoal);
}

.pulse-rec-description {
    font-size: 14px;
    color: rgba(44, 38, 37, 0.7);
    line-height: 1.5;
    margin: 0;
}

.pulse-rec-metric {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-green);
    background: rgba(42, 92, 78, 0.08);
    padding: 4px 12px;
    border-radius: 6px;
    width: fit-content;
}

/* Pulse Metrics Grid */

.pulse-metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

@media (max-width: 1100px) {
    .pulse-metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .pulse-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.pulse-metric-card {
    background: var(--cream);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pulse-metric-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--charcoal);
    line-height: 1.2;
}

.pulse-metric-label {
    font-size: 0.75rem;
    color: rgba(44, 38, 37, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pulse-metric-detail {
    font-size: 0.7rem;
    color: rgba(44, 38, 37, 0.5);
    min-height: 14px;
}

/* Pulse History Table */

.pulse-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pulse-history-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--cream);
    font-weight: 600;
    color: var(--charcoal);
    border-bottom: 2px solid var(--cream-alt);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pulse-history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--cream-alt);
    color: var(--charcoal);
}

.pulse-history-table td:nth-child(2) {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

.pulse-history-table tr:hover td {
    background: var(--cream);
}

.pulse-hist-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.pulse-hist-ok {
    background: rgba(42, 92, 78, 0.15);
    color: var(--accent-green);
}

.pulse-hist-stale {
    background: rgba(212, 146, 90, 0.2);
    color: var(--gold);
}

.pulse-hist-error {
    background: rgba(201, 74, 42, 0.15);
    color: var(--primary-red);
}

/* Badge Stats */
.badge-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.badge-distribution {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.badge-row {
    display: grid;
    grid-template-columns: 28px 160px 1fr 40px;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--cream);
    border-radius: 8px;
}

.badge-icon {
    font-size: 1.1rem;
    text-align: center;
}

.badge-name {
    font-size: 0.85rem;
    color: var(--charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-bar-wrap {
    height: 8px;
    background: var(--cream-alt);
    border-radius: 4px;
    overflow: hidden;
}

.badge-bar {
    height: 100%;
    background: var(--accent-green);
    border-radius: 4px;
    min-width: 4px;
    transition: width 0.3s ease;
}

.badge-count {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--charcoal);
    text-align: right;
}
