/* ==============================================
   DentaKit — Design System
   Custom CSS layer on top of Tailwind CDN
   ============================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: #F8FAFC;
    color: #0F172A;
}

/* ── SIDEBAR ──────────────────────────────────── */

:root { --sidebar-w: 240px; }

.dk-sidebar {
    width: var(--sidebar-w);
    min-width: 160px;
    max-width: 400px;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    background: #0F172A;
    border-right: 1px solid rgba(255,255,255,0.05);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    transition: width 0.05s linear;
}
.dk-sidebar::-webkit-scrollbar { display: none; }

/* ── SIDEBAR RESIZER ─────────────────────────── */
.dk-sidebar-resizer {
    width: 5px;
    flex-shrink: 0;
    cursor: col-resize;
    background: transparent;
    position: relative;
    z-index: 50;
    transition: background 0.15s;
}
.dk-sidebar-resizer:hover,
.dk-sidebar-resizer.is-dragging {
    background: rgba(99,102,241,0.5);
}
.dk-sidebar-resizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    border-radius: 9px;
    background: rgba(99,102,241,0.35);
    opacity: 0;
    transition: opacity 0.15s;
}
.dk-sidebar-resizer:hover::after,
.dk-sidebar-resizer.is-dragging::after { opacity: 1; }

.dk-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 18px 14px 16px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 10px;
}
.dk-brand-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #4F46E5;
    flex-shrink: 0;
}
.dk-brand-badge svg { width: 18px; height: 18px; }
.dk-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #F1F5F9;
    letter-spacing: -0.01em;
}
.dk-brand-sub {
    font-size: 11px;
    color: #64748B;
    margin-top: 1px;
}

.dk-clinic-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 8px 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    font-size: 12px;
    color: #CBD5E1;
    font-weight: 500;
}
.dk-clinic-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10B981;
    flex-shrink: 0;
}
.dk-clinic-change {
    margin-left: auto;
    font-size: 11px;
    color: #818CF8;
    text-decoration: none;
    white-space: nowrap;
}
.dk-clinic-change:hover { color: #A5B4FC; }

.dk-nav {
    flex: 1;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.dk-nav-sep {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 8px 8px;
}
.dk-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 500;
    color: #94A3B8;
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
}
.dk-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.dk-nav-item:hover { background: rgba(255,255,255,0.05); color: #E2E8F0; }
.dk-nav-item.active { background: rgba(99,102,241,0.15); color: #818CF8; }

.dk-sidebar-footer {
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 9px;
}
.dk-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #4F46E5;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}
.dk-user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #E2E8F0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dk-user-email {
    font-size: 11px;
    color: #64748B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dk-logout-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 7px;
    color: #64748B;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
    transition: background 0.1s, color 0.1s;
}
.dk-logout-btn:hover { background: rgba(239,68,68,0.12); color: #FCA5A5; }
.dk-logout-btn svg { width: 15px; height: 15px; }

/* ── MAIN AREA ─────────────────────────────────── */

.dk-shell { display: flex; height: 100vh; overflow: hidden; }

.dk-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background: #F8FAFC;
}

.dk-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 28px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #E8EDF5;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04), 0 1px 0 rgba(15,23,42,0.02);
    flex-shrink: 0;
    min-height: 60px;
}

/* Topbar — zona izquierda (breadcrumb / título) */
.dk-topbar-left {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dk-topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #94A3B8;
}
.dk-topbar-breadcrumb a {
    color: #94A3B8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.dk-topbar-breadcrumb a:hover { color: #4F46E5; }
.dk-topbar-breadcrumb .sep {
    color: #CBD5E1;
    font-size: 15px;
    line-height: 1;
    user-select: none;
}
.dk-topbar-breadcrumb .current {
    color: #0F172A;
    font-weight: 600;
    font-size: 13.5px;
}

/* Topbar — zona derecha */
.dk-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Pastilla de fecha */
.dk-topbar-date {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: 8px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    font-size: 12.5px;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.dk-topbar-date svg { width: 14px; height: 14px; color: #818CF8; flex-shrink: 0; }

/* Divisor vertical */
.dk-topbar-divider {
    width: 1px;
    height: 22px;
    background: #E2E8F0;
    flex-shrink: 0;
}

/* Botón icono del topbar */
.dk-topbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
    flex-shrink: 0;
}
.dk-topbar-icon-btn:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
    color: #0F172A;
}
.dk-topbar-icon-btn svg { width: 16px; height: 16px; }

/* Mini avatar de usuario en topbar */
.dk-topbar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 11px 5px 6px;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    cursor: default;
}
.dk-topbar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    display: grid;
    place-items: center;
    font-size: 11.5px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}
