/* ============================================================
   CRM UR — Hoja de estilos principal
   Stack: AdminLTE 3 + Bootstrap 4
   ============================================================ */

/* ─── Variables ─────────────────────────────────────────── */
:root {
    --ur-ink:            #152238;
    --ur-muted:          #667085;
    --ur-line:           #e6eaf0;
    --ur-soft:           #f5f7fb;
    --ur-surface:        #ffffff;
    --ur-primary:        #2563eb;
    --ur-primary-dark:   #1d4ed8;
    --ur-primary-soft:   #eaf1ff;
    --ur-success:        #16a34a;
    --ur-warning:        #f59e0b;
    --ur-danger:         #dc2626;
    --ur-sidebar:        #111827;
    --ur-prospecto:      #7c3aed;
    --ur-gold:           #b45309;
}

/* ─── Base ───────────────────────────────────────────────── */
html,
body {
    color: var(--ur-ink);
    background: var(--ur-soft);
}

body {
    font-size: .94rem;
    letter-spacing: 0;
}

a {
    color: var(--ur-primary);
}

a:hover {
    color: var(--ur-primary-dark);
}

/* ─── Layout ─────────────────────────────────────────────── */
.content-wrapper {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .07), transparent 30rem),
        radial-gradient(circle at bottom right, rgba(124, 58, 237, .04), transparent 28rem),
        linear-gradient(180deg, #f8fafc 0%, var(--ur-soft) 16rem);
}

.content-header {
    padding: 24px 1rem 12px;
}

.content-header h1 {
    color: var(--ur-ink);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0;
}

.breadcrumb {
    background: transparent;
    font-size: .82rem;
    margin-bottom: 0;
}

.container-fluid {
    max-width: 1480px;
}

/* ─── Navbar ─────────────────────────────────────────────── */
.navbar-navy {
    background: rgba(17, 24, 39, .97);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .1);
}

.navbar-search {
    position: relative;
    display: flex;
    align-items: center;
}

.navbar-search input {
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 7px;
    color: #fff;
    font-size: .83rem;
    height: 2rem;
    padding: 0 .75rem 0 2.2rem;
    transition: background .2s, border-color .2s, width .25s;
    width: 210px;
}

.navbar-search input::placeholder {
    color: rgba(255, 255, 255, .4);
}

.navbar-search input:focus {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .3);
    outline: none;
    width: 260px;
}

.navbar-search::before {
    content: "\f002";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: rgba(255, 255, 255, .4);
    font-size: .78rem;
    left: .65rem;
    position: absolute;
    pointer-events: none;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.main-sidebar {
    background: var(--ur-sidebar);
}

.brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
    font-weight: 700;
    letter-spacing: 0;
}

.brand-link .brand-text {
    font-weight: 800 !important;
}

.nav-sidebar .nav-header {
    color: #9ca3af;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .08em;
    padding: 1rem 1rem .45rem;
}

