/* ========================================
   DOPPIO CRM — Global Stylesheet
   Paleta inspirada en doppiocafe.com.ar
   ======================================== */

:root {
    --espresso:    #1C0F07;
    --coffee:      #3D1F0D;
    --mocha:       #6B3628;
    --caramel:     #C8860A;
    --gold:        #E0A020;
    --cream:       #F5EFE6;
    --light:       #FAF7F2;
    --white:       #FFFFFF;
    --text-dark:   #1A1008;
    --text-mid:    #5A4030;
    --text-light:  #9E8070;
    --border:      #E8DDD3;
    --shadow:      rgba(28,15,7,0.12);
    --success:     #27AE60;
    --warning:     #E67E22;
    --danger:      #E74C3C;
    --info:        #2980B9;
    --sidebar-w:   260px;
    --header-h:    64px;
    --radius:      12px;
    --radius-sm:   8px;
    --transition:  all 0.25s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--light);
    color: var(--text-dark);
    font-size: 15px;
    line-height: 1.6;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--mocha); border-radius: 3px; }

/* ===== LOGIN PAGE ===== */
.login-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--espresso) 0%, var(--coffee) 50%, var(--mocha) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-bg::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(200,134,10,0.15) 0%, transparent 70%);
    top: -200px; right: -200px;
    animation: pulseGlow 4s ease-in-out infinite;
}

.login-bg::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(200,134,10,0.1) 0%, transparent 70%);
    bottom: -100px; left: -100px;
    animation: pulseGlow 5s ease-in-out infinite reverse;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50%       { transform: scale(1.1); opacity: 1; }
}

.coffee-drops {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.drop {
    position: absolute;
    width: 4px; height: 4px;
    background: rgba(200,134,10,0.4);
    border-radius: 50%;
    animation: dropFall linear infinite;
}

@keyframes dropFall {
    0%   { transform: translateY(-20px); opacity: 1; }
    100% { transform: translateY(110vh); opacity: 0; }
}

.login-card {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(200,134,10,0.2);
    position: relative;
    z-index: 10;
    animation: cardEnter 0.7s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--coffee), var(--caramel));
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(200,134,10,0.35);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--espresso);
    letter-spacing: -0.5px;
}

.login-logo p {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

.login-alert {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13.5px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shakeAlert 0.4s ease;
}

@keyframes shakeAlert {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(-6px); }
    75%     { transform: translateX(6px); }
}

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

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--espresso) 0%, var(--coffee) 100%);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: 4px 0 20px var(--shadow);
}

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

.brand-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--caramel), var(--gold));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(200,134,10,0.4);
}

.brand-text h2 {
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.brand-text span {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.3);
    padding: 8px 10px 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    position: relative;
}

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

.nav-link.active {
    background: linear-gradient(135deg, rgba(200,134,10,0.25), rgba(200,134,10,0.12));
    color: var(--gold);
    box-shadow: inset 3px 0 0 var(--caramel);
}

.nav-link .nav-icon {
    font-size: 17px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--caramel), var(--gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-details { flex: 1; overflow: hidden; }
.user-details .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-details .user-rol {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}

.btn-logout {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 16px;
}
.btn-logout:hover { color: var(--danger); background: rgba(231,76,60,0.1); }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== TOPBAR ===== */
.topbar {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 8px var(--shadow);
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--espresso);
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-title .page-icon {
    font-size: 20px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-notif {
    position: relative;
    background: none;
    border: 1px solid var(--border);
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-mid);
}
.btn-notif:hover { border-color: var(--caramel); color: var(--caramel); background: rgba(200,134,10,0.05); }

.notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--espresso);
    padding: 4px;
}

/* ===== PAGE CONTENT ===== */
.page-content {
    flex: 1;
    padding: 28px;
    max-width: 1400px;
    width: 100%;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    color: var(--text-dark);
    background: var(--white);
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--caramel);
    box-shadow: 0 0 0 3px rgba(200,134,10,0.12);
}

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

select.form-control { cursor: pointer; }

