/* Elderus Monitor — Phase 1 Styles */
:root {
    --bg: #f8f6f1;
    --navy: #1a1a2e;
    --red: #c0392b;
    --text: #2C2C2C;
    --text-light: #666;
    --border: #ddd;
    --success: #27ae60;
    --white: #fff;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
}

/* Navigation */
.nav {
    background: var(--navy);
    color: var(--white);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}
.nav-user {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    margin-left: 8px;
}

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

h1 { font-size: 24px; margin-bottom: 16px; color: var(--navy); }
h2 { font-size: 20px; margin: 24px 0 12px; color: var(--navy); }

/* Flash messages */
.flash {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.flash-error { background: #fdecea; color: var(--red); border: 1px solid #f5c6cb; }
.flash-success { background: #e8f5e9; color: var(--success); border: 1px solid #c8e6c9; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: #2a2a4e; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #219a52; }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #a93226; }

/* Login */
.login-container {
    max-width: 360px;
    margin: 80px auto;
    text-align: center;
}
.login-container h1 { font-size: 28px; }
.subtitle { color: var(--text-light); margin-bottom: 24px; }
.login-form { text-align: left; }
.login-form label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; margin-top: 12px; }
.login-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
    background: var(--white);
}
.login-form .btn { width: 100%; margin-top: 20px; }

/* User switcher */
.user-switcher { margin-bottom: 16px; display: flex; gap: 8px; }
.monitoring-label { color: var(--text-light); margin-bottom: 16px; font-size: 14px; }

/* Filters */
.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.filters select, .filters input[type="date"] {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--white);
}

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-event {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid var(--navy);
}
.timeline-event.event-checkout_attempt { border-left-color: var(--red); }
.timeline-event.event-order_confirmation { border-left-color: var(--success); }

.event-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.event-type-badge {
    background: var(--navy);
    color: var(--white);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}
.event-cart_view .event-type-badge { background: #f1c40f; color: #000; }
.event-order_confirmation .event-type-badge { background: var(--red); color: var(--white); }
.event-time { color: var(--text-light); font-size: 13px; }
.event-product { margin-bottom: 6px; }
.event-price { color: var(--red); font-weight: 600; margin-left: 8px; }
.event-price-green { color: var(--success); font-weight: 700; font-size: 16px; margin-right: 8px; }
.event-asin, .event-category { color: var(--text-light); font-size: 13px; margin-left: 8px; }
.event-url { font-size: 13px; color: var(--navy); }
.event-cart-item { padding: 6px 0; border-bottom: 1px solid #eee; }
.event-cart-item:last-child { border-bottom: none; }
.event-cart-item .event-url { margin-left: 8px; }
.event-cart-total { margin-top: 8px; padding-top: 8px; border-top: 2px solid var(--navy); font-size: 15px; }
.event-order-number { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.event-order-total { font-size: 18px; margin-bottom: 4px; }
.event-delivery { color: var(--text-light); font-size: 14px; }

/* Rules */
.rules-list { display: flex; flex-direction: column; gap: 12px; }
.rule-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}
.rule-disabled { opacity: 0.5; }
.rule-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rule-type-badge {
    background: var(--navy);
    color: var(--white);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}
.rule-enforcement { font-size: 13px; font-weight: 500; }
.enforcement-hard { color: var(--red); }
.enforcement-soft { color: #e67e22; }
.rule-params { margin-bottom: 8px; font-size: 15px; }
.rule-meta { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.rule-actions { display: flex; gap: 8px; }

/* Rule form */
.rule-form { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.form-group select, .form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    background: var(--white);
}

/* Intercepts / Approvals */
.intercept-list { display: flex; flex-direction: column; gap: 12px; }
.intercept-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}
.intercept-pending { border-left: 4px solid #e67e22; }
.intercept-approved { border-left: 4px solid var(--success); }
.intercept-denied { border-left: 4px solid var(--red); }

.intercept-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.intercept-user { font-weight: 600; }
.intercept-time { color: var(--text-light); font-size: 13px; }
.intercept-rule { margin-bottom: 8px; font-size: 14px; }
.intercept-cart { margin-bottom: 12px; }
.intercept-price { font-weight: 600; color: var(--red); font-size: 18px; }
.intercept-actions { display: flex; gap: 8px; }
.intercept-meta { font-size: 13px; color: var(--text-light); }

.status-approved { color: var(--success); font-weight: 600; }
.status-denied { color: var(--red); font-weight: 600; }
.status-expired { color: var(--text-light); font-weight: 600; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    background: var(--white);
    border: 1px dashed var(--border);
    border-radius: 8px;
}
