/* =============================================================================
   DETAIL KINGS - DESIGN SYSTEM & STYLESHEET
   Aesthetics: Luxury Automotive Dark Theme (Charcoal, Amber Gold & Slate)
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --bg-main: #0B0E14;
    --bg-card: #151A23;
    --bg-card-hover: #1C2330;
    --bg-sidebar: #0E121A;
    --bg-input: #121722;
    --border-color: #242D3D;
    --border-focus: #F59E0B;

    /* Gold / Amber Accents (Detail Kings) */
    --gold-primary: #F59E0B;
    --gold-hover: #D97706;
    --gold-glow: rgba(245, 158, 11, 0.25);
    --gold-subtle: rgba(245, 158, 11, 0.1);

    /* Accents */
    --cyan-accent: #06B6D4;
    --cyan-subtle: rgba(6, 182, 212, 0.12);
    --blue-accent: #3B82F6;

    /* Semantic States */
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.12);

    /* Typography Colors */
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --text-subtle: #6B7280;
    --text-gold: #FBBF24;

    /* Layout & Dimensions */
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
    --shadow-gold: 0 4px 24px 0 rgba(245, 158, 11, 0.25);
}

html[data-theme="light"],
:root[data-theme="light"] {
    --bg-main: #F1F5F9;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8FAFC;
    --bg-sidebar: #FFFFFF;
    --bg-input: #FFFFFF;
    --border-color: #E2E8F0;
    --border-focus: #F59E0B;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --text-subtle: #94A3B8;
    --text-gold: #B45309;
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
}

