:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --border-color: #e2e8f0;
    --border-color-glow: rgba(99, 102, 241, 0.4);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-indigo: #4f46e5;
    --accent-indigo-hover: #4338ca;
    --accent-indigo-bg: #eef2ff;
    
    --accent-green: #059669;
    --accent-green-bg: #ecfdf5;
    
    --accent-red: #e11d48;
    --accent-red-bg: #fff1f2;
    
    --accent-amber: #d97706;
    --accent-amber-bg: #fffbeb;
    
    --accent-purple: #7c3aed;
    --accent-purple-bg: #f5f3ff;
    
    --accent-blue: #2563eb;
    --accent-blue-bg: #eff6ff;
    
    --accent-canva: #00a4aa;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    
    --shadow-soft: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
    --shadow-elevated: 0 20px 35px -10px rgba(15, 23, 42, 0.08), 0 0 1px 1px rgba(15, 23, 42, 0.04);
    --spring-transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    overflow-x: hidden;
}

/* Soft Ambient Background Mesh Gradients */
.bg-glow {
    position: absolute;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1 {
    top: -120px;
    left: -120px;
    background: radial-gradient(circle, #e0e7ff, #f5f3ff);
}

.bg-glow-2 {
    bottom: -120px;
    right: -120px;
    background: radial-gradient(circle, #ccfbf1, #eff6ff);
}

.app-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: relative;
    z-index: 1;
}

/* Motion Entry Animations */
.motion-entry {
    opacity: 0;
    transform: translateY(18px);
    animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: var(--delay, 0s);
}

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

/* Navigation Header */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    padding: 18px 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
    transition: var(--spring-transition);
}

.logo-icon:hover {
    transform: scale(1.08) rotate(5deg);
}

.brand-text h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.4px;
}

.sub-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.dot-sep {
    color: var(--text-muted);
}

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

.status-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

.pulse-dot.red {
    background-color: var(--accent-red);
    box-shadow: 0 0 10px var(--accent-red);
}

/* Buttons & Micro-Interactions */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--spring-transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-hero {
    padding: 13px 26px;
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.28);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 28px rgba(79, 70, 229, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-danger {
    background: linear-gradient(135deg, #e11d48, #f43f5e);
    color: #fff;
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.28);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 28px rgba(225, 29, 72, 0.4);
}

.btn-danger:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.btn-canva {
    background: linear-gradient(135deg, #00c4cc, #008085);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 196, 204, 0.3);
}

.btn-canva:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 196, 204, 0.45);
}

.btn-icon {
    width: 46px;
    height: 46px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-icon:hover {
    color: var(--text-primary);
    background: #f8fafc;
    transform: rotate(45deg);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Live Execution Bar */
.live-status-bar {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-soft);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-pulse-ring {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-pulse-ring .ring-inner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--accent-indigo);
    box-shadow: 0 0 12px rgba(79, 70, 229, 0.4);
}

.status-pulse-ring.active .ring-inner {
    background-color: var(--accent-green);
    box-shadow: 0 0 16px rgba(5, 150, 105, 0.5);
    animation: pulseGlow 1.5s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

.status-text-block {
    display: flex;
    flex-direction: column;
}

.status-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.status-chip {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--accent-indigo-bg);
    color: var(--accent-indigo);
    border: 1px solid rgba(79, 70, 229, 0.2);
    letter-spacing: 0.5px;
}

.status-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.status-timer-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

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

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-soft);
    transition: var(--spring-transition);
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-elevated);
    border-color: #cbd5e1;
}

/* Accent Lines for Cards */
.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}

.card-purple::before { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.card-blue::before { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.card-green::before { background: linear-gradient(90deg, #059669, #10b981); }
.card-amber::before { background: linear-gradient(90deg, #d97706, #f59e0b); }

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

.metric-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.metric-icon.purple { background: var(--accent-purple-bg); color: var(--accent-purple); }
.metric-icon.blue { background: var(--accent-blue-bg); color: var(--accent-blue); }
.metric-icon.green { background: var(--accent-green-bg); color: var(--accent-green); }
.metric-icon.amber { background: var(--accent-amber-bg); color: var(--accent-amber); }

.metric-body {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.metric-value {
    font-size: 38px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -1px;
}

.metric-foot {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-pill-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.pill-badge {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--spring-transition);
}

.pill-blue { background: var(--accent-blue-bg); border-color: rgba(37, 99, 235, 0.2); }
.pill-purple { background: var(--accent-purple-bg); border-color: rgba(124, 58, 237, 0.2); }
.pill-green { background: var(--accent-green-bg); border-color: rgba(5, 150, 105, 0.2); }
.pill-red { background: var(--accent-red-bg); border-color: rgba(225, 29, 72, 0.2); }
.pill-completed { background: var(--accent-green-bg); border-color: rgba(5, 150, 105, 0.25); }
.pill-amber { background: var(--accent-amber-bg); border-color: rgba(217, 119, 6, 0.2); }

.pill-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

.pill-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Control Panel */
.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.control-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.control-right {
    flex: 1;
    max-width: 400px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 13px 18px 13px 44px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: var(--spring-transition);
}

.search-box input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.tab-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 9px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: var(--spring-transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: #f1f5f9;
    transform: translateY(-1px);
}

.tab-btn.active {
    background: var(--accent-indigo);
    border-color: var(--accent-indigo);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}

/* Terminal Console Box */
.console-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-elevated);
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
}

.console-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cbd5e1;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dots .dot.red { background-color: #f43f5e; }
.terminal-dots .dot.yellow { background-color: #f59e0b; }
.terminal-dots .dot.green { background-color: #10b981; }

.console-right-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-sm-text {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-sm-text:hover {
    color: #ffffff;
}

.console-status {
    padding: 3px 12px;
    border-radius: 12px;
    background: #334155;
    font-size: 11px;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.5px;
}

.console-logs {
    padding: 16px 20px;
    height: 200px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.8;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #38bdf8;
}

.log-line {
    color: #e2e8f0;
    word-break: break-all;
}

.log-line.text-muted { color: #64748b; }

/* Table Section */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.table-header {
    padding: 18px 26px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    font-size: 17px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.table-count {
    font-size: 12px;
    background: #f1f5f9;
    padding: 5px 14px;
    border-radius: 14px;
    color: var(--text-secondary);
    font-weight: 700;
}

.table-responsive {
    overflow-x: auto;
}

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

.data-table th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 800;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.6px;
}

.data-table td {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: background 0.2s;
}

.data-table tbody tr {
    transition: var(--spring-transition);
}

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

.loading-cell {
    text-align: center;
    padding: 50px !important;
    color: var(--text-muted);
}

/* Badges inside table */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-new { background: var(--accent-blue-bg); color: var(--accent-blue); border: 1px solid rgba(37, 99, 235, 0.25); }
.badge-old { background: var(--accent-purple-bg); color: var(--accent-purple); border: 1px solid rgba(124, 58, 237, 0.25); }
.badge-matched { background: var(--accent-green-bg); color: var(--accent-green); border: 1px solid rgba(5, 150, 105, 0.25); }
.badge-mismatched { background: var(--accent-red-bg); color: var(--accent-red); border: 1px solid rgba(225, 29, 72, 0.25); }
.badge-completed { background: var(--accent-green-bg); color: var(--accent-green); }
.badge-pending { background: var(--accent-amber-bg); color: var(--accent-amber); }

.drive-link {
    color: var(--accent-indigo);
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--spring-transition);
}

.drive-link:hover {
    color: #3730a3;
    transform: translateX(3px);
}
