/* ============================================================
   Camelot Connector — Design System
   Apple-inspired admin with professional polish
   ============================================================ */

/* --- Design Tokens --- */
:root {
    /* Colors */
    --cc-bg: #F5F5F7;
    --cc-surface: #FFFFFF;
    --cc-text: #1D1D1F;
    --cc-text-secondary: #6E6E73;
    --cc-text-tertiary: #86868B;
    --cc-accent: #0071E3;
    --cc-accent-hover: #0077ED;
    --cc-accent-light: #E8F1FD;
    --cc-border: rgba(0, 0, 0, 0.06);
    --cc-border-strong: rgba(0, 0, 0, 0.10);

    /* Semantic tints (background + text pairs) */
    --cc-tint-blue: rgba(0, 113, 227, 0.08);
    --cc-tint-blue-text: #0062CC;
    --cc-tint-green: rgba(52, 199, 89, 0.10);
    --cc-tint-green-text: #248A3D;
    --cc-tint-orange: rgba(255, 149, 0, 0.10);
    --cc-tint-orange-text: #C93400;
    --cc-tint-red: rgba(255, 59, 48, 0.10);
    --cc-tint-red-text: #D70015;
    --cc-tint-purple: rgba(175, 82, 222, 0.10);
    --cc-tint-purple-text: #8944AB;
    --cc-tint-cyan: rgba(50, 173, 230, 0.10);
    --cc-tint-cyan-text: #0071A4;

    /* Shadows */
    --cc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --cc-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --cc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);
    --cc-shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.10);

    /* Radii */
    --cc-radius: 12px;
    --cc-radius-sm: 8px;
    --cc-radius-xs: 6px;
    --cc-radius-pill: 100px;

    /* Spacing (8px grid) */
    --cc-space-1: 4px;
    --cc-space-2: 8px;
    --cc-space-3: 12px;
    --cc-space-4: 16px;
    --cc-space-5: 24px;
    --cc-space-6: 32px;
    --cc-space-8: 48px;

    /* Typography */
    --cc-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --cc-font-mono: "SF Mono", ui-monospace, "Cascadia Code", Menlo, monospace;

    /* Layout */
    --cc-navbar-height: 56px;
}


/* ============================================================
   BASE
   ============================================================ */

body {
    font-family: var(--cc-font);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--cc-text);
    background-color: var(--cc-bg);
    padding-top: var(--cc-navbar-height);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--cc-accent);
    text-decoration: none;
}

a:hover {
    color: var(--cc-accent-hover);
    text-decoration: underline;
}

/* Table links — no underline, they navigate */
.table a {
    text-decoration: none;
}

.table a:hover {
    text-decoration: underline;
}

/* Sidebar & navbar links — never underline */
.sidebar a:hover,
.cc-navbar a:hover {
    text-decoration: none;
}


/* ============================================================
   NAVBAR
   ============================================================ */

.cc-navbar {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--cc-border);
    height: var(--cc-navbar-height);
}

.cc-navbar .navbar-brand {
    color: var(--cc-text);
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cc-navbar .navbar-brand:hover {
    color: var(--cc-text);
    text-decoration: none;
}

.cc-navbar .navbar-brand img {
    height: 36px;
    width: auto;
    flex-shrink: 0;
}

.cc-navbar .navbar-brand svg {
    color: var(--cc-accent);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.cc-navbar .nav-link {
    color: var(--cc-text-secondary);
    font-weight: 500;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--cc-radius-xs);
    transition: color 0.15s ease, background 0.15s ease;
}

.cc-navbar .nav-link:hover {
    color: var(--cc-accent);
    background: var(--cc-tint-blue);
}

.cc-navbar .nav-link svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.cc-navbar .navbar-toggler {
    border-color: var(--cc-border-strong);
    padding: 4px 8px;
}

.cc-navbar .navbar-toggler-icon {
    width: 1.25em;
    height: 1.25em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(29,29,31,0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}


/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    position: fixed;
    top: var(--cc-navbar-height);
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    background: var(--cc-surface);
    border-right: 1px solid var(--cc-border);
    overflow-y: auto;
    box-shadow: none;
}

.sidebar-sticky {
    height: calc(100vh - var(--cc-navbar-height));
    overflow-x: hidden;
    overflow-y: auto;
    padding: var(--cc-space-5) 0;
}

.sidebar .nav-link {
    font-weight: 500;
    color: var(--cc-text-secondary);
    padding: 7px var(--cc-space-4);
    margin: 1px var(--cc-space-3);
    border-radius: var(--cc-radius-sm);
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.12s ease;
    line-height: 1.4;
}

.sidebar .nav-link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.65;
}

