html, body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
}

h1:focus { outline: none; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid red; }
.validation-message { color: red; font-size: 0.85rem; }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #3b82f6;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Cargando...");
}

/* Dashboard layout */
.marcadores-grid {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.marcadores-columna {
    flex: 1;
    min-width: 240px;
}

/* Group card */
.grupo-card {
    transition: box-shadow 0.2s ease, opacity 0.15s ease, outline 0.1s ease;
    border-radius: 0.5rem !important;
    overflow: hidden;
    user-select: none;
}

.grupo-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
}

.grupo-card .card-header {
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* Drag handle */
.drag-handle {
    cursor: grab;
    opacity: 0.3;
    transition: opacity 0.15s;
    font-size: 1rem;
}

.grupo-card:hover .drag-handle {
    opacity: 0.6;
}

/* Card being dragged */
.grupo-card.dragging {
    opacity: 0.35;
    cursor: grabbing;
}

/* Card that is the drop target (insert before) */
.grupo-card.drag-over {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25) !important;
}

/* Column drop zone highlight (cursor over empty space) */
.marcadores-columna.col-drag-over {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 0.5rem;
    outline: 2px dashed rgba(59, 130, 246, 0.35);
    outline-offset: 4px;
}

/* Bookmark item */
.marcador-item {
    border-radius: 0.375rem;
    transition: background-color 0.15s ease;
}

.marcador-item:hover {
    background-color: rgba(0,0,0,0.04);
}

.marcador-item .marcador-actions {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.marcador-item:hover .marcador-actions {
    opacity: 1;
}

.marcador-nombre {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

.marcador-nombre:hover {
    color: #3b82f6 !important;
}

/* Auth pages */
.auth-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%);
}

.auth-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Navbar */
.navbar-brand {
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    transition: transform 0.2s ease;
    display: inline-block;
}

.navbar-brand:hover {
    transform: scale(1.12);
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay .modal-dialog {
    margin: 0;
    width: 100%;
    max-width: 500px;
}

/* Color preview */
.color-preview {
    height: 40px;
    border-radius: 0.375rem;
    border: 1px solid rgba(0,0,0,0.1);
    transition: background-color 0.2s;
}

/* Table improvements */
.table th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Badge improvements */
.badge { font-size: 0.75rem; font-weight: 500; }

@media (max-width: 768px) {
    .marcadores-columna {
        min-width: 100%;
        max-width: 100%;
    }
}

/* Bookmark icon grid */
.marcadores-iconos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 2px;
    padding: 4px;
}

.marcador-icono-item {
    position: relative;
}

.marcador-icono-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px 4px;
    border-radius: 6px;
    text-decoration: none;
    color: #2d3748;
    cursor: pointer;
}

.marcador-icono-item a:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #3b82f6;
}

.marcador-icono-item img {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
    border-radius: 4px;
    object-fit: contain;
}

.nombre-icono {
    font-size: 0.65rem;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
}

.actions-icono {
    display: none;
    position: absolute;
    top: 2px;
    right: 2px;
    flex-direction: column;
    gap: 1px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 4px;
    padding: 2px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.marcador-icono-item:hover .actions-icono {
    display: flex;
}

/* Import modal */
.drop-zone {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
}

.grupos-preview {
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
}

.grupo-preview-item {
    transition: opacity 0.2s;
}