textarea.form-control { resize: vertical; min-height: 90px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--coffee), var(--caramel));
    color: white;
    box-shadow: 0 4px 14px rgba(200,134,10,0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(200,134,10,0.4);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--cream);
    color: var(--text-mid);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-danger {
    background: #fef2f2;
    color: var(--danger);
    border: 1.5px solid #fecaca;
}
.btn-danger:hover { background: var(--danger); color: white; }

.btn-success {
    background: #f0fdf4;
    color: var(--success);
    border: 1.5px solid #bbf7d0;
}
.btn-success:hover { background: var(--success); color: white; }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }

.btn-icon {
    width: 36px; height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: white;
    cursor: pointer;
    font-size: 15px;
    transition: var(--transition);
    color: var(--text-mid);
    text-decoration: none;
}
.btn-icon:hover { border-color: var(--caramel); color: var(--caramel); }

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover { box-shadow: 0 4px 20px rgba(28,15,7,0.15); }

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

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--espresso);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body { padding: 22px; }

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    box-shadow: 0 2px 8px var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
}
.stat-card.s-total::after  { background: var(--coffee); }
.stat-card.s-nuevo::after  { background: var(--info); }
.stat-card.s-clientes::after { background: var(--success); }
.stat-card.s-propuesta::after { background: var(--caramel); }
.stat-card.s-perdido::after { background: var(--danger); }

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(28,15,7,0.12); }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.si-total    { background: rgba(61,31,13,0.1); }
.stat-icon.si-nuevo    { background: rgba(41,128,185,0.1); }
.stat-icon.si-clientes { background: rgba(39,174,96,0.1); }
.stat-icon.si-propuesta{ background: rgba(200,134,10,0.1); }
.stat-icon.si-perdido  { background: rgba(231,76,60,0.1); }

.stat-info { flex: 1; }
.stat-number {
    font-size: 30px;
    font-weight: 800;
    color: var(--espresso);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 12.5px;
    color: var(--text-light);
    font-weight: 500;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-nuevo      { background: #dbeafe; color: #1d4ed8; }
.badge-contactado { background: #fef3c7; color: #92400e; }
.badge-interesado { background: #d1fae5; color: #065f46; }
.badge-propuesta  { background: #ede9fe; color: #5b21b6; }
.badge-cliente    { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.badge-perdido    { background: #fee2e2; color: #991b1b; }

/* ===== TABLE ===== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px var(--shadow);
}

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

.table thead {
    background: linear-gradient(135deg, var(--espresso), var(--coffee));
}

.table thead th {
    padding: 13px 16px;
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    text-align: left;
    white-space: nowrap;
}

.table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.table tbody tr:last-child { border-bottom: none; }

.table tbody tr:hover { background: var(--cream); }

.table tbody td {
    padding: 13px 16px;
    font-size: 14px;
    color: var(--text-dark);
    vertical-align: middle;
}

.table .contact-name {
    font-weight: 600;
    color: var(--espresso);
}

.table .contact-empresa {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ===== PIPELINE BAR ===== */
.pipeline-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 10px;
}

.pipeline-segment {
    height: 100%;
    transition: var(--transition);
    cursor: default;
}

/* ===== FILTERS / SEARCH ===== */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-input-wrap .search-icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 15px;
}

.search-input-wrap input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
    color: var(--text-dark);
}
.search-input-wrap input:focus {
    border-color: var(--caramel);
    box-shadow: 0 0 0 3px rgba(200,134,10,0.1);
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ===== DETAIL PAGE ===== */
.detail-header {
    background: linear-gradient(135deg, var(--espresso) 0%, var(--coffee) 100%);
    border-radius: var(--radius);
    padding: 28px;
    color: white;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.detail-header::before {
    content: '';
    position: absolute;
    right: -30px; top: -30px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(200,134,10,0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.detail-header-content { position: relative; z-index: 1; }

.detail-nombre {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 4px;
}

.detail-empresa {
    font-size: 15px;
    opacity: 0.7;
    margin-bottom: 16px;
}

.detail-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    opacity: 0.85;
}

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

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

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    animation: fadeInUp 0.4s ease both;
}

.timeline-dot {
    position: absolute;
    left: -24px; top: 4px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--caramel);
    border: 2px solid white;
    box-shadow: 0 0 0 3px rgba(200,134,10,0.2);
}

.timeline-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    box-shadow: 0 2px 6px var(--shadow);
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.timeline-tipo {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--cream);
    color: var(--mocha);
}

.timeline-date {
    font-size: 12px;
    color: var(--text-light);
    margin-left: auto;
}

.timeline-desc {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.55;
}

.timeline-proxima {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--caramel);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalEnter 0.3s cubic-bezier(.34,1.56,.64,1);
}

@keyframes modalEnter {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--espresso);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
}
.modal-close:hover { color: var(--danger); background: #fef2f2; }

.modal-body { padding: 24px; }

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

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-light);
}

.empty-state .empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 8px;
}