.sidebar .nav-link.active {
    color: var(--cc-accent);
    background-color: var(--cc-tint-blue);
    font-weight: 600;
}

.sidebar .nav-link.active svg {
    opacity: 1;
}

.sidebar .nav-link:hover:not(.active) {
    color: var(--cc-text);
    background-color: rgba(0, 0, 0, 0.025);
}

.sidebar .nav-link:hover:not(.active) svg {
    opacity: 0.85;
}

.sidebar-heading {
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    color: var(--cc-text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    padding: 0 var(--cc-space-4);
    margin: var(--cc-space-5) var(--cc-space-3) var(--cc-space-2);
}


/* ============================================================
   PAGE HEADER
   ============================================================ */

.border-bottom {
    border-bottom-color: var(--cc-border) !important;
}

h1.h2, .h2 {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--cc-text);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

/* Badge inside page title */
h1.h2 .badge-pill,
.h2 .badge-pill {
    font-size: 0.6875rem;
    vertical-align: middle;
    position: relative;
    top: -2px;
}


/* ============================================================
   CARDS
   ============================================================ */

.card {
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow);
    background: var(--cc-surface);
    overflow: hidden;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--cc-border);
    padding: var(--cc-space-4) var(--cc-space-5);
}

.card-header h5,
.card-header h6 {
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    color: var(--cc-text);
}

.card-body {
    padding: var(--cc-space-5);
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid var(--cc-border);
    padding: var(--cc-space-3) var(--cc-space-5);
}

/* Card with p-0 body (tables inside) — remove double border */
.card .card-body.p-0 .table {
    margin-bottom: 0;
}

.card .card-body.p-0 .table > :not(caption) > *:last-child > * {
    border-bottom: 0;
}


/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */

.cc-stat-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow);
    padding: var(--cc-space-5);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cc-stat-card:hover {
    box-shadow: var(--cc-shadow-md);
    transform: translateY(-1px);
}

.cc-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--cc-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cc-stat-icon svg {
    width: 22px;
    height: 22px;
}

.cc-stat-icon-blue   { background: var(--cc-tint-blue);   color: var(--cc-tint-blue-text); }
.cc-stat-icon-green  { background: var(--cc-tint-green);  color: var(--cc-tint-green-text); }
.cc-stat-icon-cyan   { background: var(--cc-tint-cyan);   color: var(--cc-tint-cyan-text); }
.cc-stat-icon-orange { background: var(--cc-tint-orange); color: var(--cc-tint-orange-text); }

.cc-stat-label {
    font-size: 0.6875rem;
    color: var(--cc-text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
    line-height: 1.3;
}

.cc-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--cc-text);
    line-height: 1.1;
    letter-spacing: -0.03em;
}


/* ============================================================
   PIPELINE STEPPER (Dashboard)
   ============================================================ */

.cc-pipeline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--cc-space-4) var(--cc-space-4);
    position: relative;
}

.cc-pipeline-connector {
    position: absolute;
    top: calc(var(--cc-space-4) + 22px);
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--cc-border-strong);
    z-index: 0;
}

.cc-pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
    gap: 6px;
}

.cc-pipeline-dot {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    transition: transform 0.15s ease;
    background: var(--cc-surface);
    box-shadow: var(--cc-shadow-sm);
}

.cc-pipeline-step:hover .cc-pipeline-dot {
    transform: scale(1.08);
}

/* Solid opaque backgrounds (tint-on-white baked out) so the
   connector line never bleeds through the dot centre */
