/* =========================================
   REVOPS SIMULATOR - PREMIUM SAAS THEME
   Inspired by modern UI (Linear, Stripe, Vercel)
========================================= */

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

:root {
    /* Brand Colors - Vibrant & Premium */
    --brand-primary: #4F46E5;
    /* Indigo 600 */
    --brand-primary-hover: #4338CA;
    --brand-primary-light: #EEF2FF;

    /* Backgrounds */
    --bg-app: #FAFAFA;
    /* Very faint cool gray */
    --bg-card: #FFFFFF;
    --bg-header: rgba(255, 255, 255, 0.85);
    /* Glassmorphism base */

    /* Semantic Colors */
    --success-text: #059669;
    /* Emerald 600 */
    --success-bg: #D1FAE5;
    /* Emerald 100 */

    --warning-text: #D97706;
    /* Amber 600 */
    --warning-bg: #FEF3C7;
    /* Amber 100 */

    --danger-text: #DC2626;
    /* Red 600 */
    --danger-bg: #FEE2E2;
    /* Red 100 */

    /* Text */
    --text-primary: #111827;
    /* Gray 900 */
    --text-secondary: #4B5563;
    /* Gray 600 */
    --text-tertiary: #9CA3AF;
    /* Gray 400 */

    /* Borders & Structural */
    --border-light: #F3F4F6;
    --border-regular: #E5E7EB;
    --border-focus: #818CF8;

    /* "Nice Edges" - Generous Corner Radii */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Premium Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-glow: 0 0 15px rgba(79, 70, 229, 0.15);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 0.875rem;
    /* 14px base */
}

h1,
h2,
h3,
h4,
h5 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
    /* Tighter tracking for premium feel */
}

/* =========================================
   LOGIN MODAL
========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    width: 420px;
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle top glow line on modal */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4F46E5, #3B82F6, #10B981);
}

.modal-content h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-regular);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    background: #F9FAFB;
    transition: all var(--transition-fast);
}

input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--border-focus);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

/* Base Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1.25rem;
    height: 2.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-regular);
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary:hover {
    background: var(--brand-primary-hover);
    color: white;
    border-color: var(--brand-primary-hover);
    box-shadow: var(--shadow-glow);
}

.btn-full {
    width: 100%;
}

/* =========================================
   APPLICATION LAYOUT
========================================= */

.slds-app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Premium Global Header - Glassmorphism */
.slds-global-header {
    height: 60px;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.slds-global-header__logo {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.slds-global-header__profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.slds-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), #818CF8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-sm);
}

/* App Nav Bar (Horizontal Tabs) */
.slds-app-nav-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-regular);
}

.slds-nav {
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 0.5rem;
}

.slds-nav .nav-item {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: 54px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    position: relative;
}

.slds-nav .nav-item:hover {
    color: var(--text-primary);
}

.slds-nav .nav-item.active {
    color: var(--brand-primary);
    font-weight: 600;
}

.slds-nav .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand-primary);
    border-radius: 2px 2px 0 0;
}

/* Highlights Panel */
.slds-highlights-panel {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-regular);
    padding: 1.5rem;
    display: flex;
    gap: 3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.slds-highlight-item {
    display: flex;
    flex-direction: column;
}

.slds-highlight-item .slds-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.slds-highlight-item .slds-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Content Layout */
.slds-content {
    padding: 2rem 1.5rem;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.view {
    display: none;
    animation: fadeIn 0.4s var(--transition-spring);
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.view-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.view-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* =========================================
   COMPONENTS - CARDS & METRICS
========================================= */

.metric-card,
.quarter-report,
.decision-group {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    transition: all var(--transition-fast);
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border-regular);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Metric Inner Details */
.metric-card .details {
    display: flex;
    flex-direction: column;
}

.metric-card .icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.metric-card .label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.metric-card .value {
    font-size: 1.75rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.03em;
}

/* Special Gradients for High Value Metrics */
.metric-card.premium-bg {
    background: linear-gradient(135deg, #111827, #374151);
    color: white;
    border: none;
}

.metric-card.premium-bg .label {
    color: #9CA3AF;
}

.metric-card.premium-bg .value {
    color: white;
}

/* =========================================
   DATA TABLES (Roster, Logs, Reports)
========================================= */

.quarter-report {
    padding: 0;
    /* Remove internal padding for edge-to-edge tables */
    overflow: hidden;
}

.quarter-report table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.quarter-report table thead {
    background: #F9FAFB;
}

.quarter-report table th {
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-regular);
    text-align: left;
}

.quarter-report table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.quarter-report table tbody tr {
    transition: background var(--transition-fast);
}

.quarter-report table tbody tr:hover {
    background: #F9FAFB;
}

/* Remove bottom border on last row */
.quarter-report table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges / Pills */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    /* Pill shape */
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning-text);
}

.badge-danger {
    background-color: var(--danger-bg);
    color: var(--danger-text);
}

.badge-neutral {
    background-color: #F3F4F6;
    color: #4B5563;
}

/* =========================================
   DECISIONS & ACTIONS
========================================= */

.decisions-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .decisions-layout {
        grid-template-columns: 1fr;
    }
}

.decision-group h3 {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.decision-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.decision-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.decision-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.decision-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Increment/Decrement Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #F9FAFB;
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-regular);
}

.btn-circle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: white;
    border: 1px solid var(--border-regular);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.125rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-circle:hover {
    color: var(--text-primary);
    border-color: #D1D5DB;
    transform: translateY(-1px);
}

.btn-circle:active {
    transform: translateY(0);
}

.val-badge {
    min-width: 48px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Action Ribbon - Floating Footer */
.actions-ribbon {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 100;
}

.actions-ribbon .btn {
    height: 3.5rem;
    padding: 0 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 9999px;
    /* Fully rounded pill */
    box-shadow: var(--shadow-lg);
}

.actions-ribbon .btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), #6366F1);
}

/* =========================================
   NOTIFICATIONS / TOASTS
========================================= */

.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    z-index: 2000;
    transform: translateX(120%);
    transition: transform var(--transition-spring);
    display: flex;
    flex-direction: column;
    min-width: 300px;
    border-left: 4px solid var(--brand-primary);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left-color: var(--success-text);
}

.notification.danger {
    border-left-color: var(--danger-text);
}

.notification h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 700;
}

.notification p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}