/* Reset & Base Elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    caret-color: transparent;
}

/* Permitir cursor de escritura EXCLUSIVAMENTE en campos de texto editables */
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]),
textarea,
[contenteditable="true"],
[contenteditable=""] {
    caret-color: var(--gold-primary, #F59E0B) !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    cursor: text !important;
}

/* Deshabilitar selección de texto, cursores de inserción y activar cursor pointer en botones y elementos interactivos */
button,
.btn,
.cat-card,
.cat-card *,
.wizard-step-item,
.wizard-step-item *,
.nav-link,
.nav-item,
.sidebar-link,
.btn-filtro-cat,
.btn-action-srv,
.btn-preset,
.badge,
.badge-placa,
.tarifa-badge,
.form-check,
.form-check-label,
.form-switch,
.metric-card,
.card-header,
.modal-header,
.dropdown-item,
label,
a {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    caret-color: transparent !important;
}

button,
.btn,
.cat-card,
.wizard-step-item,
.nav-link,
.btn-filtro-cat,
.btn-action-srv,
.btn-preset,
.badge-placa,
.tarifa-badge,
.form-check-input,
.form-check-label,
a,
label[for] {
    cursor: pointer !important;
}

.cat-card *,
.btn *,
.wizard-step-item * {
    cursor: inherit;
    pointer-events: none;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Scrollbar Custom */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* =============================================================================
   LAYOUT STRUCTURE
   ============================================================================= */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.brand-icon,
.brand-logo-container {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.18) 0%, rgba(6, 14, 26, 0.9) 100%);
    border: 1.5px solid rgba(212, 175, 55, 0.45);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 10px rgba(212, 175, 55, 0.2);
    flex-shrink: 0;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.brand-icon:hover,
.brand-logo-container:hover {
    transform: scale(1.08);
    border-color: var(--gold-primary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 14px rgba(212, 175, 55, 0.4);
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.2;
}
.brand-title span {
    color: var(--gold-primary);
    font-weight: 400;
    font-size: 0.8rem;
    display: block;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-subtle);
    padding: 10px 14px 4px;
    letter-spacing: 1px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.nav-link.active {
    color: var(--gold-primary);
    background: var(--gold-subtle);
    font-weight: 600;
    border-left: 3px solid var(--gold-primary);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-snippet {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--bg-card-hover);
    border: 1px solid var(--gold-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--gold-primary);
    font-size: 0.85rem;
}

.user-info {
    flex: 1;
    overflow: hidden;
}
.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role-badge {
    font-size: 0.68rem;
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--gold-subtle);
    color: var(--gold-primary);
    font-weight: 600;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background-color: rgba(14, 18, 26, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

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

.page-title {
    font-size: 1.3rem;
    font-weight: 700;
}

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

.content-container {
    padding: 32px;
    flex: 1;
    max-width: 1540px;
    width: 100%;
    margin: 0 auto;
}

/* =============================================================================
   BUTTONS & ACTIONS
   ============================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-hover));
    color: #000;
    box-shadow: var(--shadow-gold);
}
.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-subtle);
}

.btn-success {
    background: var(--success);
    color: #000;
    font-weight: 700;
}
.btn-success:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-whatsapp {
    background: #25D366;
    color: #000;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.25);
}
.btn-whatsapp:hover {
    background: #20BA5A;
    color: #000;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}
.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

/* =============================================================================
   CARDS & CONTAINERS
   ============================================================================= */

.card {
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.card:hover {
    border-color: rgba(245, 158, 11, 0.2);
}

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

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 24px;
}

/* Metric / KPI Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.metric-card {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gold-primary);
}

.metric-card.success::before { background: var(--success); }
.metric-card.danger::before { background: var(--danger); }
.metric-card.cyan::before { background: var(--cyan-accent); }

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--gold-subtle);
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.metric-card.success .metric-icon {
    background: var(--success-bg);
    color: var(--success);
}
.metric-card.danger .metric-icon {
    background: var(--danger-bg);
    color: var(--danger);
}
.metric-card.cyan .metric-icon {
    background: var(--cyan-subtle);
    color: var(--cyan-accent);
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.7rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    line-height: 1.2;
    color: #fff;
}

/* =============================================================================
   FORM CONTROLS & INPUTS
   ============================================================================= */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.form-label span.req {
    color: var(--danger);
}

.form-control {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 11px 16px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-control::placeholder {
    color: var(--text-subtle);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* Form Grid */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* =============================================================================
   TABLES & BADGES
   ============================================================================= */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.table th {
    padding: 14px 18px;
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr {
    transition: background 0.15s ease;
}

.table tbody tr:hover {
    background-color: var(--bg-card-hover);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pendiente {
    background: rgba(245, 158, 11, 0.15);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-proceso {
    background: rgba(59, 130, 246, 0.15);
    color: #60A5FA;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-terminado {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-entregado {
    background: rgba(139, 92, 246, 0.15);
    color: #A78BFA;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-cancelado {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-placa {
    font-family: 'Outfit', monospace;
    background: #000;
    color: #fff;
    border: 1.5px solid var(--gold-primary);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 800;
    letter-spacing: 1.5px;
    white-space: nowrap !important;
    display: inline-block !important;
    text-align: center;
}

/* =============================================================================
   WIZARD RECEPCIÓN DE CLIENTES (4 PASOS)
   ============================================================================= */

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.wizard-step-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.wizard-step-item.active {
    opacity: 1;
    border-color: var(--gold-primary);
    background: var(--gold-subtle);
    box-shadow: var(--shadow-gold);
}

.wizard-step-item.completed {
    opacity: 1;
    border-color: var(--success);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.wizard-step-item.active .step-number {
    border-color: var(--gold-primary);
    background: var(--gold-primary);
    color: #000;
}

.wizard-step-item.completed .step-number {
    border-color: var(--success);
    background: var(--success);
    color: #000;
}

.step-info .step-title {
    font-size: 0.85rem;
    font-weight: 700;
}
.step-info .step-desc {
    font-size: 0.72rem;
    color: var(--text-subtle);
}

/* Category Selection Cards (Paso 1) */
.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 8px;
}

.cat-card {
    background: var(--bg-input);
    color: var(--text-main);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    cursor: pointer !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    caret-color: transparent !important;
    outline: none !important;
    transition: all 0.2s ease;
}

.cat-card:hover {
    border-color: var(--gold-primary);
    transform: translateY(-2px);
}

.cat-card.selected {
    border-color: var(--gold-primary);
    background: var(--gold-subtle);
}

.cat-card i {
    font-size: 1.8rem;
    color: var(--gold-primary);
    margin-bottom: 8px;
    display: block;
    pointer-events: none;
}

.cat-card-title {
    font-weight: 700;
    font-size: 0.9rem;
    pointer-events: none;
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* =============================================================================
   MODALS
   ============================================================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    pointer-events: auto !important;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal-dialog {
    transform: scale(1);
}

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

.modal-body {
    padding: 24px;
    max-height: 75vh;
    overflow-y: auto;
}

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

/* =============================================================================
   NOTIFICATIONS / TOASTS
   ============================================================================= */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }

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

/* =============================================================================
   GRID UTILITIES (RESPONSIVE)
   ============================================================================= */

.grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grid-2fr-1fr {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

.grid-1fr-2fr {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    align-items: start;
}

.wizard-layout-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

.proforma-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.caja-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.servicios-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Sidebar Backdrop on Mobile */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.btn-sidebar-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-left: auto;
    transition: color 0.2s, background 0.2s;
}

.btn-sidebar-close:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

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

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 35px rgba(0, 0, 0, 0.7);
    }
    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }
    .topbar {
        padding: 0 20px;
    }
    .content-container {
        padding: 20px;
    }
    .wizard-steps {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .wizard-layout-grid {
        grid-template-columns: 1fr;
    }
    .grid-2fr-1fr,
    .grid-1fr-2fr,
    .proforma-modal-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .topbar {
        height: 62px;
        padding: 0 14px;
    }
    .topbar-left {
        gap: 10px;
        min-width: 0;
    }
    .page-title {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }
    .topbar-right {
        gap: 8px;
    }
    .content-container {
        padding: 14px 10px;
    }
    .grid-2col,
    .grid-3col {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
        margin-bottom: 20px;
    }
    .metric-card {
        padding: 14px 16px;
        gap: 12px;
    }
    .metric-icon {
        width: 40px;
        height: 40px;
        font-size: 1.15rem;
    }
    .metric-value {
        font-size: 1.35rem;
    }
    .metric-label {
        font-size: 0.72rem;
    }
    .card-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }
    .card-title {
        font-size: 1.05rem;
    }
    .card-body {
        padding: 16px;
    }
    .modal-dialog {
        margin: 10px auto;
        max-width: calc(100% - 20px);
    }
    .modal-header,
    .modal-footer {
        padding: 14px 16px;
    }
    .modal-body {
        padding: 16px 14px;
    }
    .modal-filter-bar {
        padding: 12px 14px;
        gap: 10px;
    }
    .category-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .cat-card {
        padding: 12px 8px;
    }
    .cat-card i {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }
    .cat-card-title {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .content-container {
        padding: 12px 8px;
    }
    .wizard-steps {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .wizard-step-item {
        padding: 10px 12px;
        gap: 8px;
    }
    .step-number {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
        flex-shrink: 0;
    }
    .step-info .step-title {
        font-size: 0.78rem;
    }
    .step-info .step-desc {
        display: none;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .caja-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .caja-metrics-grid > div {
        padding: 10px 12px !important;
    }
    .caja-metrics-grid > div > div:nth-child(2) {
        font-size: 1.1rem !important;
    }
    .servicios-cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .btn {
        padding: 8px 14px;
        font-size: 0.84rem;
    }
    .btn-lg {
        padding: 11px 20px;
        font-size: 0.95rem;
    }
    .table th, 
    .table td {
        padding: 10px 12px;
        font-size: 0.82rem;
    }
    .badge {
        padding: 3px 8px;
        font-size: 0.7rem;
    }
    .badge-placa {
        font-size: 0.85rem !important;
        padding: 2px 6px;
    }
    .toast {
        min-width: calc(100vw - 32px);
        margin: 0 auto;
    }
    .toast-container {
        right: 16px;
        left: 16px;
        bottom: 16px;
    }
}

/* =============================================================================
   TARIFARIO Y COMPONENTES DE SERVICIOS
   ============================================================================= */
.modal-filter-bar {
    padding: 16px 24px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    align-items: center;
}

.servicio-tarifa-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.servicio-tarifa-card:hover {
    border-color: var(--gold-primary);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.15);
}

.servicio-card-title {
    margin: 0;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
}

.tarifa-desglose-box {
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    padding: 10px;
    border: 1px solid var(--border-color);
}

.condicion-fila {
    border-top: 1px solid var(--border-color);
    padding: 6px 0;
}
.condicion-fila-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.tarifa-badge {
    font-size: 0.73rem;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.tarifa-badge .tarifa-label {
    color: var(--text-muted);
    font-size: 0.68rem;
}
.tarifa-badge .tarifa-precio {
    color: var(--gold-primary);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.tarifa-badge.destacada {
    border-color: var(--gold-primary) !important;
    background: rgba(245, 158, 11, 0.18) !important;
    transform: scale(1.04);
}
.tarifa-badge.atenuada {
    opacity: 0.35;
}

.btn-filtro-cat {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-filtro-cat:hover {
    color: var(--text-main);
    border-color: var(--gold-primary);
    background: var(--bg-card-hover);
}
.btn-filtro-cat.active {
    background: var(--gold-primary) !important;
    color: #000000 !important;
    font-weight: 700 !important;
    border-color: var(--gold-primary) !important;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

.condicion-card-form {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    position: relative;
    transition: all 0.2s ease;
}
.condicion-card-form:hover {
    border-color: var(--gold-primary);
}

.garantia-config-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

.btn-preset {
    font-size: 0.72rem;
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-preset:hover {
    color: var(--gold-primary);
    border-color: var(--gold-primary);
}

.btn-action-srv {
    width: 26px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-action-srv.edit {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--gold-primary);
}
.btn-action-srv.edit:hover {
    background: var(--gold-primary);
    color: #000;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}
.btn-action-srv.delete {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #EF4444;
}
.btn-action-srv.delete:hover {
    background: #EF4444;
    color: #FFF;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