.cc-pipeline-dot-blue   { background: #E5F0FB; color: var(--cc-tint-blue-text);   box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.06); }
.cc-pipeline-dot-orange { background: #FFF3E0; color: var(--cc-tint-orange-text); box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.06); }
.cc-pipeline-dot-purple { background: #F3E8FA; color: var(--cc-tint-purple-text); box-shadow: 0 0 0 3px rgba(175, 82, 222, 0.06); }
.cc-pipeline-dot-green  { background: #E8F9ED; color: var(--cc-tint-green-text);  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.06); }
.cc-pipeline-dot-cyan   { background: #E6F4FB; color: var(--cc-tint-cyan-text);   box-shadow: 0 0 0 3px rgba(50, 173, 230, 0.06); }
.cc-pipeline-dot-red    { background: #FFECEB; color: var(--cc-tint-red-text);    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.06); }

.cc-pipeline-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--cc-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}


/* ============================================================
   PILL BADGES
   Critical: must be inline-flex for consistent sizing
   ============================================================ */

.badge-pill {
    display: inline-flex;
    align-items: center;
    border-radius: var(--cc-radius-pill);
    font-weight: 600;
    font-size: 0.6875rem;
    padding: 2px 10px;
    letter-spacing: 0.01em;
    line-height: 1.6;
    white-space: nowrap;
    vertical-align: middle;
}

.badge-success    { background: var(--cc-tint-green);  color: var(--cc-tint-green-text); }
.badge-warning    { background: var(--cc-tint-orange); color: var(--cc-tint-orange-text); }
.badge-danger,
.badge-error      { background: var(--cc-tint-red);    color: var(--cc-tint-red-text); }
.badge-info       { background: var(--cc-tint-cyan);   color: var(--cc-tint-cyan-text); }
.badge-primary,
.badge-accent     { background: var(--cc-tint-blue);   color: var(--cc-tint-blue-text); }
.badge-secondary,
.badge-neutral    { background: rgba(0, 0, 0, 0.05);  color: var(--cc-text-secondary); }


/* ============================================================
   TABLES
   ============================================================ */

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
    font-size: 0.8125rem;
}

.table > :not(caption) > * > * {
    padding: 10px 14px;
    border-bottom: 1px solid var(--cc-border);
    vertical-align: middle;
}

.table > thead > tr > th {
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cc-text-tertiary);
    background: rgba(0, 0, 0, 0.015);
    border-bottom: 1px solid var(--cc-border-strong);
    padding: 10px 14px;
    white-space: nowrap;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(0, 113, 227, 0.02);
}

.table-sm > :not(caption) > * > * {
    padding: 7px 12px;
}

/* Detail tables (th/td pairs) */
.table-sm th {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--cc-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cursor-pointer {
    cursor: pointer;
}


/* ============================================================
   DATATABLES OVERRIDES
   Clean integration with card containers
   ============================================================ */

/* Wrapper padding */
div.dataTables_wrapper {
    padding: 0;
}

div.dataTables_wrapper .row:first-child {
    padding: var(--cc-space-3) var(--cc-space-5);
    align-items: center;
    border-bottom: 1px solid var(--cc-border);
    margin: 0;
    background: rgba(0, 0, 0, 0.01);
}

div.dataTables_wrapper .row:last-child {
    padding: var(--cc-space-3) var(--cc-space-5);
    align-items: center;
    border-top: 1px solid var(--cc-border);
    margin: 0;
}

/* Search input */
div.dataTables_wrapper div.dataTables_filter input {
    border: 1px solid var(--cc-border-strong);
    border-radius: var(--cc-radius-pill);
    padding: 5px 14px;
    font-size: 0.8125rem;
    outline: none;
    margin-left: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

div.dataTables_wrapper div.dataTables_filter input:focus {
    border-color: var(--cc-accent);
    box-shadow: 0 0 0 3px var(--cc-tint-blue);
}

/* Length selector */
div.dataTables_wrapper div.dataTables_length label {
    font-size: 0.75rem;
    color: var(--cc-text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}

div.dataTables_wrapper div.dataTables_length select {
    border: 1px solid var(--cc-border-strong);
    border-radius: var(--cc-radius-xs);
    padding: 3px 8px;
    font-size: 0.8125rem;
}

/* Filter label */
div.dataTables_wrapper div.dataTables_filter label {
    font-size: 0.75rem;
    color: var(--cc-text-tertiary);
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

/* Pagination */
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
    gap: 2px;
    margin-bottom: 0;
}

div.dataTables_wrapper div.dataTables_paginate .page-item .page-link {
    border: none;
    border-radius: var(--cc-radius-xs);
    color: var(--cc-text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    background: transparent;
    min-width: 30px;
    text-align: center;
    line-height: 1.5;
    transition: all 0.12s ease;
}

div.dataTables_wrapper div.dataTables_paginate .page-item .page-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--cc-text);
}

div.dataTables_wrapper div.dataTables_paginate .page-item.active .page-link {
    background: var(--cc-accent);
    color: #fff;
    box-shadow: var(--cc-shadow-sm);
}

div.dataTables_wrapper div.dataTables_paginate .page-item.disabled .page-link {
    color: var(--cc-border-strong);
    background: none;
}

/* Info text */
div.dataTables_wrapper div.dataTables_info {
    font-size: 0.6875rem;
    color: var(--cc-text-tertiary);
    padding-top: 0;
}

/* Sort icons — subtle */
table.dataTable thead .sorting::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting_desc::after {
    opacity: 0.25;
    font-size: 0.5rem;
}

table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    opacity: 0.6;
}

/* Remove DataTables default bottom border on last row when inside card */
.card table.dataTable {
    border-collapse: collapse;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    border-radius: var(--cc-radius-sm);
    font-weight: 500;
    font-size: 0.8125rem;
    padding: 7px 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--cc-accent);
    border-color: var(--cc-accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--cc-accent-hover);
    border-color: var(--cc-accent-hover);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
    color: #fff;
}

.btn-warning {
    background: #FF9500;
    border-color: #FF9500;
    color: #fff;
}

.btn-warning:hover {
    background: #E68600;
    border-color: #E68600;
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.25);
    color: #fff;
}

.btn-outline-primary {
    color: var(--cc-accent);
    border-color: var(--cc-accent);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--cc-accent);
    border-color: var(--cc-accent);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--cc-text-secondary);
    border-color: var(--cc-border-strong);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--cc-border-strong);
    color: var(--cc-text);
}

