/* ==========================================================================
   MAESTRO IM — ESTILOS COMPLETOS V7.3 (ARQUITECTURA VISUAL V2 GLASSMORPHISM)
   ========================================================================== */

   #mim-panel-root {
    /* PALETA Y TOKENS VISUALES V2 */
    --mim-canvas: #070a10;
    --mim-app: #0d121c;
    --mim-sidebar: #0f1624;
    --mim-card: rgba(18, 26, 39, 0.98);
    --mim-border: rgba(148, 163, 184, 0.14);
  
    --mim-purple: #6D2B7D;
    --mim-purple-light: #83328A;
    --mim-cyan: #00C8FF;
    --mim-cyan-glow: rgba(0, 200, 255, 0.18);
    --mim-gold: #D4AF37;
  
    --mim-yellow-bg: #FEF08A;
    --mim-yellow-txt: #1E293B;
    --mim-green-bg: #86EFAC;
    --mim-green-txt: #064E3B;
    --mim-blue-bg: #93C5FD;
    --mim-blue-txt: #1E3A8A;
  
    --mim-white: #F8FAFC;
    --mim-muted: #94A3B8;
    --mim-danger: #F87171;
  
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    
    /* CANVAS GLOBAL CON ATMÓSFERA Y GRADIENTES RADIALES */
    background: 
      radial-gradient(ellipse at 8% 0%, rgba(0, 200, 255, 0.05) 0%, transparent 48%),
      radial-gradient(ellipse at 92% 100%, rgba(99, 102, 241, 0.04) 0%, transparent 48%),
      linear-gradient(180deg, #0e1420 0%, #080b11 100%) !important;
    color: var(--mim-white) !important;
    border-radius: 20px;
    border: 1px solid var(--mim-border);
    padding: 0 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    overflow: hidden;
    position: relative;
  }
  
  /* RESET ESTRUCTURAL LOCAL */
  #mim-panel-root,
  #mim-panel-root * {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  
  #mim-panel-root ul,
  #mim-panel-root li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* HEADER INSTITUCIONAL */
  #mim-panel-root .mim-header {
    background: linear-gradient(180deg, #0e1422 0%, #090e17 100%) !important;
    padding: 16px 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid var(--mim-border) !important;
    min-height: 100px !important;
    height: 100px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 10;
  }
  
  #mim-panel-root .mim-header-brand {
    display: flex !important;
    align-items: center !important;
    height: 80px !important;
  }
  
  #mim-panel-root .mim-header-logo-img {
    height: 80px !important;
    max-height: 80px !important;
    width: auto !important;
    max-width: 420px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 !important;
    border-radius: 6px;
  }
  
  #mim-panel-root .mim-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
  }
  
  #mim-panel-root .mim-header-tag {
    background: rgba(0, 200, 255, 0.08);
    border: 1px solid rgba(0, 200, 255, 0.32);
    color: var(--mim-cyan) !important;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 0 14px rgba(0, 200, 255, 0.08);
  }
  
  #mim-panel-root .mim-mobile-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--mim-border) !important;
    color: var(--mim-white) !important;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  #mim-panel-root .mim-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(0, 200, 255, 0.4) !important;
  }
  
  #mim-panel-root .mim-mobile-toggle svg {
    stroke: var(--mim-white) !important;
  }
  
  /* LAYOUT PRINCIPAL */
  #mim-panel-root .mim-app-body {
    display: flex;
    min-height: 680px;
    position: relative;
  }
  
  /* ==========================================================================
     SIDEBAR (MENÚ LATERAL COHERENTE V2)
     ========================================================================== */
  #mim-panel-root .mim-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #101724 0%, #090d15 100%) !important;
    border-right: 1px solid var(--mim-border);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    z-index: 100;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(14px);
  }
  
  /* TARJETA DE PERFIL EN SIDEBAR */
  #mim-panel-root .mim-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.16) !important;
    border-radius: 14px !important;
    margin-bottom: 24px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  }
  
  #mim-panel-root .mim-avatar-box {
    position: relative;
  }
  
  #mim-panel-root .mim-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00C8FF 0%, #6366F1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #FFF !important;
    font-size: 0.95rem;
    box-shadow: 0 0 14px rgba(0, 200, 255, 0.28);
  }
  
  #mim-panel-root .mim-online-dot {
    width: 9px;
    height: 9px;
    background-color: #10B981;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid #0f1624;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
  }
  
  #mim-panel-root .mim-user-details .mim-user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #F8FAFC !important;
    line-height: 1.25;
  }
  
  #mim-panel-root .mim-user-details .mim-user-plan {
    font-size: 0.7rem;
    color: #38BDF8 !important;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 3px;
  }
  
  #mim-panel-root .mim-nav-section-title {
    font-size: 0.65rem;
    font-weight: 800;
    color: #64748B !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 18px 0 8px 12px !important;
  }
  
  #mim-panel-root .mim-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  
  #mim-panel-root .mim-nav-item button {
    width: 100%;
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px !important;
    color: #94A3B8 !important;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent !important;
  }
  
  #mim-panel-root .mim-nav-item button svg {
    width: 18px !important;
    height: 18px !important;
    stroke: #94A3B8 !important;
    fill: none !important;
    stroke-width: 2;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }
  
  /* ESTADO HOVER DE LOS BOTONES DEL MENÚ */
  #mim-panel-root .mim-nav-item button:hover {
    background: rgba(255, 255, 255, 0.035) !important;
    color: #F8FAFC !important;
    transform: translateX(2px);
  }
  
  #mim-panel-root .mim-nav-item button:hover svg {
    stroke: #F8FAFC !important;
  }
  
  /* ESTADO ACTIVO INTEGRADO V2 (REEMPLAZA EL MORADO PLANO) */
  #mim-panel-root .mim-nav-item.active button {
    background: linear-gradient(90deg, rgba(0, 200, 255, 0.12) 0%, rgba(0, 200, 255, 0.02) 100%) !important;
    color: #F8FAFC !important;
    border-left: 3px solid #00C8FF !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 4px 14px rgba(0, 200, 255, 0.06) !important;
  }
  
  #mim-panel-root .mim-nav-item.active button svg {
    stroke: #00C8FF !important;
    filter: drop-shadow(0 0 6px rgba(0, 200, 255, 0.4));
  }
  
  #mim-panel-root .mim-btn-danger svg {
    stroke: var(--mim-danger) !important;
  }
  
  #mim-panel-root .mim-btn-danger:hover {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #FCA5A5 !important;
  }
  
  /* ==========================================================================
     WORKSPACE / ÁREA DE TRABAJO GENERAL
     ========================================================================== */
  #mim-panel-root .mim-workspace {
    flex: 1;
    padding: 32px 36px;
    box-sizing: border-box;
    overflow-y: auto;
    width: 100%;
  }
  
  #mim-panel-root .mim-view-panel {
    display: none;
    animation: mimFadeIn 0.25s ease-in-out;
  }
  
  #mim-panel-root .mim-view-panel.active {
    display: block;
  }
  
  @keyframes mimFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  #mim-panel-root .mim-greeting-header {
    margin-bottom: 24px;
  }
  
  #mim-panel-root .mim-greeting-header h1 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--mim-white) !important;
    letter-spacing: -0.3px;
  }
  
  #mim-panel-root .mim-greeting-header p {
    margin: 4px 0 0 0;
    color: var(--mim-muted) !important;
    font-size: 0.92rem;
  }
  
  /* TARJETAS CONTENEDOR GENERALES (BLOQUES V2) */
  #mim-panel-root .mim-board-card {
    background: linear-gradient(145deg, rgba(18, 26, 39, 0.98), rgba(11, 16, 25, 0.98));
    border: 1px solid var(--mim-border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.025);
  }
  
  #mim-panel-root .mim-board-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--mim-gold) !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  /* GRID GENERAL ADAPTABLE */
  #mim-panel-root .mim-postit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    width: 100%;
  }
  
  #mim-panel-root .mim-postit {
    border-radius: 12px;
    padding: 18px;
    min-height: 150px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    box-sizing: border-box;
  }
  
  #mim-panel-root .mim-postit:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
  }
  
  #mim-panel-root .mim-postit-yellow {
    background-color: var(--mim-yellow-bg) !important;
    color: var(--mim-yellow-txt) !important;
  }
  
  #mim-panel-root .mim-postit-green {
    background-color: var(--mim-green-bg) !important;
    color: var(--mim-green-txt) !important;
  }
  
  #mim-panel-root .mim-postit-blue {
    background-color: var(--mim-blue-bg) !important;
    color: var(--mim-blue-txt) !important;
  }
  
  #mim-panel-root .mim-postit-category {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    opacity: 0.85;
    letter-spacing: 0.5px;
  }
  
  #mim-panel-root .mim-postit-name {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 6px 0 8px 0;
    line-height: 1.25;
  }
  
  #mim-panel-root .mim-postit-footer {
    font-size: 0.72rem;
    opacity: 0.85;
    font-weight: 700;
  }
  
  #mim-panel-root .mim-postit-add-card {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(0, 200, 255, 0.35);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    min-height: 150px;
    transition: all 0.2s ease;
  }
  
  #mim-panel-root .mim-postit-add-card:hover {
    background: rgba(0, 200, 255, 0.04);
    border-color: var(--mim-cyan);
    box-shadow: 0 0 18px rgba(0, 200, 255, 0.18);
  }
  
  #mim-panel-root .mim-postit-add-card .plus-icon {
    font-size: 1.8rem;
    color: var(--mim-cyan) !important;
    margin-bottom: 6px;
    line-height: 1;
  }
  
  #mim-panel-root .mim-postit-add-card span {
    font-size: 0.82rem;
    color: var(--mim-muted) !important;
    font-weight: 600;
  }
  
  /* SECCIÓN CTAs */
  #mim-panel-root .mim-cta-section {
    margin-top: 28px;
  }
  
  #mim-panel-root .mim-cta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 12px;
  }
  
  #mim-panel-root .mim-cta-card {
    background: linear-gradient(135deg, rgba(16, 23, 36, 0.95), rgba(10, 14, 22, 0.98));
    border: 1px solid var(--mim-border);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  }
  
  #mim-panel-root .mim-cta-card-alt {
    border-color: rgba(0, 200, 255, 0.3);
  }
  
  #mim-panel-root .mim-cta-card h3 {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--mim-white) !important;
  }
  
  #mim-panel-root .mim-cta-card p {
    margin: 0 0 16px 0;
    font-size: 0.85rem;
    color: var(--mim-muted) !important;
    line-height: 1.4;
  }
  
  #mim-panel-root .mim-btn-cta {
    background: transparent !important;
    border: 1px solid var(--mim-cyan) !important;
    color: var(--mim-cyan) !important;
    padding: 9px 18px !important;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    width: fit-content;
    transition: all 0.2s ease;
  }
  
  #mim-panel-root .mim-btn-cta:hover {
    background: var(--mim-cyan) !important;
    color: #0b0f17 !important;
    box-shadow: 0 0 16px rgba(0, 200, 255, 0.35);
  }
  
  /* PLACEHOLDERS */
  #mim-panel-root .mim-placeholder-card {
    background: linear-gradient(145deg, rgba(18, 26, 39, 0.98), rgba(11, 16, 25, 0.98));
    border: 1px solid var(--mim-border);
    border-radius: 18px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  }
  
  #mim-panel-root .mim-placeholder-card svg {
    width: 48px !important;
    height: 48px !important;
    stroke: var(--mim-cyan) !important;
    fill: none !important;
    stroke-width: 1.5;
    margin-bottom: 12px;
  }
  
  #mim-panel-root .mim-placeholder-card h2 {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
    color: var(--mim-white) !important;
  }
  
  #mim-panel-root .mim-placeholder-card p {
    color: var(--mim-muted) !important;
    font-size: 0.9rem;
    margin: 0;
  }
  
  /* OVERLAY MÓVIL */
  #mim-panel-root .mim-sidebar-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 90;
  }
  
  /* RESPONSIVE (< 860px) */
  @media (max-width: 860px) {
    #mim-panel-root .mim-header {
      padding: 10px 16px !important;
      min-height: 70px !important;
      height: 70px !important;
    }
  
    #mim-panel-root .mim-header-brand {
      height: 50px !important;
    }
  
    #mim-panel-root .mim-header-logo-img {
      height: 50px !important;
      max-height: 50px !important;
    }
  
    #mim-panel-root .mim-mobile-toggle {
      display: flex !important;
      align-items: center;
      justify-content: center;
    }
  
    #mim-panel-root .mim-sidebar {
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      height: 100%;
      transform: translateX(-100%);
      box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
    }
  
    #mim-panel-root .mim-sidebar.open {
      transform: translateX(0);
    }
  
    #mim-panel-root .mim-sidebar-overlay.open {
      display: block;
    }
  
    #mim-panel-root .mim-workspace {
      padding: 20px 16px;
    }
  
    #mim-panel-root .mim-postit-grid {
      grid-template-columns: 1fr;
    }
  
    #mim-panel-root .mim-cta-grid {
      grid-template-columns: 1fr;
    }
  }