/* Utilidades */
.hidden { display: none !important; }
.block { display: block !important; }

.m-0 { margin: 0; }
.mt-1 { margin-top: 0.125rem; }
.mt-2 { margin-top: 0.25rem; }
.mt-4 { margin-top: 0.35rem; }
.mb-1 { margin-bottom: 0.125rem; }
.mb-2 { margin-bottom: 0.25rem; }
.mb-3 { margin-bottom: 0.375rem; }
.mb-4 { margin-bottom: 0.35rem; }

.p-0 { padding: 0; }
.p-2 { padding: 0.25rem; }
.p-3 { padding: 0.375rem; }
.p-4 { padding: 0.5rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.cursor-pointer { cursor: pointer; }

/* Login Page Specifics */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-body);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.25rem;
    color: var(--primary-color);
}

.login-brand-mark {
    width: 124px;
    height: 124px;
    margin: 0 auto 0.9rem;
    border-radius: 28px;
    background: linear-gradient(180deg, color-mix(in srgb, #ffffff 92%, var(--primary-color) 8%), #ffffff);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0.6rem;
}

.login-brand-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-brand-fallback {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
}

.login-brand-name {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.2;
}

.login-brand-subtitle {
    margin-top: 0.25rem;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.login-loader-card {
    width: 100%;
    max-width: 340px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}

.login-loader-note {
    color: var(--text-secondary);
    font-size: 0.92rem;
    text-align: center;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--bg-card);
    border-left: 4px solid var(--primary-color);
    padding: 0.6rem;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
    font-size: 0.9rem;
}

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

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

/* ── Bootstrap-compat utilities (usadas en templates JS) ────── */
.d-flex  { display: flex !important; }
.d-none  { display: none !important; }
.d-block { display: block !important; }
.d-inline-flex { display: inline-flex !important; }

.justify-content-center  { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end     { justify-content: flex-end !important; }
.align-items-center      { align-items: center !important; }
.align-items-start       { align-items: flex-start !important; }
.align-items-end         { align-items: flex-end !important; }
.flex-column             { flex-direction: column !important; }
.flex-wrap               { flex-wrap: wrap !important; }

.overflow-auto    { overflow: auto !important; }
.overflow-hidden  { overflow: hidden !important; }

.text-end    { text-align: right !important; }
.text-center { text-align: center !important; }
.text-start  { text-align: left !important; }

.fw-semibold { font-weight: 600 !important; }
.fw-bold     { font-weight: 700 !important; }

.bg-light { background-color: var(--bg-body) !important; }
.bg-white { background-color: var(--bg-white) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.text-white { color: var(--text-white) !important; }
.text-dark { color: var(--text-color) !important; }
.text-muted { color: var(--text-muted) !important; }
.font-weight-bold { font-weight: 700 !important; }
.rounded { border-radius: var(--border-radius-sm) !important; }

.shadow-sm { box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important; }
.h-100     { height: 100% !important; }

[data-theme="dark"] .shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.mb-0 { margin-bottom: 0 !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.mt-3 { margin-top: 0.375rem; }

.p-4 { padding: 0.75rem !important; }
.p-5 { padding: 1rem !important; }

/* Row / col Bootstrap-compat */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.col-md-4 { flex: 1 1 calc(33.33% - 0.35rem); min-width: 140px; }
.col-md-6 { flex: 1 1 calc(50% - 0.25rem);   min-width: 160px; }
.col-md-8 { flex: 1 1 calc(66.66% - 0.35rem); min-width: 200px; }
.col-md-12 { flex: 1 1 100%; }

@media (max-width: 768px) {
    .col-md-4,
    .col-md-6,
    .col-md-8  { flex: 1 1 100%; }
}