.btn-outline-danger {
    color: var(--cc-tint-red-text);
    border-color: rgba(255, 59, 48, 0.3);
}

.btn-outline-danger:hover {
    background: var(--cc-tint-red);
    border-color: rgba(255, 59, 48, 0.3);
    color: var(--cc-tint-red-text);
}

.btn-outline-success {
    color: var(--cc-tint-green-text);
    border-color: rgba(52, 199, 89, 0.3);
}

.btn-outline-success:hover {
    background: var(--cc-tint-green);
    border-color: rgba(52, 199, 89, 0.3);
    color: var(--cc-tint-green-text);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: var(--cc-radius-xs);
    gap: 4px;
}

.btn-sm svg {
    width: 13px;
    height: 13px;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: var(--cc-radius-xs);
    border-bottom-left-radius: var(--cc-radius-xs);
}

.btn-group .btn:last-child {
    border-top-right-radius: var(--cc-radius-xs);
    border-bottom-right-radius: var(--cc-radius-xs);
}


/* ============================================================
   FORMS
   ============================================================ */

.form-control,
.form-select {
    border-radius: var(--cc-radius-sm);
    border: 1px solid var(--cc-border-strong);
    font-size: 0.8125rem;
    padding: 7px 12px;
    color: var(--cc-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--cc-accent);
    box-shadow: 0 0 0 3px var(--cc-tint-blue);
}

.form-control:disabled,
.form-select:disabled {
    background: rgba(0, 0, 0, 0.02);
    color: var(--cc-text-secondary);
}

.form-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--cc-text-secondary);
    margin-bottom: var(--cc-space-1);
    letter-spacing: 0.01em;
}

.form-check-input:checked {
    background-color: var(--cc-accent);
    border-color: var(--cc-accent);
}

.form-check-label {
    font-size: 0.8125rem;
}

.form-select-sm {
    padding: 4px 28px 4px 10px;
    font-size: 0.8125rem;
    border-radius: var(--cc-radius-xs);
}


/* ============================================================
   FLASH MESSAGES / ALERTS
   ============================================================ */

