/**
 * Sistema Administrativo Express (XSA)
 * Estilos: Command Center / Pantalla de Inicio Personal
 * css/system/home.css
 */

.command-center-wrapper {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem 1.25rem;
    animation: fadeInHome 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInHome {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 1. Header & Saludo */
.cc-header-card {
    background: #ffffff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    padding: 1.35rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.cc-greeting-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cc-greeting-subtitle {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0;
}

.cc-header-badges {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.cc-company-badge {
    background: var(--primary-light, #eff6ff);
    color: var(--primary, #2563eb);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 8px;
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cc-company-badge:hover {
    background: #dbeafe;
    border-color: rgba(37, 99, 235, 0.4);
}

.cc-plan-badge {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.cc-plan-badge.active-plan {
    color: #047857;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

/* 2. Omnibox Universal */
.cc-search-container {
    position: relative;
    max-width: 760px;
    margin: 0 auto 1.5rem auto;
}

.cc-search-box {
    position: relative;
    width: 100%;
}

.cc-search-icon {
    position: absolute;
    left: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.cc-search-input {
    width: 100%;
    padding: 0.95rem 4.5rem 0.95rem 3rem;
    font-size: 0.98rem;
    color: #0f172a;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    outline: none;
    transition: all 0.2s ease;
}

.cc-search-input:focus {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
}

.cc-search-shortcut {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    pointer-events: none;
    font-family: inherit;
}

/* Desplegable de Resultados Omnibox */
.cc-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    z-index: 2000;
    max-height: 420px;
    overflow-y: auto;
    display: none;
}

.cc-search-results.active {
    display: block;
}

.cc-result-group-title {
    padding: 0.65rem 1rem 0.35rem 1rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.cc-result-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.12s ease;
    text-decoration: none;
    color: inherit;
}

.cc-result-item:hover,
.cc-result-item.selected {
    background: #f1f5f9;
}

.cc-result-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #eef2ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cc-result-info {
    flex: 1;
    min-width: 0;
}

.cc-result-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-result-sub {
    font-size: 0.76rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 3. Barra de Acciones Rápidas */
.cc-quick-actions-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.75rem;
}

.cc-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.15s ease;
    cursor: pointer;
}

.cc-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

.cc-action-btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}

.cc-action-btn-primary:hover {
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.32);
    color: #ffffff;
}

.cc-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cc-action-btn-primary .cc-action-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.cc-action-icon.blue { background: #eff6ff; color: #2563eb; }
.cc-action-icon.green { background: #ecfdf5; color: #059669; }
.cc-action-icon.purple { background: #f5f3ff; color: #7c3aed; }
.cc-action-icon.orange { background: #fff7ed; color: #ea580c; }

/* 4. Cuadrícula de Shortcuts y Favoritos */
.cc-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

@media (max-width: 900px) {
    .cc-grid-2col {
        grid-template-columns: 1fr;
    }
}

.cc-card {
    background: #ffffff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    padding: 1.25rem 1.45rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
}

.cc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.15rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.cc-card-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.cc-card-subtitle {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Items de Shortcuts y Favoritos */
.cc-shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.cc-shortcut-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: all 0.15s ease;
}

.cc-shortcut-item:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
}

.cc-shortcut-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #eef2ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cc-shortcut-info {
    flex: 1;
    min-width: 0;
}

.cc-shortcut-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-shortcut-meta {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-star-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, transform 0.15s ease;
    position: relative;
    z-index: 5;
}

.cc-star-btn svg {
    pointer-events: none !important;
}

.cc-star-btn:hover {
    color: #eab308;
    transform: scale(1.15);
}

.cc-star-btn.active,
.cc-star-btn.active svg {
    color: #eab308 !important;
    fill: #eab308 !important;
}

.cc-star-btn:not(.active) svg {
    color: #94a3b8;
    fill: none;
}

/* 5. Personal Workbench (Alertas y Actividad) */
.cc-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.cc-alert-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s ease;
    border: 1px solid transparent;
}

.cc-alert-row.warning {
    background: #fffbeb;
    border-color: #fef3c7;
    color: #92400e;
}

.cc-alert-row.info {
    background: #eff6ff;
    border-color: #dbeafe;
    color: #1e40af;
}

.cc-alert-row.danger {
    background: #fef2f2;
    border-color: #fee2e2;
    color: #991b1b;
}

.cc-alert-row:hover {
    filter: brightness(0.97);
}

.cc-alert-content {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.cc-alert-count {
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.08);
}

.cc-empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Lista de Actividad Reciente */
.cc-activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cc-activity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    background: #ffffff;
    text-decoration: none;
    color: inherit;
    transition: all 0.12s ease;
}

.cc-activity-row:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.cc-activity-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.cc-activity-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cc-activity-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-activity-sub {
    font-size: 0.74rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-activity-right {
    text-align: right;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.cc-activity-amount {
    font-size: 0.84rem;
    font-weight: 800;
    color: #0f172a;
}

.cc-activity-time {
    font-size: 0.7rem;
    color: #94a3b8;
}
