﻿:root {
    --primary: #00C4B4;
    --sidebar-bg: #1E1E2D;
    --bg-light: #f5f7fb;
    --card-radius: 12px;
}

/* Reset */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    background: var(--bg-light);
}

/* Layout */
.sidebar {
    width: 240px;
    position: fixed;
    height: 100vh;
    background: var(--sidebar-bg);
}

.content {
    margin-left: 240px;
    padding: 20px;
}

/* Top row (filters + create job + metrics) */
.top-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.top-row .left {
    display: flex;
    gap: 10px;
}

.top-row .right {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

/* Metrics */
.metrics {
    display: flex;
    gap: 14px;
    margin: 16px 0;
}

.metric {
    flex: 1;
    padding: 16px;
    border-radius: var(--card-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.metric .meta h6 {
    margin: 0;
    opacity: .85;
    font-size: .9rem;
}

.metric .meta h3 {
    margin: 6px 0 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.metric .icon {
    font-size: 28px;
}

/* Metric colors */
.metric.total {
    background: #2B7BFF;
}

.metric.running {
    background: #00C4B4;
}

.metric.completed {
    background: #FF6B6B;
}

.metric.delayed {
    background: #2F3137;
}

/* ---------- MAIN GRID (MAP + RUNNING + RIGHT PANEL) ---------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 5.5fr 2.5fr 2fr;
    grid-template-rows: auto auto;
    /* Row 1 = map+running, Row 2 = table */
    gap: 18px;
}

/* Grid placement */
.map-area {
    grid-column: 1;
    grid-row: 1;
}

.running-area {
    grid-column: 2;
    grid-row: 1;
}

.right-panel {
    grid-column: 3;
    grid-row: 1 / span 2;
    /* ← KEY: spans from running jobs down through table */
    background: #fff;
    border-radius: var(--card-radius);
    padding: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

/* Map */
.map-card {
    background: #fff;
    padding: 12px;
    border-radius: var(--card-radius);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    height: 420px;
    /* Fixed height to match running jobs */
}

.map-placeholder {
    height: 420px;
    background: #eaf0f7;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-weight: 600;
}

/* Running Jobs List */
.running-card {
    background: #fff;
    padding: 10px;
    border-radius: var(--card-radius);
    height: 420px;
    overflow-y: auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.running-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
}

.running-item:hover {
    background: #f3fffb;
}

/* Job Details Table */
.job-table-card {
    grid-column: 1 / span 2;
    /* spans map + running columns */
    background: #fff;
    padding: 14px;
    border-radius: var(--card-radius);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.job-table th,
.job-table td {
    white-space: nowrap;
    padding: 10px;
}

/* Status badges */
.badge-in {
    background: #e8fff8;
    color: #099e86;
    padding: 6px 10px;
    border-radius: 16px;
}

.badge-del {
    background: #ffeaea;
    color: #c0392b;
    padding: 6px 10px;
    border-radius: 16px;
}

.badge-com {
    background: #eef4ff;
    color: #0d6efd;
    padding: 6px 10px;
    border-radius: 16px;
}

.job-container .card {
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    background: #fff;
}

.drop-table td,
.drop-table th {
    vertical-align: middle;
}

.sidebar-container {
    padding: 20px;
    text-align: center;
    /* centers everything */
}

.sidebar-logo {
    width: 140px;
    margin: 0 auto 12px;
    display: block;
}

.sidebar-title {
    color: #00C4B4;
    font-size: .9rem;
}

.metric .meta h3 {
    margin: 6px 0 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.metric .icon {
    font-size: 28px;
}

/* Metric colors */
.metric.total {
    background: #2B7BFF;
}

.metric.running {
    background: #00C4B4;
}

.metric.completed {
    background: #FF6B6B;
}

.metric.delayed {
    background: #2F3137;
}

/* ---------- MAIN GRID (MAP + RUNNING + RIGHT PANEL) ---------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 55% 25% 20%;
    grid-template-rows: auto auto;
    /* Row 1 = map+running, Row 2 = table */
    gap: 18px;
}

/* Grid placement */
.map-area {
    grid-column: 1;
    grid-row: 1;
}

.running-area {
    grid-column: 2;
    grid-row: 1;
}

.right-panel {
    grid-column: 3;
    grid-row: 1 / span 2;
    /* ← KEY: spans from running jobs down through table */
    background: #fff;
    border-radius: var(--card-radius);
    padding: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

/* Map */
.map-card {
    background: #fff;
    padding: 12px;
    border-radius: var(--card-radius);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    height: 420px;
    /* Fixed height to match running jobs */
}

.map-placeholder {
    height: 420px;
    background: #eaf0f7;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-weight: 600;
}

/* Running Jobs List */
.running-card {
    background: #fff;
    padding: 10px;
    border-radius: var(--card-radius);
    height: 420px;
    overflow-y: auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.running-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
}

.running-item:hover {
    background: #f3fffb;
}

/* Job Details Table */
.job-table-card {
    grid-column: 1 / span 2;
    /* spans map + running columns */
    background: #fff;
    padding: 14px;
    border-radius: var(--card-radius);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.job-table th,
.job-table td {
    white-space: nowrap;
    padding: 10px;
}

/* Status badges */
.badge-in {
    background: #e8fff8;
    color: #099e86;
    padding: 6px 10px;
    border-radius: 16px;
}

.badge-del {
    background: #ffeaea;
    color: #c0392b;
    padding: 6px 10px;
    border-radius: 16px;
}

.badge-com {
    background: #eef4ff;
    color: #0d6efd;
    padding: 6px 10px;
    border-radius: 16px;
}

.job-container .card {
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    background: #fff;
}

.drop-table td,
.drop-table th {
    vertical-align: middle;
}

.sidebar-container {
    padding: 20px;
    text-align: center;
    /* centers everything */
}

.sidebar-logo {
    width: 140px;
    margin: 0 auto 12px;
    display: block;
}

.sidebar-title {
    color: #00C4B4;
    font-weight: 700;
    text-align: center;
    margin-bottom: 14px;
}

.sidebar-menu .nav-link {
    color: #ffffff !important;
    /* white text */
    font-weight: 600;
    /* bold */
    padding: 10px 15px;
    /* spacing */
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* center link + icon */
    gap: 8px;
    /* space between icon + text */
}

.sidebar-menu .nav-link:hover,
.sidebar-menu .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

.sidebar-menu .nav-link i {
    font-size: 1.2rem;
    margin-right: 10px;
}

/* Validation Styles */
.input-validation-error {
    border-color: #dc3545 !important;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5zM6 8.2a.3.3 0 000 .6.3.3 0 000-.6z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.input-validation-error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important;
}

.field-validation-error {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

/* DASHBOARD REDESIGN (New Job Card) */
.job-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
    border-left: 5px solid #ffa500;
    /* Default amber border or dynamic based on status */
}

.job-card:hover {
    border-color: #aaa;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.job-card.status-active {
    border-left-color: #ffa500;
}

.job-card.status-green {
    border-left-color: #28a745;
}

.job-card.status-red {
    border-left-color: #dc3545;
}

/* Header: From/To/Status */
.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.job-info-grid {
    display: grid;
    grid-template-columns: 50px 1fr 60px 1fr;
    /* Label Value Label Value */
    column-gap: 5px;
    row-gap: 4px;
    font-size: 0.85rem;
    color: #333;
    align-items: baseline;
}

.job-info-label {
    font-weight: 600;
    color: #cc6600;
    /* dark orange/brownish based on image */
}

.job-info-value {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-badge-new {
    display: inline-block;
    padding: 6px 14px;
    /* Slightly larger padding */
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    text-align: center;
    color: #fff;
    min-width: 100px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge-green {
    background: #28a745;
    /* Solid Green (Completed) */
    color: #fff;
    border: none;
}

.badge-active {
    background: #ffc107;
    /* Solid Amber (Running) */
    color: #000;
}

.badge-gray {
    background: #aeb9cc;
    /* Solid Gray */
    color: #fff;
}

.badge-delayed {
    background: #ff6b6b;
    /* Solid Light Red (Delayed) */
    color: #fff;
}

/* Legacy .badge-amber kept just in case but ideally unused for delayed now */
.badge-amber {
    background: #ffc107;
    /* Solid Amber */
    color: #000;
    /* Dark text for readability on yellow */
}

/* Timeline Visual */
.timeline-visual {
    display: flex;
    align-items: center;
    margin-top: 15px;
    margin-bottom: 5px;
    position: relative;
    padding: 0 10px;
}

.timeline-line {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    position: relative;
    margin: 0 10px;
    border-radius: 2px;
}

.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #dc3545;
    /* Red progress line as seen in image bottom cards, or green for others */
    width: 0%;
    border-radius: 2px;
}

.timeline-progress.green {
    background: #28a745;
}

.timeline-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.timeline-start-icon {
    /* Wheel SVG or similar */
    width: 24px;
    height: 24px;
    background: #fff;
    border: 2px solid #555;
    border-radius: 50%;
}

.timeline-end-icon {
    width: 12px;
    height: 12px;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 50%;
}

.timeline-current-icon {
    position: absolute;
    top: -12px;
    /* left provided inline */
    width: 28px;
    height: 28px;
    /* Steering wheel icon placeholder */
    background: #fff;
    border-radius: 50%;
    border: 2px solid #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc3545;
    font-weight: bold;
}

.timeline-step-dot {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #e0e0e0;
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 0 1px #ccc;
}

.timeline-step-dot.active {
    background: #28a745;
    /* Green when passed */
    box-shadow: 0 0 0 1px #28a745;
}


/* Status Text Colors (used in Tables and Job Drops) */
.status-completed {
    color: #28a745;
    font-weight: 600;
}

.status-running {
    color: #28a745;
    font-weight: 600;
}

/* Running is Green per request */
.status-delayed {
    color: #dc3545;
    font-weight: 600;
}

/* Delayed red/amber */
.status-pending {
    color: #6c757d;
    font-weight: 600;
}

.status-default {
    color: #333;
}

/* Status Badge overrides if needed */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
}

/* Refresh Control Styling */
.refresh-control {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 4px 8px;
    gap: 8px;
    transition: border-color 0.2s;
}

.refresh-control:hover {
    border-color: var(--primary);
}

.refresh-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

.refresh-select {
    border: none;
    background: transparent;
    font-size: 0.85rem;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    padding-right: 2px;
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.chat-header {
    background: var(--primary);
    color: white;
    padding: 12px 15px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.chat-body {
    height: 350px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-message.me {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-message.other {
    align-self: flex-start;
    background: #e9ecef;
    color: #333;
    border-bottom-left-radius: 2px;
}

.chat-message .sender {
    font-size: 0.7em;
    opacity: 0.8;
    margin-bottom: 2px;
}

.chat-input-area {
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fff;
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 12px;
    outline: none;
    font-size: 0.9rem;
}

.chat-input:focus {
    border-color: var(--primary);
}

.chat-send-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-send-btn:disabled {
    background: #ccc;
}
.sticky-header-custom {
    z-index: 999;
    margin-top: -1.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
}
