/* =============================================
   Load Tender - Theme
   Based on Design.jpg color palette
   ============================================= */

:root {
    --primary: #1F6FEB;
    --primary-dark: #1657C6;
    --primary-light: #5B9CF6;
    --primary-bg: #E8F0FE;
    --sidebar-bg: #312E81;
    --sidebar-hover: rgba(255, 255, 255, 0.12);
    --sidebar-active: rgba(255, 255, 255, 0.18);
    --accent-blue: #1F6FEB;
    --accent-green: #10B981;
    --accent-red: #EF4444;
    --accent-orange: #F59E0B;
    --accent-cyan: #06B6D4;
    --accent-pink: #F2AEBA;
    --accent-pink-dark: #E89AA8;

    --bg-main: #F8FAFC;
    --bg-white: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-section: #F1F5F9;

    --border: #E2E8F0;
    --border-light: #F1F5F9;

    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --text-white: #FFFFFF;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius: 8px;
    --radius-lg: 12px;
    --radius-sm: 4px;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: all 0.2s ease;
}

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

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

/* =============================================
   Layout
   ============================================= */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    background-image: url('/IBMDemoBG.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
}

.sidebar-logo h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-logo span {
    font-size: 11px;
    opacity: 0.7;
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    padding: 16px 0;
    flex: 1;
}

.nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    padding: 12px 24px 8px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--text-white);
    border-left-color: var(--accent-cyan);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-red);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-org {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--bg-section);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.top-bar-org .org-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-red);
}

.top-bar-search {
    position: relative;
    width: 320px;
}

.top-bar-search input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    background: var(--bg-section);
    outline: none;
    transition: var(--transition);
}