.empty-state p { font-size: 14px; }

/* ===== NOTIFICATIONS ===== */
.notif-item {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.notif-item:hover { background: var(--cream); }
.notif-item.unread { background: #fffbf0; }
.notif-item:last-child { border-bottom: none; }

.notif-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.notif-icon.ni-workflow   { background: rgba(200,134,10,0.12); }
.notif-icon.ni-asignacion { background: rgba(41,128,185,0.12); }
.notif-icon.ni-seguimiento{ background: rgba(39,174,96,0.12); }
.notif-icon.ni-sistema    { background: rgba(61,31,13,0.08); }

.notif-content { flex: 1; }
.notif-titulo  { font-size: 14px; font-weight: 600; color: var(--espresso); margin-bottom: 3px; }
.notif-mensaje { font-size: 13px; color: var(--text-light); }
.notif-time    { font-size: 11.5px; color: var(--text-light); margin-top: 4px; }

.notif-unread-dot {
    width: 8px; height: 8px;
    background: var(--caramel);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

/* ===== ADMIN USER CARDS ===== */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.user-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: var(--transition);
    box-shadow: 0 2px 8px var(--shadow);
}

.user-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(28,15,7,0.12); }

.user-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.user-card-avatar {
    width: 50px; height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--coffee), var(--caramel));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.user-card-name { font-size: 16px; font-weight: 700; color: var(--espresso); }
.user-card-username { font-size: 12px; color: var(--text-light); }

.user-card-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-mid);
    margin-bottom: 8px;
}

.badge-rol-admin      { background: rgba(200,134,10,0.15); color: var(--caramel); }
.badge-rol-supervisor { background: rgba(41,128,185,0.12); color: var(--info); }
.badge-rol-comercial  { background: rgba(39,174,96,0.12); color: var(--success); }
.badge-inactive       { background: #fee2e2; color: var(--danger); }

/* ===== TOAST NOTIFICATION ===== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 380px;
    animation: toastIn 0.4s cubic-bezier(.34,1.56,.64,1);
    pointer-events: all;
    border-left: 4px solid var(--caramel);
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger  { border-left-color: var(--danger); }
.toast.toast-out     { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(60px); }
}

/* ===== WORKFLOW CONFIG ===== */
.wf-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
}

.wf-card.wf-active { border-color: rgba(200,134,10,0.4); }

.wf-toggle {
    position: relative;
    width: 44px; height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.wf-toggle input { opacity: 0; width: 0; height: 0; }

.wf-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.wf-slider::before {
    content: '';
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.wf-toggle input:checked + .wf-slider { background: var(--caramel); }
.wf-toggle input:checked + .wf-slider::before { transform: translateX(20px); }

.wf-info { flex: 1; }
.wf-name { font-size: 15px; font-weight: 700; color: var(--espresso); margin-bottom: 4px; }
.wf-desc { font-size: 13px; color: var(--text-light); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 300;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .mobile-toggle { display: block; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-content { padding: 18px; }
    .users-grid { grid-template-columns: 1fr; }

    .overlay-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 299;
    }
    .overlay-backdrop.show { display: block; }
}

@media (max-width: 560px) {
    .stats-grid { grid-template-columns: 1fr; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .login-card { padding: 32px 24px; }
    .detail-meta { flex-direction: column; gap: 8px; }
    .topbar { padding: 0 16px; }
}
