:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-subtle: #f1f5f9;
    --bg-input: #ffffff;
    
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    
    --primary: #0f172a;
    --primary-hover: #1e293b;

    --text-main: #0f172a;
    --text-muted: #64748b;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 6px;
    --radius-md: 10px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    line-height: 1.5;
}

/* Auth Full Page View */
.auth-landing-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    background: #ffffff;
}

.auth-card-container {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2.25rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.auth-header h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.auth-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.45;
}

.auth-toggle-btns {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.auth-toggle-btn {
    flex: 1;
    padding: 0.55rem;
    background: transparent;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.auth-toggle-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: var(--shadow-sm);
}

.auth-form-group {
    margin-bottom: 1.15rem;
}

.auth-form-group label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

/* Header Navbar - Dashboard */
.product-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem 2rem;
}

.product-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.product-branding {
    flex: 1;
    min-width: 300px;
}

.product-brand-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.logo-badge {
    background: #0f172a;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
}

.product-brand-title h1 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.product-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.product-onboarding-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.45;
    max-width: 850px;
}

.product-action-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.1rem;
}

/* System Health Status Bar */
.system-health-bar {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.9rem;
    border-radius: 20px;
    font-size: 0.825rem;
    white-space: nowrap;
    flex-wrap: wrap;
}

.health-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.green { background: #10b981; }
.status-dot.red { background: #ef4444; }

/* Buttons */
.btn {
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
}

.btn-primary {
    background: #0f172a;
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #1e293b;
    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-accent {
    background: #2563eb;
    color: #ffffff;
}

.btn-accent:hover {
    background: #1d4ed8;
    color: #ffffff;
}

/* Layout Container */
.app-container {
    max-width: 1400px;
    margin: 1.75rem auto;
    padding: 0 1.5rem;
}

/* Navigation Tabs */
.tabs-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.75rem;
    overflow-x: auto;
    white-space: nowrap;
}

.tab-btn {
    padding: 0.85rem 1.4rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #0f172a;
}

.tab-btn.active {
    color: #0f172a;
    border-bottom-color: #0f172a;
}

.tab-content {
    display: none;
}

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

/* KPI Summary Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
}

.kpi-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
}

.kpi-value {
    font-size: 2.4rem;
    font-weight: 800;
    margin: 0.3rem 0 0.1rem 0;
    color: #0f172a;
}

.kpi-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Main Card & Header */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}

/* Enterprise Help Button */
.help-btn {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: var(--shadow-sm);
}

.help-btn:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.tab-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Integration Step Cards */
.integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.step-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.step-badge {
    background: #0f172a;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    text-transform: uppercase;
}

.step-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.step-body p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.code-box {
    background: #0f172a;
    color: #f8fafc;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.825rem;
    overflow-x: auto;
    white-space: pre-wrap;
    margin-bottom: 1rem;
    border: 1px solid #1e293b;
}

.arch-flow-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #0f172a;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.6;
}

/* Styled Filter & Search Controls */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.input-select, .input-text {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.15s ease;
    min-width: 140px;
}

.input-select option {
    background: #ffffff;
    color: #0f172a;
}

.input-select:focus, .input-text:focus {
    border-color: #0f172a;
}

.input-text {
    min-width: 280px;
}

.input-text::placeholder {
    color: #94a3b8;
}

/* Table Styling */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.data-table th {
    background: #f8fafc;
    padding: 0.85rem 1.2rem;
    color: #475569;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.725rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.data-table td {
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: #0f172a;
}

.data-table tbody tr:hover {
    background: #f1f5f9;
}

/* Tags & Badges */
.model-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
}

.model-tag.requested {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.model-tag.actual {
    background: #e2e8f0;
    color: #0f172a;
    border: 1px solid #94a3b8;
}

.model-tag.approved {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    margin: 0.15rem;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.725rem;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge.reason-cost { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge.reason-availability { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge.reason-policy { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }

.badge.risk-low { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge.risk-medium { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge.risk-high { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge.risk-critical { background: #fecdd3; color: #881337; border: 1px solid #fda4af; }

.badge.status-approved { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge.status-flagged { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Modal Styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 680px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 1.85rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.9rem;
    margin-bottom: 1.25rem;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #0f172a;
}

.detail-row {
    margin-bottom: 0.8rem;
    font-size: 0.875rem;
    color: var(--text-main);
}

.explanation-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-top: 0.5rem;
}

.divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

/* Utilities & Responsive Media Queries */
.text-center { text-align: center; }
.text-danger { color: #991b1b; }
.text-success { color: #166534; }
.font-mono { font-family: var(--font-mono); }
.margin-top { margin-top: 1.5rem; }

@media (max-width: 1024px) {
    .product-header-top {
        flex-direction: column;
        align-items: stretch;
    }
    .system-health-bar {
        align-self: flex-start;
    }
}

@media (max-width: 768px) {
    .product-header {
        padding: 1.25rem 1rem;
    }
    .app-container {
        padding: 0 0.85rem;
    }
    .product-brand-title h1 {
        font-size: 1.25rem;
    }
    .card {
        padding: 1.25rem;
    }
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    .input-select, .input-text {
        width: 100%;
    }
}

/* Demo Simulation Live Row Highlight & Hand Pointer */
@keyframes newRowPulse {
    0% { background-color: #dcfce7; box-shadow: inset 4px 0 0 #22c55e, 0 0 12px rgba(34, 197, 94, 0.35); }
    50% { background-color: #f0fdf4; box-shadow: inset 4px 0 0 #16a34a, 0 0 18px rgba(34, 197, 94, 0.55); }
    100% { background-color: #dcfce7; box-shadow: inset 4px 0 0 #22c55e, 0 0 12px rgba(34, 197, 94, 0.35); }
}

.new-event-highlight {
    animation: newRowPulse 2s ease-in-out infinite;
    font-weight: 600;
}

.demo-hand-pointer {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #15803d;
    color: #ffffff;
    font-size: 0.725rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-left: 0.5rem;
    animation: bounceHand 1s infinite alternate;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

@keyframes bounceHand {
    0% { transform: translateX(0); }
    100% { transform: translateX(5px); }
}