.cc-alert {
    border: none;
    border-left: 4px solid;
    border-radius: var(--cc-radius-sm);
    padding: var(--cc-space-3) var(--cc-space-5) var(--cc-space-3) var(--cc-space-4);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: var(--cc-space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: cc-slideIn 0.3s ease;
}

.cc-alert-success { border-left-color: #34C759; background: var(--cc-tint-green); color: var(--cc-tint-green-text); }
.cc-alert-danger  { border-left-color: #FF3B30; background: var(--cc-tint-red);   color: var(--cc-tint-red-text); }
.cc-alert-warning { border-left-color: #FF9500; background: var(--cc-tint-orange); color: var(--cc-tint-orange-text); }
.cc-alert-info    { border-left-color: #32ADE6; background: var(--cc-tint-cyan);   color: var(--cc-tint-cyan-text); }

.cc-alert .btn-close {
    filter: none;
    opacity: 0.4;
    font-size: 0.6rem;
    padding: 10px;
}

.cc-alert .btn-close:hover {
    opacity: 0.7;
}

@keyframes cc-slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cc-alert-fade-out {
    animation: cc-fadeOut 0.3s ease forwards;
}

@keyframes cc-fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-6px); }
}


/* ============================================================
   NAV TABS (XML viewer, etc.)
   ============================================================ */

.nav-tabs {
    border-bottom: 1px solid var(--cc-border);
    gap: 2px;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--cc-text-secondary);
    font-weight: 500;
    font-size: 0.8125rem;
    padding: 8px 16px;
    border-radius: 0;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--cc-text);
    border-bottom-color: var(--cc-border-strong);
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--cc-accent);
    border-bottom-color: var(--cc-accent);
    background: transparent;
    font-weight: 600;
}


/* ============================================================
   CODE & CODE VIEWER
   ============================================================ */

code {
    font-family: var(--cc-font-mono);
    font-size: 0.8em;
    color: var(--cc-accent);
    background: var(--cc-tint-blue);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

pre {
    margin-bottom: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.code-viewer {
    background: #FAFBFC;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-sm);
    padding: var(--cc-space-4);
    font-family: var(--cc-font-mono);
    font-size: 0.75rem;
    color: var(--cc-text);
    max-height: 400px;
    overflow: auto;
    line-height: 1.6;
}

/* Code inside code-viewer shouldn't have extra styling */
.code-viewer code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}


/* ============================================================
   LIST GROUPS (linked stores, etc.)
   ============================================================ */

.list-group-flush .list-group-item {
    border-color: var(--cc-border);
    padding: var(--cc-space-3) var(--cc-space-5);
    font-size: 0.8125rem;
}

.list-group-item-action:hover {
    background: rgba(0, 113, 227, 0.02);
}


/* ============================================================
   FOOTER
   ============================================================ */

.cc-footer {
    border-top: 1px solid var(--cc-border);
    padding: var(--cc-space-5) 0;
    margin-top: var(--cc-space-8);
    text-align: center;
    color: var(--cc-text-tertiary);
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
}


/* ============================================================
   UTILITIES
   ============================================================ */

.w-40 {
    width: 40%;
}

.text-body-secondary,
.text-muted {
    color: var(--cc-text-secondary) !important;
}

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.65; }

/* Icon sizing defaults — Lucide renders at 24x24, we want smaller in most contexts */
svg[data-lucide] {
    width: 16px;
    height: 16px;
}

/* Inline icons in text (address block, badges, etc.) */
address svg,
p svg {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
}

/* Card title icons */
.card-title svg {
    width: 18px;
    height: 18px;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 767.98px) {
    .sidebar {
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--cc-border);
    }

    .sidebar-sticky {
        height: auto;
        padding: var(--cc-space-3) 0;
    }

    .cc-pipeline {
        flex-wrap: wrap;
        gap: var(--cc-space-3);
        padding: var(--cc-space-3);
    }

    .cc-pipeline-connector {
        display: none;
    }

    .cc-pipeline-step {
        flex: 0 0 calc(33.333% - 8px);
    }

    .cc-pipeline-dot {
        width: 38px;
        height: 38px;
        font-size: 0.8125rem;
    }

    div.dataTables_wrapper .row:first-child,
    div.dataTables_wrapper .row:last-child {
        padding: var(--cc-space-3);
    }
}