.dk-topbar-user-info { display: flex; flex-direction: column; }
.dk-topbar-user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #0F172A;
    line-height: 1.3;
    white-space: nowrap;
}
.dk-topbar-user-role {
    font-size: 11px;
    color: #94A3B8;
    line-height: 1.2;
    white-space: nowrap;
}

/* ── CONTENT ────────────────────────────────────── */

.dk-content {
    flex: 1;
    padding: 28px 32px;
    max-width: 1440px;
    width: 100%;
    align-self: flex-start;
}

/* Mensajes flash de éxito */
.dk-flash-success {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ECFDF5 0%, #F0FDF4 100%);
    border: 1px solid #A7F3D0;
    color: #065F46;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.08);
}
.dk-flash-success svg { width: 16px; height: 16px; flex-shrink: 0; color: #10B981; }

.dk-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #F1F5F9;
}
.dk-page-header-text { display: flex; flex-direction: column; gap: 3px; }
.dk-page-title {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #0F172A;
    line-height: 1.2;
}
.dk-page-sub {
    font-size: 13.5px;
    color: #64748B;
    font-weight: 400;
    line-height: 1.4;
}

/* ── ALERTS ─────────────────────────────────────── */

.dk-errors {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    font-size: 13.5px;
}
.dk-errors ul { margin: 0; padding-left: 18px; }
.dk-errors li { margin-top: 2px; }

/* ── AUTH LAYOUT ────────────────────────────────── */