.top-bar-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.top-bar-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-section);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.top-bar-icon:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.top-bar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.top-bar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* Breadcrumb */
.breadcrumb {
    padding: 16px 32px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover { color: var(--primary); }

.breadcrumb .separator { color: var(--text-muted); }

.breadcrumb .current { color: var(--text-primary); font-weight: 500; }

/* Page content */
.page-content {
    padding: 0 32px 32px;
    flex: 1;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* =============================================
   Cards
   ============================================= */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

/* Section headers like wireframe */
.section-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.section-header.blue {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.section-header.green {
    background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
}

.section-header.orange {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #D97706 100%);
}

.section-header.cyan {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, #0891B2 100%);
}

/* =============================================
   Grid / Table
   ============================================= */
.grid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.grid-search {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.grid-search input {
    width: 100%;
    padding: 9px 16px 9px 40px;
    border: 1.5px solid var(--primary);
    border-radius: 999px;
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
    outline: none;
    transition: var(--transition);
}

.grid-search input::placeholder {
    color: var(--primary);
    opacity: 0.55;
}

.grid-search input:focus {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

.grid-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.grid-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.grid-filter-select,
.grid-page-size {
    padding: 8px 36px 8px 16px;
    border: 1.5px solid var(--primary);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: white;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%231F6FEB' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: var(--transition);
}

.grid-filter-select:focus,
.grid-page-size:focus {
    background-color: var(--primary-bg);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
}

.data-table thead th {
    padding: 14px 18px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: #FFFFFF;
    background: #33404E;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: none;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: var(--transition);
}

.data-table thead th:last-child { border-right: none; }

.data-table thead th:hover {
    background: #3D4A58;
    color: #FFFFFF;
}

.data-table thead th .sort-icon {
    display: inline-block;
    margin-left: 6px;
    color: rgba(255, 255, 255, 0.45);
    opacity: 1;
    font-size: 10px;
}

.data-table thead th.sort-active .sort-icon {
    color: #FFFFFF;
    opacity: 1;
}

.data-table tbody tr {
    border-bottom: 1px solid #EAECEF;
    transition: var(--transition);
    cursor: pointer;
    background: var(--bg-white);
}

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

.data-table tbody td {
    padding: 14px 18px;
    font-size: 13px;
    color: #1F2937;
    white-space: nowrap;
    border-right: 1px solid transparent;
}

.data-table tbody td a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

.data-table tbody td a:hover {
    color: var(--primary-dark);
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.pending {
    background: #FEF3C7;
    color: #92400E;
}
.status-badge.pending::before { background: var(--accent-orange); }

.status-badge.accepted {
    background: #D1FAE5;
    color: #065F46;
}
.status-badge.accepted::before { background: var(--accent-green); }

.status-badge.declined {
    background: #FEE2E2;
    color: #991B1B;
}
.status-badge.declined::before { background: var(--accent-red); }

.status-badge.in-transit {
    background: #DBEAFE;
    color: #1E40AF;
}
.status-badge.in-transit::before { background: #3B82F6; }

.status-badge.delivered {
    background: #D1FAE5;
    color: #065F46;
}
.status-badge.delivered::before { background: var(--accent-green); }

/* Pagination */
.grid-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.grid-pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.grid-pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.grid-pagination-controls button {
    min-width: 32px;
    padding: 6px 10px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
}

.grid-pagination-controls button:hover:not(:disabled) {
    background: var(--primary-bg);
    color: var(--primary);
}

.grid-pagination-controls button.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 700;
}

.grid-pagination-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =============================================
   Buttons
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 26px;
    border: none;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(31, 111, 235, 0.25);
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 14px rgba(31, 111, 235, 0.35);
}

.btn-secondary {
    background: var(--accent-pink);
    color: white;
    box-shadow: 0 4px 10px rgba(242, 174, 186, 0.45);
}
.btn-secondary:hover {
    background: var(--accent-pink-dark);
    box-shadow: 0 6px 14px rgba(232, 154, 168, 0.55);
}

.btn-success {
    background: var(--accent-green);
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}
.btn-success:hover { background: #059669; }

.btn-danger {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover { background: #DC2626; }

.btn-outline {
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    box-shadow: none;
}
.btn-outline:hover {
    background: var(--primary-bg);
    box-shadow: 0 4px 10px rgba(31, 111, 235, 0.18);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(31, 111, 235, 0.2);
}

.btn-lg {
    padding: 12px 32px;
    font-size: 14px;
}

/* =============================================
   Form Elements
   ============================================= */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 18px;
    border: 1.5px solid var(--primary);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    background: white;
    outline: none;
    transition: var(--transition);
}

.form-control::placeholder {
    color: var(--primary);
    opacity: 0.55;
    font-weight: 500;
}

.form-control:focus {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

.form-control[readonly] {
    background: var(--primary-bg);
    color: var(--primary);
}

.form-control.is-filled {
    background: var(--primary-bg);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%231F6FEB' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    border-radius: 20px;
}

/* =============================================
   Detail View Layout
   ============================================= */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.detail-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}

.detail-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 24px;
}

.detail-full {
    grid-column: 1 / -1;
}

.detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.detail-section .section-body {
    padding: 16px 20px;
}

.detail-row {
    display: flex;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    width: 140px;
    flex-shrink: 0;
}

.detail-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Info bar at top of detail */
.info-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.info-bar-item {
    background: var(--bg-white);
    padding: 16px 20px;
}

.info-bar-item .label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.info-bar-item .value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* =============================================
   Stop Section (wireframe style)
   ============================================= */
.stop-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.stop-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stop-header h4 {
    font-size: 14px;
    font-weight: 600;
}

.stop-type-badge {
    display: inline-flex;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stop-type-badge.load { background: #DBEAFE; color: #1E40AF; }
.stop-type-badge.unload { background: #FEF3C7; color: #92400E; }
.stop-type-badge.complete { background: #D1FAE5; color: #065F46; }

.stop-body {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* =============================================
   Timeline / Status Events
   ============================================= */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item.delivered::before { background: var(--accent-green); box-shadow: 0 0 0 2px var(--accent-green); }

.timeline-item .event-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.timeline-item .event-code {
    font-size: 12px;
    font-weight: 700;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.timeline-item .event-desc {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-item .event-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

/* =============================================
   Totals Bar
   ============================================= */
.totals-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 24px;
}

.totals-bar-item {
    background: var(--bg-white);
    padding: 14px 16px;
    text-align: center;
}

.totals-bar-item .label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.totals-bar-item .value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

/* =============================================
   Action Bar
   ============================================= */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    margin-top: 24px;
    background: var(--bg-section);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

/* =============================================
   Tabs
   ============================================= */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}

.tab-item {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    text-decoration: none;
}

.tab-item:hover {
    color: var(--primary);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

/* =============================================
   Lifecycle Status Bar
   ============================================= */
.lifecycle-bar {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.lifecycle-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.lifecycle-step::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: var(--border);
}

.lifecycle-step:last-child::after { display: none; }

.lifecycle-step .step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-section);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.lifecycle-step.completed {
    color: var(--accent-green);
}
.lifecycle-step.completed .step-num {
    background: var(--accent-green);
    color: white;
}

.lifecycle-step.active-step {
    color: var(--primary);
    background: var(--primary-bg);
}
.lifecycle-step.active-step .step-num {
    background: var(--primary);
    color: white;
}

.lifecycle-step.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =============================================
   Modal
   ============================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

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

.modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: 18px; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover { background: var(--bg-section); }

.modal-body { padding: 24px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* =============================================
   Footer
   ============================================= */
.footer {
    padding: 16px 32px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

/* =============================================
   Loading
   ============================================= */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =============================================
   Toast Notification
   ============================================= */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success { background: var(--accent-green); }
.toast.error { background: var(--accent-red); }
.toast.info { background: var(--primary); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 1024px) {
    .sidebar { width: 60px; }
    .sidebar-logo h2, .sidebar-logo span, .nav-item span, .nav-section-title, .nav-badge { display: none; }
    .sidebar-logo { padding: 16px; justify-content: center; }
    .nav-item { padding: 12px; justify-content: center; }
    .main-content { margin-left: 60px; }
    .detail-grid, .detail-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .page-content { padding: 0 16px 16px; }
    .top-bar { padding: 0 16px; }
    .breadcrumb { padding: 12px 16px; }
    .info-bar { grid-template-columns: 1fr 1fr; }
    .detail-grid-4 { grid-template-columns: 1fr 1fr; }
    .grid-toolbar { flex-direction: column; align-items: stretch; }
}