/* ============================================================
   NAVBAR DROPDOWN (User menu)
   ============================================================ */

.cc-dropdown {
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow-lg);
    padding: var(--cc-space-2) 0;
    min-width: 200px;
    background: var(--cc-surface);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.cc-dropdown .dropdown-item {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--cc-text-secondary);
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.12s ease;
}

.cc-dropdown .dropdown-item:hover {
    background: var(--cc-tint-blue);
    color: var(--cc-accent);
}

.cc-dropdown .dropdown-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.cc-dropdown .dropdown-header {
    padding: 4px 16px;
}

.cc-dropdown .dropdown-divider {
    border-color: var(--cc-border);
    margin: var(--cc-space-1) 0;
}


/* ============================================================
   CHART CONTAINER
   ============================================================ */

.cc-chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}


/* ============================================================
   ORDER TIMELINE (Vertical)
   ============================================================ */

.cc-timeline {
    position: relative;
    padding-left: 28px;
}

.cc-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--cc-border-strong);
    border-radius: 1px;
}

.cc-timeline-step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
}

.cc-timeline-step:first-child { padding-top: 0; }
.cc-timeline-step:last-child  { padding-bottom: 0; }

.cc-timeline-marker {
    position: absolute;
    left: -28px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cc-surface);
    border: 2px solid var(--cc-border-strong);
    z-index: 1;
    flex-shrink: 0;
}

.cc-timeline-marker svg {
    width: 12px;
    height: 12px;
    color: var(--cc-text-tertiary);
}

.cc-timeline-done .cc-timeline-marker {
    background: var(--cc-tint-green);
    border-color: var(--cc-tint-green-text);
}

.cc-timeline-done .cc-timeline-marker svg {
    color: var(--cc-tint-green-text);
}

.cc-timeline-current .cc-timeline-marker {
    background: var(--cc-tint-blue);
    border-color: var(--cc-accent);
    box-shadow: 0 0 0 4px var(--cc-tint-blue);
}

.cc-timeline-current .cc-timeline-marker svg {
    color: var(--cc-accent);
}

.cc-timeline-pending .cc-timeline-marker {
    background: var(--cc-surface);
    border-color: var(--cc-border);
}

.cc-timeline-pending .cc-timeline-marker svg {
    color: var(--cc-border-strong);
}

.cc-timeline-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--cc-text);
    line-height: 1.3;
}

.cc-timeline-pending .cc-timeline-label {
    color: var(--cc-text-tertiary);
}

.cc-timeline-time {
    font-size: 0.6875rem;
    color: var(--cc-text-tertiary);
    margin-top: 1px;
}


/* ============================================================
   CHANNEL CARDS
   ============================================================ */

.cc-channel-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    padding: var(--cc-space-5);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cc-channel-card:hover {
    box-shadow: var(--cc-shadow-md);
    transform: translateY(-1px);
}

.cc-channel-disabled {
    opacity: 0.6;
}

.cc-channel-platform {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--cc-text);
    text-transform: capitalize;
}

.cc-channel-platform svg {
    width: 16px;
    height: 16px;
    color: var(--cc-accent);
}

.cc-channel-name {
    font-size: 0.75rem;
    color: var(--cc-text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-channel-meta {
    font-size: 0.6875rem;
    color: var(--cc-text-tertiary);
    display: flex;
    align-items: center;
}

.cc-channel-meta svg {
    width: 12px;
    height: 12px;
}


/* ============================================================
   SHIPPING RULE BUILDER
   ============================================================ */

.cc-rule-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--cc-border);
    padding: var(--cc-space-3) var(--cc-space-4);
    transition: background 0.12s ease;
    animation: cc-slideIn 0.2s ease;
}

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

.cc-rule-row:hover {
    background: rgba(0, 113, 227, 0.015);
}

.cc-rule-handle {
    cursor: grab;
    padding: 0 var(--cc-space-3) 0 0;
    color: var(--cc-text-tertiary);
    flex-shrink: 0;
}

.cc-rule-handle svg {
    width: 16px;
    height: 16px;
}

.cc-rule-body {
    flex: 1;
    min-width: 0;
}

.cc-rule-keyword {
    font-family: var(--cc-font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--cc-accent);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