.dk-auth-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}
.dk-auth-hero {
    background: linear-gradient(145deg, #312E81 0%, #4338CA 55%, #6D28D9 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 52px;
    position: relative;
    overflow: hidden;
}
.dk-auth-hero::before {
    content: '';
    position: absolute;
    top: -100px; right: -80px;
    width: 340px; height: 340px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.dk-auth-hero::after {
    content: '';
    position: absolute;
    bottom: -120px; left: -80px;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}
.dk-auth-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: #FFFFFF;
}

/* ── KPI GRID ───────────────────────────────────── */

.dk-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

/* ── TABLE ──────────────────────────────────────── */

.dk-table-wrap {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
}
.dk-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dk-table thead tr { background: #F8FAFC; border-bottom: 1px solid #E2E8F0; }
.dk-table th {
    padding: 11px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748B;
    text-align: left;
    white-space: nowrap;
}
.dk-table td {
    padding: 12px 16px;
    color: #475569;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}
.dk-table tbody tr:last-child td { border-bottom: none; }
.dk-table tbody tr:hover td { background: #FAFBFF; }
.dk-cell-primary { font-weight: 600; color: #0F172A !important; }
.dk-cell-right { text-align: right; }

/* ── BADGES ─────────────────────────────────────── */

.dk-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid transparent;
}
.dk-badge-blue   { background:#EFF6FF; color:#1D4ED8; border-color:#BFDBFE; }
.dk-badge-green  { background:#ECFDF5; color:#065F46; border-color:#A7F3D0; }
.dk-badge-yellow { background:#FFFBEB; color:#92400E; border-color:#FDE68A; }
.dk-badge-red    { background:#FEF2F2; color:#991B1B; border-color:#FECACA; }
.dk-badge-gray   { background:#F8FAFC; color:#475569; border-color:#E2E8F0; }
.dk-badge-orange { background:#FFF7ED; color:#9A3412; border-color:#FED7AA; }
.dk-badge-indigo { background:#EEF2FF; color:#3730A3; border-color:#C7D2FE; }

/* ── BUTTONS ────────────────────────────────────── */

.dk-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: opacity 0.1s, background 0.1s, border-color 0.1s;
    white-space: nowrap;
    font-family: inherit;
}
.dk-btn-primary  { background:#4F46E5; color:white; border-color:#4F46E5; }
.dk-btn-primary:hover  { background:#4338CA; border-color:#4338CA; }
.dk-btn-secondary { background:#FFFFFF; color:#0F172A; border-color:#E2E8F0; }
.dk-btn-secondary:hover { background:#F8FAFC; }
.dk-btn-danger   { background:#FFFFFF; border-color:#FECACA; color:#DC2626; }
.dk-btn-danger:hover   { background:#FEF2F2; }
.dk-btn-ghost    { background:transparent; border-color:transparent; color:#475569; }
.dk-btn-ghost:hover    { background:#F1F5F9; }
.dk-btn-sm { padding:5px 10px; font-size:12px; border-radius:6px; }
.dk-btn svg { width:15px; height:15px; }
.dk-btn:disabled { opacity:.6; cursor:not-allowed; }

/* ── FORM ELEMENTS ──────────────────────────────── */

.dk-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #0F172A;
    margin-bottom: 5px;
}
.dk-input, .dk-select, .dk-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
    color: #0F172A;
    background: #FFFFFF;
    outline: none;
    transition: border-color 0.1s, box-shadow 0.1s;
}
.dk-input:focus, .dk-select:focus, .dk-textarea:focus {
    border-color: #818CF8;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.dk-textarea { resize: vertical; }
.dk-field { margin-bottom: 16px; }
.dk-field-hint { margin-top: 4px; font-size: 12px; color: #94A3B8; }
.dk-field-error { margin-top: 4px; font-size: 12px; color: #DC2626; }
.dk-form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dk-form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── CARD ───────────────────────────────────────── */

.dk-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
}
.dk-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.dk-card-title { font-size: 14px; font-weight: 600; color: #0F172A; }

/* ── EMPTY STATE ────────────────────────────────── */

.dk-empty { padding: 48px 32px; text-align: center; }
.dk-empty-icon { width: 40px; height: 40px; margin: 0 auto 12px; color: #CBD5E1; }
.dk-empty-title { font-size: 15px; font-weight: 600; color: #0F172A; }
.dk-empty-sub { font-size: 13px; color: #64748B; margin-top: 4px; }

/* ── GRID HELPERS ───────────────────────────────── */

.dk-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dk-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── RESPONSIVE ─────────────────────────────────── */

@media (max-width: 1200px) { .dk-kpi-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px) {
    .dk-sidebar { display: none; }
    .dk-auth-body { grid-template-columns: 1fr; }
    .dk-auth-hero { display: none; }
    .dk-content { padding: 16px; }
    .dk-form-grid-2 { grid-template-columns: 1fr; }
    .dk-form-grid-3 { grid-template-columns: 1fr; }
    .dk-2col { grid-template-columns: 1fr; }
    .dk-kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ── BADGE GRANDE ───────────────────────────────── */
.dk-badge-lg {
    padding: 5px 13px;
    font-size: 12.5px;
}

/* ── FORMULARIO CENTRADO ────────────────────────── */
.dk-page-wrap {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.dk-form-centered {
    max-width: 560px;
    margin: 0 auto;
}

/* ── PRESUPUESTOS — STATS ────────────────────────── */
.dk-quote-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.dk-quote-stat {
    flex: 1;
    min-width: 100px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dk-quote-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.03em;
    line-height: 1;
}
.dk-quote-stat-label {
    font-size: 12px;
    color: #94A3B8;
    font-weight: 500;
}
.dk-quote-stat--draft   { border-left: 3px solid #94A3B8; }
.dk-quote-stat--sent    { border-left: 3px solid #3B82F6; }
.dk-quote-stat--approved{ border-left: 3px solid #10B981; }
.dk-quote-stat--amount  { border-left: 3px solid #6366F1; background: #FAFBFF; }
.dk-quote-stat--amount .dk-quote-stat-value { color: #4F46E5; font-size: 18px; }

/* ── PRESUPUESTOS — REF Y BADGE LÍNEAS ──────────── */
.dk-quote-ref {
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
    font-variant-numeric: tabular-nums;
}
.dk-quote-lines-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #EEF2FF;
    color: #4338CA;
    font-size: 12px;
    font-weight: 700;
}

/* ── PRESUPUESTOS — LAYOUT DETALLE ──────────────── */
.dk-quote-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: flex-start;
}
.dk-quote-main { display: flex; flex-direction: column; gap: 0; }
.dk-quote-sidebar { display: flex; flex-direction: column; gap: 0; position: sticky; top: 76px; }

/* ── PRESUPUESTOS — DOCUMENTO ───────────────────── */
.dk-quote-doc {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(15,23,42,0.04);
}
.dk-quote-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 28px;
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    border-bottom: 1px solid #E8EDF5;
    gap: 20px;
    flex-wrap: wrap;
}
.dk-quote-doc-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dk-quote-doc-brand-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79,70,229,0.30);
}
.dk-quote-doc-brand-badge svg { width: 20px; height: 20px; }
.dk-quote-doc-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
}
.dk-quote-doc-meta-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    font-size: 13px;
    color: #64748B;
}
.dk-quote-doc-meta-row strong { color: #0F172A; }

/* Bloque de paciente */
.dk-quote-patient-block {
    padding: 20px 28px;
    border-bottom: 1px solid #F1F5F9;
    background: #FAFBFF;
}
.dk-quote-patient-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #94A3B8;
    margin-bottom: 6px;
}
.dk-quote-patient-name {
    font-size: 16px;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}
.dk-quote-patient-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748B;
    margin-top: 4px;
}
.dk-quote-patient-detail svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Notas */
.dk-quote-notes {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 28px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #78350F;
    font-size: 13.5px;
    margin-top: 20px;
}
.dk-quote-notes svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: #D97706; }

/* Tabla de líneas */
.dk-quote-lines {
    margin: 20px 0 0;
    border-top: 1px solid #F1F5F9;
}
.dk-quote-lines .dk-table { border-radius: 0; }
.dk-quote-lines .dk-table th { padding: 10px 28px; }
.dk-quote-lines .dk-table td { padding: 12px 28px; }

/* Totales */
.dk-quote-totals {
    display: flex;
    justify-content: flex-end;
    padding: 20px 28px 24px;
    border-top: 1px solid #F1F5F9;
    background: #FAFBFF;
}
.dk-quote-totals-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 260px;
}
.dk-quote-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    color: #64748B;
}
.dk-quote-totals-row span:last-child { font-weight: 500; color: #0F172A; }
.dk-quote-totals-total {
    border-top: 1px solid #E2E8F0;
    padding-top: 10px;
    margin-top: 4px;
}
.dk-quote-totals-total span:first-child {
    font-size: 15px;
    font-weight: 700;
    color: #0F172A;
}
.dk-quote-totals-total span:last-child {
    font-size: 22px;
    font-weight: 800;
    color: #4F46E5;
    letter-spacing: -0.03em;
}

/* Banners aprobado/rechazado en sidebar */
.dk-quote-approved-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 9px;
    background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
    border: 1px solid #6EE7B7;
    color: #065F46;
    font-size: 13px;
    font-weight: 700;
}
.dk-quote-approved-banner svg { width: 15px; height: 15px; flex-shrink: 0; }
.dk-quote-rejected-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 9px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
    font-size: 13px;
    font-weight: 700;
}
.dk-quote-rejected-banner svg { width: 15px; height: 15px; flex-shrink: 0; }

@media (max-width: 1024px) {
    .dk-quote-layout { grid-template-columns: 1fr; }
    .dk-quote-sidebar { position: static; }
}
@media (max-width: 640px) {
    .dk-quote-doc-header { flex-direction: column; }
    .dk-quote-doc-meta { text-align: left; }
    .dk-quote-doc-meta-row { justify-content: flex-start; }
    .dk-quote-stats { flex-direction: column; }
    .dk-quote-lines .dk-table th,
    .dk-quote-lines .dk-table td { padding: 10px 16px; }
}

/* ═══════════════════════════════════════════════════
   CALENDARIO DE CITAS
   ═══════════════════════════════════════════════════ */

.dk-cal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}
.dk-cal-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    color: #0F172A;
    text-transform: capitalize;
}
.dk-cal-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    color: #475569;
    text-decoration: none;
    transition: background 0.1s, border-color 0.1s;
}
.dk-cal-nav-btn:hover { background: #F1F5F9; border-color: #CBD5E1; }

.dk-cal-today-btn {
    padding: 0 14px;
    height: 34px;
    border-radius: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.1s;
}
.dk-cal-today-btn:hover { background: #F1F5F9; }

.dk-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid #E8EDF5;
    border-radius: 12px;
    overflow: hidden;
    background: #F1F5F9;
    box-shadow: 0 1px 4px rgba(15,23,42,0.05);
    gap: 1px;
}
.dk-cal-head-cell {
    padding: 9px 4px;
    font-size: 11px;
    font-weight: 700;
    color: #64748B;
    text-align: center;
    background: #F8FAFC;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dk-cal-cell {
    min-height: 108px;
    padding: 7px 6px 5px;
    background: #FFFFFF;
    position: relative;
    overflow: hidden;
}
.dk-cal-cell--empty   { background: #FAFBFC; }
.dk-cal-cell--today   { background: #EFF6FF; }
.dk-cal-cell--weekend { background: #FAFBFC; }

.dk-cal-num {
    font-size: 13px;
    font-weight: 600;
    color: #94A3B8;
    margin-bottom: 5px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    line-height: 1;
}
.dk-cal-num--hot {
    font-size: 12px;
    font-weight: 700;
    color: #0F172A;
}
.dk-cal-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #4F46E5;
    color: white;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.dk-cal-pill {
    display: block;
    margin-bottom: 3px;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    line-height: 1.6;
    transition: opacity 0.1s, filter 0.1s;
}
.dk-cal-pill:hover  { opacity: 0.82; filter: brightness(0.97); }
.dk-cal-pill--scheduled   { background: #DBEAFE; color: #1E40AF; }
.dk-cal-pill--confirmed   { background: #E0E7FF; color: #3730A3; }
.dk-cal-pill--in_progress { background: #FEF3C7; color: #92400E; }
.dk-cal-pill--done        { background: #D1FAE5; color: #065F46; }
.dk-cal-pill--canceled    { background: #FEE2E2; color: #991B1B; }
.dk-cal-pill--no_show     { background: #F1F5F9; color: #64748B; }

.dk-cal-overflow {
    font-size: 10.5px;
    color: #94A3B8;
    font-weight: 500;
    margin-top: 2px;
    padding-left: 2px;
}
.dk-cal-legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 0 2px;
}

@media (max-width: 768px) {
    .dk-cal-cell { min-height: 70px; padding: 5px 3px; }
    .dk-cal-pill { font-size: 10px; padding: 1px 5px; }
    .dk-cal-head-cell { font-size: 10px; padding: 7px 2px; }
}