.nav-sidebar .nav-link {
    border-radius: 8px;
    margin: 2px 10px;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover {
    background: var(--ur-primary);
    color: #fff;
}

/* Sidebar badge — Prospectos (purple accent) */
.nav-sidebar .badge-prospecto {
    background: rgba(124, 58, 237, .2);
    border: 1px solid rgba(124, 58, 237, .35);
    border-radius: 999px;
    color: #c4b5fd;
    font-size: .68rem;
    font-weight: 800;
    padding: .18rem .42rem;
}

/* ─── Notification dot ───────────────────────────────────── */
.notif-dot {
    background: var(--ur-danger);
    border: 2px solid rgba(17, 24, 39, .9);
    border-radius: 50%;
    display: inline-block;
    height: 9px;
    position: absolute;
    right: 4px;
    top: 4px;
    width: 9px;
}

/* ─── Cards ──────────────────────────────────────────────── */
.card {
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.card-outline.card-primary,
.card-outline.card-info,
.card-outline.card-secondary,
.card-outline.card-danger {
    border-top: 0;
}

.card-header {
    background: var(--ur-surface);
    border-bottom: 1px solid var(--ur-line);
    border-radius: 8px 8px 0 0 !important;
    min-height: 56px;
    padding: 1rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-title {
    color: var(--ur-ink);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    float: none !important;
    margin-bottom: 0;
}

/* Botones/herramientas SIEMPRE al extremo derecho */
.card-tools {
    margin-left: auto !important;
    margin-right: 0 !important;
    float: none !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.card-body {
    padding: 1.15rem;
}

.card-footer {
    background: #fbfcfe;
    border-top: 1px solid var(--ur-line);
    border-radius: 0 0 8px 8px !important;
    padding: 1rem 1.15rem;
}

/* Cards with left-colored accent border */
.card-accent-primary { border-left: 4px solid var(--ur-primary); }
.card-accent-success  { border-left: 4px solid var(--ur-success); }
.card-accent-warning  { border-left: 4px solid var(--ur-warning); }
.card-accent-danger   { border-left: 4px solid var(--ur-danger); }

/* ─── CRUD card ──────────────────────────────────────────── */
.crud-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.crud-card .card-tools { float: none !important; margin-left: auto !important; }
.crud-card .card-title { float: none !important; }

.section-kicker {
    color: var(--ur-muted);
    display: block;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: .15rem;
}

/* ─── Small boxes (KPI) ──────────────────────────────────── */
.small-box {
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    overflow: hidden;
    position: relative;
}

.small-box .inner {
    padding: 1.15rem;
}

.small-box .inner h3 {
    font-weight: 900;
}

.small-box .icon {
    opacity: .2;
    top: 5px;
}

/* Gradient top-border for KPI small-boxes */
.small-box.kpi-trend::before {
    content: '';
    display: block;
    height: 3px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    background: linear-gradient(90deg, rgba(255,255,255,.65), rgba(255,255,255,.1));
    border-radius: 8px 8px 0 0;
    z-index: 2;
}

/* ─── KPI trend cards ────────────────────────────────────── */
.kpi-card {
    background: var(--ur-surface);
    border: 1px solid var(--ur-line);
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
    padding: 1.1rem 1.2rem;
    position: relative;
}

.kpi-value {
    color: var(--ur-ink);
    display: block;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.kpi-label {
    color: var(--ur-muted);
    font-size: .78rem;
    font-weight: 700;
    margin-top: .25rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.kpi-trend {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: .75rem;
    font-weight: 800;
    gap: .22rem;
    margin-top: .55rem;
    padding: .2rem .5rem;
}

.kpi-trend.up   { background: #dcfce7; color: #166534; }
.kpi-trend.down { background: #fee2e2; color: #991b1b; }

/* ─── Stat ring wrap ─────────────────────────────────────── */
.stat-ring-wrap {
    align-items: center;
    display: flex;
    gap: .65rem;
}

.stat-ring-wrap svg {
    flex-shrink: 0;
    overflow: visible;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
    border-radius: 7px;
    font-weight: 700;
    letter-spacing: 0;
    min-height: 2.15rem;
}

.btn-sm {
    min-height: 1.95rem;
}

.btn-xs {
    border-radius: 6px;
    font-size: .75rem;
    line-height: 1.2;
    min-height: 1.65rem;
    padding: .22rem .48rem;
}

.btn-primary {
    background: var(--ur-primary);
    border-color: var(--ur-primary);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--ur-primary-dark);
    border-color: var(--ur-primary-dark);
}

.btn-default {
    background: #fff;
    border-color: #cbd5e1;
    color: #334155;
}

.btn-outline-primary {
    border-color: #bfdbfe;
    color: var(--ur-primary);
}

.btn-outline-primary:hover {
    background: var(--ur-primary);
    border-color: var(--ur-primary);
}

/* Row action dropdown button */
.btn-row-action {
    background: transparent;
    border: 1px solid var(--ur-line);
    border-radius: 6px;
    color: var(--ur-muted);
    font-size: .78rem;
    line-height: 1;
    padding: .22rem .42rem;
    transition: background .15s, color .15s;
}

.btn-row-action:hover {
    background: #f1f5f9;
    color: var(--ur-ink);
}

.dropdown-menu.dropdown-menu-sm {
    border: 1px solid var(--ur-line);
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .12);
    font-size: .82rem;
    min-width: 150px;
    padding: .3rem 0;
}

.dropdown-menu.dropdown-menu-sm .dropdown-item {
    padding: .4rem .85rem;
}

/* ─── Tables ─────────────────────────────────────────────── */
.table-responsive {
    border: 1px solid var(--ur-line);
    border-radius: 8px;
    overflow: hidden;
}

.table {
    background: var(--ur-surface);
    color: #263445;
    margin-bottom: 0;
}

.table td,
.table th {
    border-top-color: #edf1f7;
    vertical-align: middle;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 1px solid var(--ur-line);
    color: #475467;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .04em;
    padding: .78rem .75rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td {
    padding: .75rem;
}

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

.table a strong,
.table td > a {
    font-weight: 800;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    justify-content: flex-end;
    min-width: 4rem;
}

/* Priority row coloring via data attribute */
tr[data-prioridad="urgente"] {
    border-left: 3px solid var(--ur-danger);
}

tr[data-prioridad="alta"] {
    border-left: 3px solid #f97316;
}

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    padding: .32rem .52rem;
}

.badge:empty {
    border-radius: 999px;
    display: inline-block;
    height: .65rem;
    min-width: .65rem;
    padding: 0;
}

.badge-success   { background: #dcfce7; color: #166534; }
.badge-info      { background: #e0f2fe; color: #075985; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #e5e7eb; color: #374151; }

/* ─── Priority badges ────────────────────────────────────── */
.prioridad-baja {
    background: #e5e7eb; color: #374151;
    border-radius: 999px; font-size: .72rem; font-weight: 800;
    padding: .3rem .55rem; display: inline-block;
}
.prioridad-media {
    background: #dbeafe; color: #1e40af;
    border-radius: 999px; font-size: .72rem; font-weight: 800;
    padding: .3rem .55rem; display: inline-block;
}
.prioridad-alta {
    background: #ffedd5; color: #9a3412;
    border-radius: 999px; font-size: .72rem; font-weight: 800;
    padding: .3rem .55rem; display: inline-block;
}
.prioridad-urgente {
    background: #fee2e2; color: #991b1b;
    border-radius: 999px; font-size: .72rem; font-weight: 800;
    padding: .3rem .55rem; display: inline-block;
}

/* ─── Prospecto status pills ─────────────────────────────── */
.prospecto-nuevo {
    background: #ede9fe; color: #5b21b6;
    border-radius: 999px; font-size: .72rem; font-weight: 800;
    padding: .3rem .6rem; display: inline-block;
}
.prospecto-contactado {
    background: #e0f2fe; color: #0369a1;
    border-radius: 999px; font-size: .72rem; font-weight: 800;
    padding: .3rem .6rem; display: inline-block;
}
.prospecto-en_propuesta {
    background: #fef9c3; color: #854d0e;
    border-radius: 999px; font-size: .72rem; font-weight: 800;
    padding: .3rem .6rem; display: inline-block;
}
.prospecto-convertido {
    background: #dcfce7; color: #166534;
    border-radius: 999px; font-size: .72rem; font-weight: 800;
    padding: .3rem .6rem; display: inline-block;
}
.prospecto-perdido {
    background: #fee2e2; color: #991b1b;
    border-radius: 999px; font-size: .72rem; font-weight: 800;
    padding: .3rem .6rem; display: inline-block;
}

/* ─── Avatar initials ────────────────────────────────────── */
.avatar-sm,
.avatar-md {
    align-items: center;
    border-radius: 50%;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    letter-spacing: 0;
    text-transform: uppercase;
    flex-shrink: 0;
}

.avatar-sm { font-size: .65rem; height: 28px; width: 28px; }
.avatar-md { font-size: .75rem; height: 36px; width: 36px; }

.avatar-sm:nth-child(1),   .avatar-md:nth-child(1)   { background: #dbeafe; color: #1e40af; }
.avatar-sm:nth-child(2),   .avatar-md:nth-child(2)   { background: #dcfce7; color: #166534; }
.avatar-sm:nth-child(3),   .avatar-md:nth-child(3)   { background: #fce7f3; color: #9d174d; }
.avatar-sm:nth-child(4),   .avatar-md:nth-child(4)   { background: #ede9fe; color: #5b21b6; }
.avatar-sm:nth-child(5),   .avatar-md:nth-child(5)   { background: #fef3c7; color: #92400e; }
.avatar-sm:nth-child(6),   .avatar-md:nth-child(6)   { background: #fee2e2; color: #991b1b; }
.avatar-sm:nth-child(7),   .avatar-md:nth-child(7)   { background: #e0f2fe; color: #075985; }
.avatar-sm:nth-child(8),   .avatar-md:nth-child(8)   { background: #f0fdf4; color: #14532d; }
.avatar-sm:nth-child(n+9), .avatar-md:nth-child(n+9) { background: #f1f5f9; color: #334155; }

/* ─── Stage progress stepper ─────────────────────────────── */
.stage-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    margin-bottom: 1.5rem;
}

.stage-step {
    align-items: center;
    display: flex;
    flex: 1;
    flex-direction: column;
    position: relative;
    text-align: center;
}

.stage-step::before {
    background: var(--ur-line);
    content: '';
    height: 2px;
    left: -50%;
    position: absolute;
    top: 16px;
    width: 100%;
    z-index: 0;
}

.stage-step:first-child::before {
    display: none;
}

.stage-step .step-circle {
    align-items: center;
    background: #e5e7eb;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    color: #9ca3af;
    display: flex;
    font-size: .72rem;
    font-weight: 900;
    height: 32px;
    justify-content: center;
    position: relative;
    width: 32px;
    z-index: 1;
    transition: background .2s, border-color .2s;
}

.stage-step .step-label {
    color: var(--ur-muted);
    font-size: .72rem;
    font-weight: 700;
    margin-top: .4rem;
    white-space: nowrap;
}

.stage-step.done .step-circle {
    background: var(--ur-primary-soft);
    border-color: var(--ur-primary);
    color: var(--ur-primary);
}

.stage-step.done::before {
    background: var(--ur-primary);
}

.stage-step.active .step-circle {
    background: var(--ur-primary);
    border-color: var(--ur-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
    color: #fff;
}

.stage-step.active .step-label {
    color: var(--ur-primary);
    font-weight: 900;
}

.stage-step.active ~ .stage-step .step-circle {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #cbd5e1;
}

/* ─── Kanban board ───────────────────────────────────────── */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

.kanban-col {
    background: #f8fafc;
    border: 1px solid var(--ur-line);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-width: 230px;
    max-width: 260px;
    padding: 0 0 .75rem;
}

.kanban-col-header {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid var(--ur-line);
    border-radius: 10px 10px 0 0;
    display: flex;
    font-size: .78rem;
    font-weight: 800;
    gap: .5rem;
    justify-content: space-between;
    padding: .75rem 1rem;
    position: sticky;
    top: 0;
}

.kanban-col-header .col-count {
    background: #e5e7eb;
    border-radius: 999px;
    color: #374151;
    font-size: .68rem;
    font-weight: 800;
    padding: .15rem .45rem;
}

.kanban-card {
    background: var(--ur-surface);
    border: 1px solid var(--ur-line);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .05);
    cursor: pointer;
    margin: .55rem .65rem 0;
    padding: .75rem .85rem;
    transition: box-shadow .15s, transform .15s;
}

.kanban-card:hover {
    box-shadow: 0 8px 22px rgba(15, 23, 42, .1);
    transform: translateY(-1px);
}

.kanban-card .kc-title {
    color: var(--ur-ink);
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: .35rem;
}

.kanban-card .kc-meta {
    color: var(--ur-muted);
    font-size: .72rem;
}

/* ─── Timeline ───────────────────────────────────────────── */
.timeline-body {
    white-space: normal;
}

.timeline-entry {
    margin-bottom: 1.25rem;
    padding-left: 52px;
    position: relative;
}

.timeline-avatar {
    align-items: center;
    background: var(--ur-primary-soft);
    border: 2px solid var(--ur-primary);
    border-radius: 50%;
    color: var(--ur-primary);
    display: flex;
    font-size: .75rem;
    font-weight: 900;
    height: 36px;
    justify-content: center;
    left: 0;
    position: absolute;
    top: 0;
    width: 36px;
}

/* ─── Activity feed ──────────────────────────────────────── */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.activity-item {
    align-items: flex-start;
    display: flex;
    gap: .75rem;
}

.activity-icon {
    align-items: center;
    background: var(--ur-primary-soft);
    border-radius: 50%;
    color: var(--ur-primary);
    display: flex;
    flex-shrink: 0;
    font-size: .78rem;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.activity-text {
    color: var(--ur-ink);
    font-size: .83rem;
    line-height: 1.45;
    margin-top: .1rem;
}

.activity-text strong {
    font-weight: 800;
}

.activity-time {
    color: var(--ur-muted);
    font-size: .72rem;
    margin-top: .2rem;
    white-space: nowrap;
}

/* ─── Document progress bar ──────────────────────────────── */
.doc-progress {
    background: #e5e7eb;
    border-radius: 999px;
    height: 5px;
    overflow: hidden;
    width: 80px;
}

.doc-progress .doc-progress-bar {
    background: linear-gradient(90deg, var(--ur-primary), #60a5fa);
    border-radius: 999px;
    height: 100%;
    transition: width .4s ease;
}

/* ─── Empty state ────────────────────────────────────────── */
.empty-state {
    align-items: center;
    display: flex;
    flex-direction: column;
    padding: 3.5rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    align-items: center;
    background: var(--ur-soft);
    border: 2px dashed var(--ur-line);
    border-radius: 50%;
    color: #cbd5e1;
    display: flex;
    font-size: 2rem;
    height: 80px;
    justify-content: center;
    margin-bottom: 1.1rem;
    width: 80px;
}

.empty-state-title {
    color: var(--ur-ink);
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: .35rem;
}

.empty-state-text {
    color: var(--ur-muted);
    font-size: .85rem;
    max-width: 360px;
}

/* ─── Flash / Alert messages ─────────────────────────────── */
.alert {
    border: none;
    border-left: 4px solid transparent;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .07);
    font-size: .87rem;
    font-weight: 600;
    padding: .85rem 1rem;
}

.alert-success {
    background: #f0fdf4;
    border-left-color: var(--ur-success);
    color: #14532d;
}

.alert-danger {
    background: #fff1f2;
    border-left-color: var(--ur-danger);
    color: #7f1d1d;
}

.alert-warning {
    background: #fffbeb;
    border-left-color: var(--ur-warning);
    color: #78350f;
}

.alert-info {
    background: #f0f9ff;
    border-left-color: #0284c7;
    color: #0c4a6e;
}

/* ─── Filter bar ─────────────────────────────────────────── */
.filter-bar {
    align-items: stretch;
    background: #f8fafc;
    border: 1px solid var(--ur-line);
    border-radius: 8px;
    margin: 0 0 1rem;
    padding: .85rem;
}

.filter-bar .form-control,
.filter-bar .btn {
    height: 2.35rem;
}

/* ─── Forms ──────────────────────────────────────────────── */
.form-shell {
    max-width: 1040px;
}

.form-shell .card-body {
    padding: 1.25rem;
}

.form-group label,
.catalog-inline-form label {
    color: #344054;
    font-size: .78rem;
    font-weight: 800;
    margin-bottom: .38rem;
}

.form-control {
    border-color: #d8dee8;
    border-radius: 7px;
    color: var(--ur-ink);
    min-height: 2.55rem;
}

.form-control-sm {
    border-radius: 6px;
    min-height: 2.1rem;
}

.form-control:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12);
}

textarea.form-control {
    min-height: 7rem;
}

.help-text,
.form-text,
.form-group small,
.text-muted {
    color: var(--ur-muted) !important;
}

.required-dot {
    color: var(--ur-danger);
    font-weight: 900;
}

.form-panel-aside {
    background: #f8fafc;
    border: 1px solid var(--ur-line);
    border-radius: 8px;
    padding: 1rem;
}

.form-control-file {
    display: inline-block;
}

/* ─── Callouts ───────────────────────────────────────────── */
.callout {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .05);
    margin-bottom: .75rem;
}

.callout h5 {
    font-weight: 800;
}

/* ─── DataTables ─────────────────────────────────────────── */
.dataTables_wrapper .row:first-child,
.dataTables_wrapper .row:last-child {
    align-items: center;
    margin-left: 0;
    margin-right: 0;
}

.dataTables_wrapper .row:first-child {
    background: #f8fafc;
    border: 1px solid var(--ur-line);
    border-radius: 8px;
    margin-bottom: .75rem;
    padding: .55rem .35rem;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_info {
    color: var(--ur-muted);
    font-size: .82rem;
    font-weight: 700;
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #d8dee8;
    border-radius: 7px;
    min-height: 2rem;
}

/* ─── Pagination ─────────────────────────────────────────── */
.page-item .page-link {
    border-color: var(--ur-line);
    color: #344054;
    font-weight: 700;
}

.page-item.active .page-link {
    background: var(--ur-primary);
    border-color: var(--ur-primary);
}

/* ─── Catalog inline form ────────────────────────────────── */
.catalog-inline-form {
    align-items: center;
    background: #fff;
    border: 1px solid var(--ur-line);
    border-radius: 8px;
    gap: .55rem;
    margin-bottom: .65rem;
    padding: .75rem;
}

.catalog-inline-form .col,
.catalog-inline-form .col-auto {
    padding-left: .25rem;
    padding-right: .25rem;
}

/* ─── Catalog modal ──────────────────────────────────────── */
.catalog-modal {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}

.catalog-modal .modal-header,
.catalog-modal .modal-footer {
    border-color: var(--ur-line);
}

.catalog-modal .modal-title {
    color: var(--ur-ink);
    font-weight: 800;
}

.catalog-modal .modal-body {
    background: #fbfcfe;
    padding: 1.2rem;
}

/* ─── List group ─────────────────────────────────────────── */
.list-group-item {
    border-color: var(--ur-line);
    padding: 1rem 1.15rem;
}

.list-group-item.bg-light {
    background: #f8fbff !important;
}

/* ─── Login ──────────────────────────────────────────────── */
.login-logo a {
    color: var(--ur-primary);
}

/* ─── Select2 overrides ──────────────────────────────────── */
.select2-container--bootstrap4 .select2-selection {
    border-color: #d8dee8;
    border-radius: 7px;
    min-height: 2.55rem;
}

.select2-container--bootstrap4 .select2-selection:focus,
.select2-container--bootstrap4.select2-container--focus .select2-selection {
    border-color: #93c5fd;
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12);
}

.select2-container--bootstrap4 .select2-results__option--highlighted {
    background: var(--ur-primary);
}

/* ─── Responsive: tablet ─────────────────────────────────── */
@media (max-width: 991.98px) {
    .kanban-col {
        min-width: 210px;
    }

    .stage-step .step-label {
        display: none;
    }
}

/* ─── Responsive: mobile ─────────────────────────────────── */
@media (max-width: 767.98px) {
    .content-header {
        padding-top: 18px;
    }

    .content-header h1 {
        font-size: 1.3rem;
    }

    .crud-card .card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .card-tools,
    .card-tools .btn {
        width: 100%;
    }

    .filter-bar {
        padding-bottom: .55rem;
    }

    .catalog-inline-form {
        display: block;
    }

    .catalog-inline-form .col,
    .catalog-inline-form .col-auto {
        margin-bottom: .55rem;
        padding-left: 0;
        padding-right: 0;
        width: 100%;
    }

    .table-responsive {
        border-radius: 6px;
        font-size: .82rem;
    }

    .table thead th {
        font-size: .68rem;
        padding: .6rem .5rem;
    }

    .table tbody td {
        padding: .55rem .5rem;
    }

    .kpi-card {
        padding: .85rem;
    }

    .kpi-value {
        font-size: 1.6rem;
    }

    .doc-progress {
        width: 56px;
    }

    .stage-stepper {
        overflow-x: auto;
        padding-bottom: .5rem;
    }

    .stage-step {
        min-width: 70px;
    }

    .navbar-search {
        display: none;
    }
}

/* ─── Print styles ───────────────────────────────────────── */
@media print {
    .main-sidebar,
    .main-navbar,
    .navbar-navy,
    .main-footer,
    .content-header,
    .btn,
    .table-actions,
    .card-tools,
    .filter-bar,
    .breadcrumb {
        display: none !important;
    }

    .content-wrapper {
        background: #fff !important;
        margin-left: 0 !important;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }

    body {
        font-size: 11pt;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    .table thead th {
        background: #f0f0f0 !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
