/* ============================================================
   ProspeCRM - Congelados Guerrero
   Estilos principales - Mobile First
   ============================================================ */

/* --- CSS Variables --- */
:root {
    /* Colores corporativos */
    --primary: #005172;
    --primary-light: #0077A8;
    --primary-lighter: #E0F2FE;
    --primary-dark: #003A52;
    --primary-gradient: linear-gradient(135deg, #005172 0%, #0077A8 100%);

    /* Colores de UI */
    --bg: #F0F4F8;
    --bg-card: #FFFFFF;
    --bg-input: #F8FAFC;
    --text: #1A202C;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-focus: #005172;

    /* Colores de estado */
    --success: #22C55E;
    --success-bg: #F0FDF4;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --error: #EF4444;
    --error-bg: #FEF2F2;
    --info: #3B82F6;
    --info-bg: #EFF6FF;

    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Bordes */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Tipografia */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Espaciado */
    --nav-height: 60px;
    --topbar-height: 56px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Transiciones */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

img {
    max-width: 100%;
    height: auto;
}

/* --- Splash Screen --- */
.splash-screen {
    position: fixed;
    inset: 0;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
}

.splash-logo-img {
    width: 120px;
    height: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.splash-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

.splash-text {
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
    font-weight: 500;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Login Screen --- */
.login-screen {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
}

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

.login-logo-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.login-logo {
    width: 56px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.login-title {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    font-weight: 400;
    margin-top: 4px;
}

.login-form {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    box-shadow: var(--shadow-xl);
}

.login-legal {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.login-legal .icon-sm {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
    stroke: var(--text-muted);
}

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

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
    pointer-events: none;
    transition: var(--transition-fast);
}

.form-input {
    width: 100%;
    padding: 12px 12px 12px 42px;
    font-family: var(--font);
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: var(--transition);
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 81, 114, 0.12);
}

.form-input:focus + .input-icon,
.form-input:focus ~ .input-icon {
    stroke: var(--primary);
}

.input-action {
    position: absolute;
    right: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.input-action svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
}

.input-action:hover svg {
    stroke: var(--text);
}

/* Sin icono izquierdo */
.form-input.no-icon {
    padding-left: 12px;
}

/* Select */
.form-select {
    width: 100%;
    padding: 12px;
    font-family: var(--font);
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: var(--transition);
    -webkit-appearance: none;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 81, 114, 0.12);
}

/* Textarea */
.form-textarea {
    width: 100%;
    padding: 12px;
    font-family: var(--font);
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    resize: vertical;
    min-height: 80px;
    transition: var(--transition);
}

.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 81, 114, 0.12);
}

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid #FECACA;
}

.alert-success {
    background: var(--success-bg);
    color: #15803D;
    border: 1px solid #BBF7D0;
}

.alert-warning {
    background: var(--warning-bg);
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-info {
    background: var(--info-bg);
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn svg {
    width: 18px;
    height: 18px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: #E2E8F0;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: var(--primary-lighter);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 1rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn:disabled, .btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text);
}

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

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.06);
}

.btn-text { display: inline-flex; align-items: center; gap: 8px; }
.btn-loading { display: inline-flex; align-items: center; gap: 8px; }

.spinner-small {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* --- Top Bar --- */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.notifications-btn {
    position: relative;
}

.badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: var(--error);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-avatar:hover {
    box-shadow: 0 0 0 3px var(--primary-lighter);
}

.user-initials {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* --- Page Content --- */
.page-content {
    padding-top: var(--topbar-height);
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
    min-height: 100vh;
    min-height: 100dvh;
}

.page-section {
    padding: 16px;
}

.page-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

/* --- Bottom Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

.nav-item-label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

.nav-item:active {
    background: rgba(0, 81, 114, 0.06);
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
}

/* --- Tags / Chips --- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.tag-sm {
    padding: 2px 8px;
    font-size: 0.625rem;
}

/* --- Pipeline Stage Badge --- */
.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.stage-badge .stage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* --- Score Stars --- */
.score-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.score-stars .star {
    width: 14px;
    height: 14px;
    fill: #FFC107;
}

.score-stars .star.empty {
    fill: #E2E8F0;
}

.score-value {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
    margin-left: 4px;
}

.score-reviews {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 4px;
}

/* --- Slide Panel --- */
.slide-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 380px;
    height: 100%;
    background: #fff;
    z-index: 200;
    transition: right 0.3s ease;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
}

.slide-panel.open {
    right: 0;
}

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

.panel-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* --- Overlay --- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.visible {
    opacity: 1;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: calc(var(--topbar-height) + 8px);
    right: 12px;
    left: 12px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s ease;
    pointer-events: auto;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--error); }
.toast.toast-warning { border-left-color: var(--warning); }

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

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

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

/* --- Skeleton Loading --- */
.skeleton {
    background: linear-gradient(90deg, #E2E8F0 25%, #EDF2F7 50%, #E2E8F0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }

.skeleton-circle {
    border-radius: 50%;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    stroke: var(--border);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 0.875rem;
}

/* --- Search Bar --- */
.search-bar {
    position: relative;
    margin-bottom: 16px;
}

.search-bar .input-icon {
    left: 14px;
}

.search-bar .form-input {
    padding-left: 44px;
    padding-right: 12px;
    background: #fff;
    border-radius: var(--radius-full);
}

/* --- Filter Chips --- */
.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 16px 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.filter-chip svg {
    width: 14px;
    height: 14px;
}

/* --- Stats Cards --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border);
}

.stat-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.stat-card-icon svg {
    width: 20px;
    height: 20px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* --- Funnel Chart --- */
.funnel-container {
    padding: 0 16px;
    margin-bottom: 24px;
}

.funnel-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.funnel-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    width: 100px;
    text-align: right;
    flex-shrink: 0;
}

.funnel-track {
    flex: 1;
    height: 32px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.funnel-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding: 0 10px;
    min-width: fit-content;
    transition: width 0.6s ease;
}

.funnel-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.funnel-pct {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    width: 45px;
    flex-shrink: 0;
}

/* --- List Items (Establishment Cards) --- */
.est-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px;
}

.est-card {
    display: flex;
    gap: 12px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 14px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.est-card:active {
    transform: scale(0.99);
    background: var(--bg);
}

.est-card-img {
    width: 70px;
    height: 70px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg);
}

.est-card-body {
    flex: 1;
    min-width: 0;
}

.est-card-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.est-card-category {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.est-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.est-card-score {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}

.est-card-score svg {
    width: 13px;
    height: 13px;
    fill: #FFC107;
}

.est-card-reviews {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.est-card-price {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* --- Selection Mode --- */
.selection-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    font-size: 0.8125rem;
    margin-top: 8px;
}

.select-check {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.9);
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.2s ease;
}

.est-list.selection-active .select-check {
    display: flex;
}

.select-check svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    transition: opacity 0.15s;
}

.select-check.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.select-check.checked svg {
    opacity: 1;
    stroke: white;
}

.est-card.selected {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
    background: #f0f7fb;
}

.est-card.selected:active {
    background: #e4eff5;
}

/* --- Bulk Actions Bar --- */
.bulk-actions-bar {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-bottom));
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
    z-index: 99;
    animation: bulkSlideUp 0.25s ease;
}

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

.bulk-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 10px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.6875rem;
    color: var(--text);
    font-family: var(--font);
    border-radius: var(--radius);
    transition: background 0.15s;
    min-width: 52px;
}

.bulk-action-btn svg {
    width: 22px;
    height: 22px;
}

.bulk-action-btn:active {
    background: var(--bg);
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-16 { padding: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }
